Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Connection lost to MySQL server #558

wstucco opened this Issue · 7 comments

3 participants

Massimo Ronca Matthew Eernisse Emanuele Di Saverio
Massimo Ronca

When the app is idle, it happens that the connection to MySQL server is lost and I have to restart it to make it work again.

This is the message in the error log

Error: Connection lost: The server closed the connection.
at Protocol.end (<project>\node_modules\mysql\lib\protocol\Protocol.js:78:13)
at Socket.onend (stream.js:79:10)
at Socket.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:920:16
at process._tickDomainCallback (node.js:459:13)

I can't really reproduce the bug, but I'm sure about a couple of things:

  • it happens during the night or in the weekends (idle app)
  • it doesn't happen if the app is launched in development mode, with no workers and no cluster
Matthew Eernisse

We had a PR a while back that was supposed to have improved this situation: geddy/model#164

I believe the fix is only in master -- if it's a serious problem, we can look at cherry-picking it into the release branch.

Emanuele Di Saverio

I also encountered this issue - it locks up the server completely, forces restart :/

Matthew Eernisse
mde commented

The fix for this has been pushed out to NPM -- model v0.5.7. Update your deps and you should pick up this fix. Let me know how it works for you.

Emanuele Di Saverio

Hello mde,
the fix pushed to 0.5 branch doesn't compile (reconnectattempts undeclared)
(Probably a mistake in cherry-pick from edencore:master)

This means that current geddy 0.12.5 (depending on model 0.5.7) crashes with mysql adapter.

All this IMHO, i'm kind of newbie in GitHub and Geddy.

(fix in master looks ok

Matthew Eernisse
mde commented

Yes, probably bad conflict resolution from the cherry-pick. I've fixed this, added an actual test, and pushed it out to NPM, Model v0.5.8. Thanks for your patience.

Matthew Eernisse mde closed this
Emanuele Di Saverio

Unfortunately the fix is unsuccessful. Same problem, after around 12+ hours of inactivity, mysql adapter faults same way when server closes the connection.

Emanuele Di Saverio

Actually, problem is not bound to inactivity. Even pinging DB every hour (through geddy/model obviously) doesnt' fix.

Any pointers? At the moment, I cannot keep my Geddy / MySQL server in production, it just keeps crashing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.