meteor-mysql icon indicating copy to clipboard operation
meteor-mysql copied to clipboard

Connection lost: The server closed the connection.

Open kumarravigithub opened this issue 8 years ago • 7 comments

The timeout setting of my.cnf determines this error. I have 60 seconds set in my.cnf and the program throws error in 60 seconds. Meteor server restarts and again in 60 seconds the error comes.

Here is the error: W20170220-01:46:56.992(5.5)? (STDERR) Error: Connection lost: The server closed the connection. W20170220-01:46:56.993(5.5)? (STDERR) at Protocol.end (/root/.meteor/packages/numtel_mysql/.1.0.6.1jd0okl++os+web.browser+web.cordova/npm/node_modules/mysql/lib/protocol/Protocol.js:109:13) W20170220-01:46:56.994(5.5)? (STDERR) at Socket.<anonymous> (/root/.meteor/packages/numtel_mysql/.1.0.6.1jd0okl++os+web.browser+web.cordova/npm/node_modules/mysql/lib/Connection.js:102:28) W20170220-01:46:56.996(5.5)? (STDERR) at emitNone (events.js:72:20) W20170220-01:46:56.997(5.5)? (STDERR) at Socket.emit (events.js:166:7) W20170220-01:46:56.998(5.5)? (STDERR) at endReadableNT (_stream_readable.js:923:12) W20170220-01:46:56.999(5.5)? (STDERR) at nextTickCallbackWith2Args (node.js:458:9) W20170220-01:46:57.000(5.5)? (STDERR) at process._tickCallback (node.js:372:17) => Exited with code: 1

kumarravigithub avatar Feb 19 '17 20:02 kumarravigithub

Tried to do the Keep Alive trick. Did not work keepAliveQuery = function() { liveDb.select( "SELECT * FROM ost_ticket__cdata LIMIT 1", [ { table: 'ost_ticket__cdata' } ] ); console.log("Keep Alive"); } // reconnect(); Meteor.setInterval(keepAliveQuery, 3000);

kumarravigithub avatar Feb 19 '17 20:02 kumarravigithub

Having the exact same issue, though it just started recently for us. Need some sort of fix as this crashes the application ast regular intervals. Meteor 1.4.3.2 if that matters.

ExcelNet-Public avatar Mar 28 '17 23:03 ExcelNet-Public

Still facing it. Anybody???

kumarravigithub avatar Mar 31 '17 13:03 kumarravigithub

Yes, we are still having this issue and the keep alive trick did not help us at all. Not 100% convinced the issue is not on the MySQL side of things. Very difficult to debug.

Larry-Home avatar Apr 01 '17 03:04 Larry-Home

@techsavyravi: Any chance you are running on a Windows system? The reason I ask is that is where all of our development takes place and the problem was seen. However, I push the same code to our Linux based staging server and the problem completely disappears. The staging and development machines sit on the same LAN segment, behind the same firewall to the MySQL server,... So I am wondering if it is not a Windows and/or Meteor issue more specifically. Would really like to nail it down as it really slows development and have not figured out a workaround.

ExcelNet-Public avatar Apr 10 '17 12:04 ExcelNet-Public

So for me this "issue" is over. We are on Meteor 1.4.4.1 and were still facing the issues. So, decided to start "fresh". I ran the meteor reset command and let the code rebuild with the new version of meteor and NO artifacts from previous builds / releases. Application has been running as expected again. Hate it when ghosts enter the code. Please make sure you are aware of the ramifications of running that command if you are going to give this a try. It basically wipes EVERYTHING from the project.

ExcelNet-Public avatar Apr 14 '17 15:04 ExcelNet-Public

This issue could be caused by the wait_timeout, which we have no work-arround for yet as far as I can see.

keepAliveQueries will not work in this specific case.

https://github.com/numtel/meteor-mysql/issues/86

Fabbok1x avatar Mar 26 '20 20:03 Fabbok1x