question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reconnection after connection lost

See original GitHub issue

Hi, congratulations for this module, I use it in production on my platform.

I use pm2 as a process manager.

Sometimes I get the following error:

{ Error: Connection lost: The server closed the connection.
    at Protocol.end (/home/imroot/node_modules/mysql/lib/protocol/Protocol.js:112:13)
    at Socket.<anonymous> (/home/imroot/node_modules/mysql/lib/Connection.js:94:28)
    at Socket.<anonymous> (/home/imroot/node_modules/mysql/lib/Connection.js:526:10)
    at Socket.emit (events.js:203:15)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19) fatal: true, code: 'PROTOCOL_CONNECTION_LOST' }

I think it’s because my app occasionally disconnects from the database.

I found this and much more, but I’m not sure how to adapt it to your model with this different syntax, could you help me out? it could be useful for many.

Thanks

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
8secz-johndpopecommented, Oct 13, 2021

I use dynamodb to pick up from the last known rowid / timestamp that’s been processed. https://gist.github.com/8secz-johndpope/4bf52a0d40071bfa75bfea35aea7f5b9 On reconnect - I just flash forward through transactions…

0reactions
muriloneocommented, Oct 5, 2021

does anyone has found a way to keep connected ? I have a problem that the connection can break on the middle of a processing that is activated by a insert trigger.

Read more comments on GitHub >

github_iconTop Results From Across the Web

the connection has been lost. attempting to reconnect to your ...
I have a brand new Windows 2008 R2 server with Remote Desktop Services installed. My old server was a Windows 2003 server running...
Read more >
No reconnection after connection lost · Issue #431 - GitHub
I try to reconnect after connection lost like there and it doen's works https://github.com/felixge/node-mysql#server-disconnects.
Read more >
ESP32 Reconnect to Wi-Fi After Lost Connection network
This quick guide shows how you can reconnect your ESP32 to a Wi-Fi network after losing the connection. This can be useful in...
Read more >
reconnection after connection lost fails . - Google Groups
When the connection to the server gets lost (i.e routerseset, dsl reconnection,), and I try to reconnect with the same ffmpeg cmdline, nginx'...
Read more >
Blynk Reconnect when wifi connection is lost
Hello,. I made a simple Blynk program, but the connection to my internet is not great. sometimes he is losing connection, but it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found