nodejs / help

:sparkles: Need help with Node.js? File an Issue here. :rocket:
1.44k stars 276 forks source link

Node process at VPSs terminates without error. #4399

Open deEr-full-stop opened 1 month ago

deEr-full-stop commented 1 month ago

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

- [X] I have looked for issues that already exist before submitting this
- [X] 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 commented 1 month ago

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 commented 1 month ago

I run it with DEBUG now in a screen😊.