MathematicalMedicine / diver-issues

Semipublic tracking of issues for the DIVER front end
0 stars 0 forks source link

Stale diverDownloadTable_ tables can cause a download to fail #252

Closed Viqsi closed 2 months ago

Viqsi commented 2 months ago

[2024-09-13 11:22:54,629] ERROR in diverRPC: ERROR DETAILS: {'message': "Table 'diverDownloadTable_6' already exists"}, 500 Traceback (most recent call last): File "/var/lib/diver/diverRPC/diverAPI.py", line 177, in proccall_errcheck cursor.callproc(proc, procargs) File "/var/lib/diver/mambaforge/lib/python3.9/site-packages/pymysql/cursors.py", line 258, in callproc self._query(q) File "/var/lib/diver/mambaforge/lib/python3.9/site-packages/pymysql/cursors.py", line 310, in _query conn.query(q) File "/var/lib/diver/mambaforge/lib/python3.9/site-packages/pymysql/connections.py", line 548, in query self._affected_rows = self._read_query_result(unbuffered=unbuffered) File "/var/lib/diver/mambaforge/lib/python3.9/site-packages/pymysql/connections.py", line 775, in _read_query_result result.read() File "/var/lib/diver/mambaforge/lib/python3.9/site-packages/pymysql/connections.py", line 1156, in read first_packet = self.connection._read_packet() File "/var/lib/diver/mambaforge/lib/python3.9/site-packages/pymysql/connections.py", line 725, in _read_packet packet.raise_for_error() File "/var/lib/diver/mambaforge/lib/python3.9/site-packages/pymysql/protocol.py", line 221, in raise_for_error err.raise_mysql_exception(self._data) File "/var/lib/diver/mambaforge/lib/python3.9/site-packages/pymysql/err.py", line 143, in raise_mysql_exception raise errorclass(errno, errval) pymysql.err.OperationalError: (1050, "Table 'diverDownloadTable_6' already exists")

How did this happen? Someone or something cleaned out diverDownloadTables of stale entries without removing the corresponding diverDownloadTable_<id> tables. So a test download failed on DNO.

Any cleanup/GC procedure should keep that in mind, but also it might be prudent to have a DROP TABLE IF EXISTS on download table creation. It wasn't there originally and I'm not sure if there was a reason for that; discussing with @WValenti before doing (thus why this is an issue tracker entry rather than a code commit).