Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random Error #7

Open
Deception-O opened this issue Jul 9, 2018 · 1 comment
Open

Random Error #7

Deception-O opened this issue Jul 9, 2018 · 1 comment

Comments

@Deception-O
Copy link

Uncaught Error: C:/Users/Ben/justauserbot/mysql/client.lua:98: attempt to index local 'task' (a nil value) stack traceback: C:/Users/Ben/justauserbot/mysql/client.lua:98: in function 'f' C:/Users/Ben/justauserbot/mysql/client.lua:124: in function 'handler' [string "bundle:deps/core.lua"]:248: in function 'emit' [string "bundle:deps/stream/stream_readable.lua"]:992: in function <[str ing "bundle:deps/stream/stream_readable.lua"]:985> [string "bundle:deps/timer.lua"]:123: in function <[string "bundle:deps/ timer.lua"]:119> [C]: in function 'run' [string "bundle:init.lua"]:52: in function <[string "bundle:init.lua"]:4 7> [C]: in function 'xpcall' [string "bundle:init.lua"]:47: in function 'fn' [string "bundle:deps/require.lua"]:310: in function <[string "bundle:dep s/require.lua"]:266>

I appear to be getting this error randomly without even querying anything, have you seen something simular before?

@Be1zebub
Copy link

Be1zebub commented Oct 19, 2023

its because mysql server close connection with ECONNRESET after a timeout (show variables like 'wait_timeout';)
to solve this, you need to keep the connection alive:

  1. send an empty request using client:ping() every 60 seconds
  2. reconnect to database in ECONNRESET hander & socket:on("close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants