Orthanc y MySQL

Hello,
I have the following error:

W0405 11: 23: 06.113197 PluginsManager.cpp: 168] Your MySQL server cannot store DICOM files larger than 4MB
W0405 11: 23: 06.113197 PluginsManager.cpp: 168] => Consider increasing “max_allowed_packet” in “my.cnf” if this limit is insufficient for your use
E0405 11: 23: 06.206957 PluginsManager.cpp: 164] MySQL error (2006, HY000): MySQL server has gone away
W0405 11: 23: 06.206957 PluginsManager.cpp: 168] An active MySQL transaction was dismissed
E0405 11: 23: 06.206957 PluginsManager.cpp: 164] MySQL error (2006, HY000): MySQL server has gone away
E0405 11: 23: 06.206957 PluginsManager.cpp: 164] The database is not available, closing the connection
E0405 11: 23: 06.222550 PluginsManager.cpp: 164] Cannot rollback a non-existing transaction
E0405 11: 23: 06.222550 PluginsManager.cpp: 164] Uncatched error during some transaction rollback: Bad sequence of calls
E0405 11: 23: 06.222550 StoreScp.cpp: 197] Exception while storing DICOM: The database is currently not available (probably a transient situation)

If I increase the max_allowed_packet to 64M or 128M, other errors start to appear:

W0405 11: 08: 58.174066 PluginsManager.cpp: 168] Database is currently unavailable, retrying …
E0405 11: 09: 05.201379 PluginsManager.cpp: 164] MySQL error (2002, HY000): Can’t connect to MySQL server on ‘localhost’ (10061)
E0405 11: 09: 05.201379 PluginsManager.cpp: 164] Timeout when connecting to the database, giving up
E0405 11: 09: 05.208359 StoreScp.cpp: 197] Exception while storing DICOM: The database is currently not available (probably a transient situation)
E0405 11: 09: 05.208359 StoreScp.cpp: 272] Store SCP Failed: DIMSE Failed to send message
0006: 031d TCP I / O Error (A connection established by the software on your host computer has been aborted …) occurred in routine: writeDataPDU
E0405 11: 09: 05.217892 StoreScp.cpp: 272] Store SCP Failed: DIMSE Read PDV failed
0006: 0310 DUL network closed

Any ideas?

Thanks
Marcelo

Hello,

Those questions are more related to MySQL than to Orthanc. The following line indicates that Orthanc cannot contact your MySQL server in a stable way:

E0405 11: 23: 06.206957 PluginsManager.cpp: 164] MySQL error (2006, HY000): MySQL server has gone away

Here is the MySQL documentation about this error code 2006:

https://dev.mysql.com/doc/refman/8.0/en/gone-away.html

According to this documentation, increasing “max_allowed_packet” is indeed a way to solve this issue.

The other error code indicates a problem with your UNIX socket:

E0405 11: 09: 05.201379 PluginsManager.cpp: 164] MySQL error (2002, HY000): Can’t connect to MySQL server on ‘localhost’ (10061)

Given the fact that Orthanc cannot contact the database, it is normal that “Store SCP failed”. Here is the MySQL documentation about error code 2002:
https://dev.mysql.com/doc/refman/8.0/en/can-not-connect-to-server.html

There are multiple discussions on Internet about this error, for instance:
https://stackoverflow.com/a/8084959/881731

HTH,
Sébastien-

Thanks Sébastien,

MySql worked very badly. Tried changing max_allowed_packet but that caused other errors.

Now I installed postgresql and it works perfect.

Thank you
Marcelo