We're updating the issue view to help you get more done. 

SQL exception when running caUtils purge-deleted

Description

trying to purge records with

./caUtils purge-deleted

CollectiveAccess 1.7.8 (158/RELEASE) Utilities
...

I get the following error message:

Removing deleted entities from database 10.0% 87/894 ETC: 4 mins, 10 secs. Elapsed: 27 secs [==> ]PHP Fatal error: Uncaught DatabaseException: Cannot delete or update a parent row: a foreign key constraint fails (raubgut.ca_objects_x_entities, CONSTRAINT fk_ca_objects_x_entities_entity_id FOREIGN KEY (entity_id) REFERENCES ca_entities (entity_id)) in /var/www/providence/app/lib/Db/mysqli.php:316
Stack trace:

0 /var/www/providence/app/lib/Db/DbStatement.php(151): Db_mysqli->execute(Object(DbStatement), Object(DbStatement), 'DELETE FROM ca_...', Array, NULL)

1 /var/www/providence/app/lib/Db.php(261): DbStatement->executeWithParamsAsArray(Array)

2 /var/www/providence/app/lib/BaseModel.php(3405): Db->query('DELETE FROM ca_...')

3 /var/www/providence/app/lib/BaseModelWithAttributes.php(606): BaseModel->delete(true, Array, NULL, Array)

4 /var/www/providence/app/lib/BundlableLabelableBaseModelWithAttributes.php(365): BaseModelWithAttributes->delete(true, Array, NULL, NULL)

5 /var/www/providence/app/lib/Utils/CLIUtils.php(601): BundlableLabelableBaseModelWithAttributes->delete(true, Array)

6 /var/www/providence in /var/www/providence/app/lib/Db/mysqli.php on line 316

Any idea how to fix this?

Environment

None

Assignee

Seth

Reporter

Christoph Christoph

Labels

None

Components

Affects versions

Priority

Major
Configure