Orthanc lost connection to mysql after some time

Hi All,

In my test server there could be days of inactivity. What is the best way to maintain the connection to prevent error like this?

/var/log/orthanc/Orthanc.log.20210922-165731.743509:E0923 10:52:54.363605 PluginsManager.cpp:164] MySQL error (4031,HY000): The client was disconnected by the server because of inactivity. See wait_timeout and interactive_timeout for configuring this behavior.

Thanks!

Try this? https://stackoverflow.com/questions/23399111/safely-keeping-mysql-connections-alive

Though, I’m not sure if this is the best way.

Is this a fatal error (you have to restart Orthanc afterwards) or Orthanc does actually retry and recreates the connection ?

It appears the lost is permanent as I had to restart Orthanc in order to upload new files. What is strange though is the Explorer is still up.

I am still at a loss as to how to resolve this error:

E1008 13:37:47.535569 PluginsManager.cpp:164] MySQL error (4031,HY000): The client was disconnected by the server because of inactivity. See wait_timeout and interactive_timeout for configuring this behavior.

I am using the orthanc-mysql ubuntu package for 20.04(Focal). I can’t upload new studies to Orthanc when this happens but it appears querying using the Explorer and REST API still work. The only to get out of this situation is restarting Orthanc. Any insights into this is greatly appreciated!

Hi,

Have you tried increasing the timeouts as suggested by the error message ? (https://mariadb.com/docs/reference/mdb/system-variables/interactive_timeout/)

If yes, could you provide a complete setup like this one and complete instructions to reproduce (e.g how long do we have to wait to observe the error ?)

Best regards

Alain

Hi Alain,
I changed the wait_timeout and interactive_timeout to max value (31536000). I don’t know if this is the best practice but at least it would keep the thing from timing out.

Thanks