snapdrop icon indicating copy to clipboard operation
snapdrop copied to clipboard

Server issue (Not a complain, a query)

Open ghost opened this issue 3 years ago • 21 comments

Right now as I am writing this, snapdrop.net isn't working with the error being The Snapdrop-Server cannot be reached. This isn't a complain, I just wanna learn what does it mean exactly? What server is snapdrop talking about?

Would also appreciate if someone could explain how WebRTC works in a nutshell.

ghost avatar Oct 14 '22 16:10 ghost

Also for me, very strage... Waiting that the problem is solved, meanwhile you can try using my Node.js version here: https://node-snapdrop.onrender.com/


@RobinLinus is there any other strange server error causing this issue?

Bellisario avatar Oct 14 '22 18:10 Bellisario

Also if you'd prefer a server independent version you can use my desktop version node-snapdrop-electron

JustSch avatar Oct 14 '22 18:10 JustSch

Update

Seems Snapdrop is working properly now!

Bellisario avatar Oct 15 '22 13:10 Bellisario

Snapdrop is still down :/

nikkehtine avatar Oct 16 '22 18:10 nikkehtine

It does seem to be down again. I wonder what keeps causing it to go down. Edit: It is up again

JustSch avatar Oct 16 '22 18:10 JustSch

Seems to be up another time for me

Bellisario avatar Oct 17 '22 06:10 Bellisario

@Bellisario looks like the fix made it worse, no?

RobinLinus avatar Oct 19 '22 23:10 RobinLinus

looks like the fix made it worse, no?

Probably same as before... Nevertheless rather unsatisfactory unfortunately :-/

fm-sys avatar Oct 20 '22 06:10 fm-sys

@Bellisario looks like the fix made it worse, no?

Yes, it looks like that's not solving the problem... I think in this case the best solution could be (for now) to use something like pm2 to restart the server on crash (or something similar with Docker).

Bellisario avatar Oct 20 '22 13:10 Bellisario

As snapdrop.net is frequently not available (just have a look at the issues 😱), is there anything that we can do to improve the stability of the service? What are the actual reasons for the recurring downtimes? Could you please share some more details @RobinLinus?

svenjacobs avatar Oct 25 '22 18:10 svenjacobs

@svenjacobs looks like the server breaks whenever there is too much load. Also someone keeps trying to DoS the Snapdrop server. We started to port it to Rust for better stability and performance https://github.com/RobinLinus/snapdrop/pull/521

RobinLinus avatar Oct 26 '22 09:10 RobinLinus

Down again.

$ curl --include https://snapdrop.net/
curl: (7) Failed to connect to snapdrop.net port 443 after 39 ms: Connection refused

tuupola avatar Oct 26 '22 14:10 tuupola

hi @RobinLinus ,This server problem you mention is related to the loading of the page? what about giving pwa offline capability to the page? could it work to solve this problem?

Pkcarreno avatar Oct 26 '22 14:10 Pkcarreno

no matter what you do to the client side you will always need a running server for Snapdrop to work. This includes the (already implemented) offline capabality by caching as PWA via serviceworker.

schlagmichdoch avatar Nov 08 '22 19:11 schlagmichdoch

The domain is registered for Domain.com, and their DDoS protection is $15 a month. Maybe we could donate towards it?

nikkehtine avatar Nov 09 '22 10:11 nikkehtine

The domain is registered for Domain.com, and their DDoS protection is $15 a month. Maybe we could donate towards it?

I guess before paying for DDoS protection, we could first deploy snapdrop containerized as @Bellisario suggested with pm2 or docker. I provided two PRs that modify the docker configuration a bit to enable the use of the provided docker-compose on production #550 #549 @RobinLinus what do you think? Could you deploy snapdrop dockerized to increase stability?

schlagmichdoch avatar Dec 22 '22 14:12 schlagmichdoch

the best solution could be (for now) to use something like pm2 to restart the server on crash (or something similar with Docker).

Here's a dependency-free alternative :

process.on(
    'uncaughtException',
    () => {
        process.once(
            'exit',
            () => spawn(
                process.argv.shift(),
                process.argv,
                {
                    cwd: process.cwd(),
                    detached: true,
                    stdio: 'inherit'
                }
            )
        );
        process.exit();
    }
);

KaKi87 avatar Dec 26 '22 19:12 KaKi87

the best solution could be (for now) to use something like pm2 to restart the server on crash (or something similar with Docker).

Here's a dependency-free alternative :

process.on(
    'uncaughtException',
    () => {
        process.once(
            'exit',
            () => spawn(
                process.argv.shift(),
                process.argv,
                {
                    cwd: process.cwd(),
                    detached: true,
                    stdio: 'inherit'
                }
            )
        );
        process.exit();
    }
);

Nice!

When using this snippet I got the following error message:

ReferenceError: spawn is not defined

This import fixed the issue:

var {spawn} = require('child_process')

Reference: https://stackoverflow.com/a/44643419/14678591

schlagmichdoch avatar Dec 30 '22 16:12 schlagmichdoch

Yeah I didn't add the import statement sorry. ^^

KaKi87 avatar Dec 30 '22 16:12 KaKi87

Also if you'd prefer a server independent version you can use my desktop version node-snapdrop-electron

Does this work completely offline or does it rely on google's stun servers?

Rihcus avatar Jan 09 '23 18:01 Rihcus

Completely offline. Funny enough my Internet went out (router was still functional just no connection to the outside internet) when I first started working on it and it still worked

JustSch avatar Jan 09 '23 18:01 JustSch