G
G
German Zvonchuk2015-11-10 15:12:39
Node.js
German Zvonchuk, 2015-11-10 15:12:39

Why Error: Connection lost: The server closed the connection on NodeJS v4.2.1?

Good afternoon
I installed NodeJS v4.2.1 on CentOS release 6.7, connected the Socket.IO v1.3.7 framework for delivering data via a web socket to the browser and launched this whole economy using PM2, after which I ran into the following problem.
Periodically, NodeJS can not be reached.
Here's what's in the browser:
fcef38b848374e4a9584ac54b1baf34b.jpg
Here's what's on the server in the logs.
I can not understand what it could be connected with. Maybe some of you faced a similar problem?

[email protected] [/home/nodejsv4.2.1]# tail -f /root/.pm2/logs/node-app-error-0.log
   at doNTCallback2 (node.js:439:9)
   at process._tickDomainCallback (node.js:394:17)
Error: Connection lost: The server closed the connection.
   at Protocol.end (/home/nodejsv4.2.1/node_modules/mysql/lib/protocol/Protocol.js:103:13)
   at Socket.<anonymous> (/home/nodejsv4.2.1/node_modules/mysql/lib/Connection.js:102:28)
   at emitNone (events.js:72:20)
   at Socket.emit (events.js:166:7)
   at endReadableNT (_stream_readable.js:903:12)
   at doNTCallback2 (node.js:439:9)
   at process._tickDomainCallback (node.js:394:17)
Error: Connection lost: The server closed the connection.
   at Protocol.end (/home/nodejsv4.2.1/node_modules/mysql/lib/protocol/Protocol.js:103:13)
   at Socket.<anonymous> (/home/nodejsv4.2.1/node_modules/mysql/lib/Connection.js:102:28)
   at emitNone (events.js:72:20)
   at Socket.emit (events.js:166:7)
   at endReadableNT (_stream_readable.js:903:12)
   at doNTCallback2 (node.js:439:9)
   at process._tickDomainCallback (node.js:394:17)

I will now run NodeJS without PM2 and see how it works.
Interestingly, exactly the same configuration on Debian Jessie works without problems, but then it crashes.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DIvan4ik, 2017-09-06
@DIvan4ik

Did you manage to solve the problem in a year? share)
a similar problem but without PM2
I start node through init.d on Centos 6.9 node 8.4.0 (the last one is not the current moment)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question