SQLIntegrityConstraintViolationException when using restore
Created by: Henrik tom Wörden
After restoring an old sql dump, the following error appears continuously:
linkahead | caosdb.server.database.exceptions.IntegrityException: java.sql.SQLIntegrityConstraintViolationException: Column 'srid' cannot be null
linkahead | at caosdb.server.database.backend.implementation.MySQL.MySQLUpdateSparseEntity.execute(MySQLUpdateSparseEntity.java:87)
linkahead | at caosdb.server.database.backend.transaction.UpdateSparseEntity.execute(UpdateSparseEntity.java:53)
linkahead | at caosdb.server.database.BackendTransaction.executeTransaction(BackendTransaction.java:148)
linkahead | at caosdb.server.transaction.TransactionInterface.execute(TransactionInterface.java:44)
linkahead | at caosdb.server.transaction.ChecksumUpdater.run(ChecksumUpdater.java:88)
linkahead | at java.base/java.lang.Thread.run(Thread.java:834)
linkahead | Caused by: java.sql.SQLIntegrityConstraintViolationException: Column 'srid' cannot be null
linkahead | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:117)
linkahead | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
linkahead | at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
linkahead | at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
linkahead | at com.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:1003)
linkahead | at snaq.db.CachedPreparedStatement.executeQuery(CachedPreparedStatement.java:144)
linkahead | at caosdb.server.database.backend.implementation.MySQL.MySQLUpdateSparseEntity.execute(MySQLUpdateSparseEntity.java:80)
linkahead | ... 5 more
Imported comments:
By Quazgar on 2020-08-25T08:41:05.299Z
mentioned in commit 72b76510
By Quazgar on 2020-08-19T13:48:40.495Z
mentioned in merge request !50 (closed)
By Quazgar on 2020-08-19T13:22:32.215Z
mentioned in commit 038507678f189e0d9f70c01e93f6811950091023
By Quazgar on 2020-08-19T13:21:45.802Z
mentioned in commit c42c91d2dfb1e11c12aae6f30dd3e690753c4cc5
By Quazgar on 2020-08-18T13:41:51.436Z
This error had nothing to do with the SQL dump, but with the server trying to update the checksum of a file. This checksum update seems to fail when versioning is enabled.
By Quazgar on 2020-08-18T11:46:21.204Z
Reopening because the first workarounds did not work.
By Quazgar on 2020-08-18T11:10:11.060Z
Won't fix (at the moment at least). Trying to replay an SQL dump onto more recent table structures is not supported. It might be nice to have a tool to manually go to a certain patch revision, then apply the dump, then apply the rest of the patched, but that is beyond the current scope of this project.