update_acl() results in IntegrityExceptions when applied to files
Created by: Florian Spreckelsen
MWE with report_1.pdf from demo.indiscale.com:
import caosdb as db
tst_file = db.File(name="Test_File", path="/Test_Files/tst_file.pdf", file="./report_1.pdf").insert()
tst_file.retrieve_acl()
tst_file.deny(realm="PAM", username="admin", priority=True, permission="DELETE")
tst_file.update_acl()
repeatedly produces the server output
linkahead | caosdb.server.database.exceptions.IntegrityException: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry '0-101-20' for key 'domain_id_2'
linkahead | at caosdb.server.database.backend.implementation.MySQL.MySQLUpdateSparseEntity.execute(MySQLUpdateSparseEntity.java:85)
linkahead | at caosdb.server.database.backend.transaction.UpdateSparseEntity.execute(UpdateSparseEntity.java:52)
linkahead | at caosdb.server.database.BackendTransaction.executeTransaction(BackendTransaction.java:144)
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: Duplicate entry '0-101-20' for key 'domain_id_2'
linkahead | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:533)
linkahead | at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:513)
linkahead | at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:115)
linkahead | at com.mysql.cj.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:1983)
linkahead | at com.mysql.cj.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1826)
linkahead | at com.mysql.cj.jdbc.PreparedStatement.execute(PreparedStatement.java:1153)
linkahead | at snaq.db.CachedPreparedStatement.execute(CachedPreparedStatement.java:328)
linkahead | at caosdb.server.database.backend.implementation.MySQL.MySQLUpdateSparseEntity.execute(MySQLUpdateSparseEntity.java:62)
linkahead | ... 5 more
Imported comments:
By Timm Fitschen on 2021-02-10T12:00:00.716Z
possibly fixed with #85 (closed)
~"P 1" for reproduction
By Florian Spreckelsen on 2020-07-01T07:49:51.781Z
changed title from update_acl() results in IntegrityExceptions when applied to filse to update_acl() results in IntegrityExceptions when applied to files
By Florian Spreckelsen on 2020-06-30T06:55:30.816Z
assigned to @fspreck