Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node process at VPSs terminates without error. #4399

Closed
2 tasks done
deEr-full-stop opened this issue May 17, 2024 · 8 comments
Closed
2 tasks done

Node process at VPSs terminates without error. #4399

deEr-full-stop opened this issue May 17, 2024 · 8 comments

Comments

@deEr-full-stop
Copy link

deEr-full-stop commented May 17, 2024

Node.js Version

v22.2.0

NPM Version

v10.7.0

Operating System

Linux vps-ba79510b 6.5.0-35-generic #35-Ubuntu SMP PREEMPT_DYNAMIC Fri Apr 26 11:23:57 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

http, https

Description

The Node process terminates without any error.

I have had this ongoing issue since 2020. I first gave the VPS hoster the blame, but it took years to clear myself completely of the blame. I recently spun up a simple 24 lines 301-redirect Node server, and it sometimes exits without error too. One hoster told me, that the VPS environment can cause Node.js crashes.

I can tell you which hosters I tried, there were 2. But please tell me, if this is the right place to talk about hoster names.

Minimal Reproduction

  1. I know this is odd, but book a VPS.
  2. Get a domain.
  3. Find an IP-address or domain you can 301 to.
  4. I use an uptime monitoring service to get messaged when the server is down. On my current VPS this can take around 2 weeks.
  5. The code
var HTTP = require('http');
var HTTPS = require('https');
var fs = require('fs');
var constants = require('constants');

var options = {
  key: fs.readFileSync( '/path/to/key' )
  , cert: fs.readFileSync( '/path/to/cert' )
  , ca: fs.readFileSync( '/path/to/ca' )
  , honorCipherOrder: true
  , secureOptions: constants.SSL_OP_NO_SSLv2 | constants.SSL_OP_NO_SSLv3
  , ciphers: 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA'
};

var sServer = HTTPS.createServer(options, function ( req, res ) {
    res.writeHead ( 301, {'Location' : 'https://example.com'});
    res.end();
    return;
}).listen(443);

var server = HTTP.createServer(function ( req, res ) {
  res.writeHead ( 301, {'Location': 'https://example.com'});
  res.end();
}).listen(80);

Output

There is none.

Before You Submit

  • I have looked for issues that already exist before submitting this
  • My issue follows the guidelines in the README file, and follows the 'How to ask a good question' guide at https://stackoverflow.com/help/how-to-ask
@preveen-stack
Copy link
Contributor

Is it possible for you to run it with https://www.npmjs.com/package/debug and see if we can get some insight

@deEr-full-stop
Copy link
Author

I run it with DEBUG now in a screen😊.

@avivkeller
Copy link
Member

Hey there,

If the issue is specific to a VPS, try contacting your provider to see if they are aware of such issues.

If your issue is also occurring locally, please leave a comment. If not, I consider this non-actionable, and therefore closeable.

@deEr-full-stop
Copy link
Author

deEr-full-stop commented Aug 2, 2024

Hej there☺️,

long time no crashing of the VPS. But today it happened again.

As I said I run it in DEBUG mode at a screen.

But all I can add now is this:
screen -R resulted in a new screen.

So somehow the server must have been rebooted.

The status of this thread is monitored by my hoster, so I ask you to keep it open.

The command uptime yield "up 40 min".

Somehow the VPS seems to reboot.

Any idea what to log or where to look?

Is it possible to reboot a server through Node.js from the outside?☺️

Edit: Should I use the linked technique here https://unix.stackexchange.com/a/10351 ?

@avivkeller
Copy link
Member

Is this only reproducible on the VPS? If so, please reach out to them.

If you can also reproduce locally, could you provide debug logs?

Thank you

@deEr-full-stop
Copy link
Author

It is reprodubible on VPSs of 2 hosters. My current hoster told me to open this issue here, and he will monitor it.

I just started to try to reproduce it locally.

Copy link

github-actions bot commented Feb 2, 2025

It seems there has been no activity on this issue for a while, and it is being closed in 30 days. If you believe this issue should remain open, please leave a comment.
If you need further assistance or have questions, you can also search for similar issues on Stack Overflow.
Make sure to look at the README file for the most updated links.

@github-actions github-actions bot added the stale label Feb 2, 2025
Copy link

github-actions bot commented Mar 4, 2025

It seems there has been no activity on this issue for a while, and it is being closed. If you believe this issue should remain open, please leave a comment.
If you need further assistance or have questions, you can also search for similar issues on Stack Overflow.
Make sure to look at the README file for the most updated links.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants