snapdrop icon indicating copy to clipboard operation
snapdrop copied to clipboard

Connection lost. Retry in 5 seconds...

Open gitwittidbit opened this issue 3 years ago • 19 comments

Hi,

this is a new plain vanilla (docker) install done yesterday. Followed the install instructions and set up snapdrop server without any issues. No modifications.

Before going "live" I am testing it locally. But I keep getting "Connection lost. Retry in 5 seconds"

What am I missing?

Thanks

gitwittidbit avatar May 29 '21 20:05 gitwittidbit

I'm getting the same message.

marcelo-earth avatar May 30 '21 02:05 marcelo-earth

I'm getting the same message.

While this does not exactly help me with my issue, it is reassuring to know that I am not the only experiencing this :)

BTW: Yesterday I was getting the same from snapdrop.net (on my PC while my iPhone wasn't even able to connect at all).

So maybe this comes from a recent update that was applied to snapdrop.net and that was delivered to me when I installed for the first time?

But since I am not getting this message from snapdrop.net anymore today, there would have been another update. was there? if so, how do I get this update on my machine? let's see...

gitwittidbit avatar May 30 '21 08:05 gitwittidbit

Sorry, the server was down.

PaulSzymanski avatar May 30 '21 10:05 PaulSzymanski

Please unclose.

That the snapdrop.net server was down does not explain the issues with my own deployment (as per my original post).

Thanks!

gitwittidbit avatar May 30 '21 11:05 gitwittidbit

Oops, I'm sorry!

PaulSzymanski avatar May 30 '21 16:05 PaulSzymanski

Btw, we are not using the docker setup to serve snapdrop.net. I did not try running the docker setup in a long time...

PaulSzymanski avatar May 30 '21 16:05 PaulSzymanski

there would have been another update. was there?

No, there was no update. The server was shut down because the AWS budget limit was hit.

PaulSzymanski avatar May 30 '21 16:05 PaulSzymanski

okay, so the issues are not related.

So what might be causing my "Connection lost"?

BTW: Why are you not using docker to host snapdrop.net or why does the self hosting package use docker?

gitwittidbit avatar May 30 '21 20:05 gitwittidbit

help please!

gitwittidbit avatar May 31 '21 21:05 gitwittidbit

Are there any logs that I could check for the reason?

gitwittidbit avatar Jun 01 '21 15:06 gitwittidbit

Does anyone have any idea what might be going on?

I'd love to use snapdrop, but it simply isn't working for me...

gitwittidbit avatar Jun 08 '21 19:06 gitwittidbit

So what might be causing my "Connection lost"?

The Websocket connection is not working. Make sure the node server is running and the server is available at /server.

BTW: Why are you not using docker to host snapdrop.net or why does the self hosting package use docker?

Someone created a docker setup so it's easy for others to run snapdrop. Also very useful while developing. We do not use it to host snapdrop.net because we do not want to install, configure and manage docker on a tiny ec2 instance.

PaulSzymanski avatar Jun 08 '21 20:06 PaulSzymanski

The Websocket connection is not working. Make sure the node server is running and the server is available at /server.

Actually, the node server is stopped. And I found this in the log:

`npm ERR! If you believe this might be a permissions issue, please double-check the

npm ERR! permissions of the file and its containing directories, or try running

npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:

npm ERR! /home/node/.npm/_logs/2021-05-31T21_42_29_655Z-debug.log

npm WARN checkPermissions Missing write access to /home/node/app

npm WARN [email protected] No description

npm WARN [email protected] No repository field.

npm ERR! code EACCES

npm ERR! syscall access

npm ERR! path /home/node/app

npm ERR! errno -13

npm ERR! Error: EACCES: permission denied, access '/home/node/app'

npm ERR! [Error: EACCES: permission denied, access '/home/node/app'] {

npm ERR! errno: -13,

m ERR! code: 'EACCES',

npm ERR! syscall: 'access',

npm ERR! path: '/home/node/app'

npm ERR! }

npm ERR! The operation was rejected by your operating system.

npm ERR! It is likely you do not have the permissions to access this file as the current user

npm ERR! If you believe this might be a permissions issue, please double-check the

npm ERR! permissions of the file and its containing directories, or try running

npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:

npm ERR! /home/node/.npm/_logs/2021-06-09T20_58_46_545Z-debug.log`

gitwittidbit avatar Jun 09 '21 21:06 gitwittidbit

see if that helps https://github.com/RobinLinus/snapdrop/issues/146#issuecomment-651078650

PaulSzymanski avatar Jun 11 '21 20:06 PaulSzymanski

Well, yes and no:

The suggestion to change the rights to the snapdrop folder unfortunately did not work.

But the other user's idea of editing the docker-compose.yml file and running the container as "root" did.

Obviously, that's not ideal (although in my case the risk is mitigated by the fact that I am running docker inside an lxc container which means that "root" inside the lxc container is not the real root of the machine).

So I would still like to explore the suggestion to change the rights to the snapdrop folder (and reverting to running the container as "node" instead of "root"). But looking at a list of the machine's users, there is no user "node". Might that have to do with the problem?

Thanks

gitwittidbit avatar Jun 14 '21 20:06 gitwittidbit

So, what could I do to be able to run the docker as "node" instead of "root"?

gitwittidbit avatar Jun 27 '21 18:06 gitwittidbit

But looking at a list of the machine's users, there is no user "node". Might that have to do with the problem?

The user is defined in the container: https://github.com/nodejs/docker-node/blob/1d04d72efc47227406ba321479eef0e58484f80a/14/alpine3.11/Dockerfile#L6

At this point I have to guess. Is SELinux or something similar blocking the access? Can users other than root in the lxc container access files on the lxc host? Did you change the rights to the snapdrop folder recursively? Look at the container logs. docker logs, selinux logs, lxc logs, journalctl...

PaulSzymanski avatar Jul 02 '21 12:07 PaulSzymanski

I'm facing the same issue 😕

Shot 2021-11-04 at 10-43-49

jahirfiquitiva avatar Nov 04 '21 15:11 jahirfiquitiva

把docker-compose.yml 里的user: "node” 注释

hankunlun avatar May 30 '23 06:05 hankunlun