numtel / meteor-mysql

Reactive MySQL for Meteor
MIT License
343 stars 41 forks source link

Connection lost: The server closed the connection. #81

Open kumarravigithub opened 7 years ago

kumarravigithub commented 7 years ago

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 commented 7 years ago

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);

ExcelNet-Public commented 7 years ago

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.

kumarravigithub commented 7 years ago

Still facing it. Anybody???

Larry-Home commented 7 years ago

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.

ExcelNet-Public commented 7 years ago

@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 commented 7 years ago

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.

Fabbok1x commented 4 years ago

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