Repository navigation
HTTPS Server crashing randomly (With solution) #13170
Description
Activity
Please include the information that was asked of you in the issue template:
Please fill in as much of the template below as you're able. Version: output of `node -v` Platform: output of `uname -a` (UNIX), or version and 32 or 64-bit (Windows) Subsystem: if known, please specify affected core module name If possible, please provide code that demonstrates the problem, keeping it as simple and free of external dependencies as you are able.Version: node 7.10.0
Platform: Linux ip-172-30-0-191 3.13.0-48-generic #80-Ubuntu SMP Thu Mar 12 11:16:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Subsystem: net.js module.try { var options = { SNICallback: function (domain, cb) { if (!secureContext[domain]) { domain = 'default'; } cb(null, tls.createSecureContext(secureContext[domain])); }, key: secureContext['default'].key, cert: secureContext['default'].cert, }; global.serverHTTPS = https.createServer(options, app); } catch (err){ console.error(err.message); console.error(err.stack); } global.serverHTTPS.on('connection', onConnection); global.serverHTTPS.on('error', onError); global.serverHTTPS.listen(global.config.httpsPort);This is the code I use to open the HTTPS server and it works.. but after a while it give the error above.
I'm currently running the server with the fix I put above and it hasn't have any issue so far, the problem seems to have stopped. But I had to recompile node.. so it's just a temporal solution or if you can find the root of the problem.
- addedtlsIssues and PRs related to the tls subsystem.Issues and PRs related to the tls subsystem.
on May 23, 2017 /cc @nodejs/crypto
@YindSoft are you able to trace through the application, perhaps with the inspector, and find out where
this._handlebecomes falsey (or provide a full code sample that can be executed)? There is a check a few lines up in that same function that should prevent what you're seeing, but is not apparently.@cjihrig I can't trace it as it occurs in my production server, It's really strange indeed as you mention it has a check above, but somehow somewhere in the middle this._handle turns to NULL and throws up that error.
The issue is that I couldn't replicate the issue in my local server or test servers, I think it occurs when there is quite a bit of traffic.Maybe it's not related but being the
clustermodule involved and_handleset toNULLsounds a lot like: #3072After a while, it doesn't throw the errors, but found out that the workers keep on dying without any error message: (After several hours running)
Worker 52933 died -> 62684 born.
Worker 52738 died -> 62690 born.
Worker 52956 died -> 64368 born.
Worker 52962 died -> 64369 born.
Worker 52683 died -> 64380 born.Any thoughts?
Without a more complete reproduction, it's hard to say.
@YindSoft Do you know if you still experience this with Node.js 8.3.0?
Should this remain open?
I'm reasonably sure this has been fixed by #14588. Not yet released but will be soon.
I've been experiencing some issues with a cluster https server.
It throws the following error:
I went ahead and change that line for:
if (req.async && this._handle && this._handle.writeQueueSize != 0)
Recompile node and it seems to have solve the problem.
But I don't really know why it ocurrs and how to replicate it, I just see it almost every 10 minutes in my logs.