Bug #30565
closedUnable to delete discovered host
Description
Attempt to delete a discovered host results in this error:
PG::ForeignKeyViolation: ERROR: update or delete on table "hosts" violates foreign key constraint "host_classes_host_id_fk" on table "host_classes" DETAIL: Key (id)=(15) is still referenced from table "host_classes". : DELETE FROM "hosts" WHERE "hosts"."id" = $1
Foreman v2.0.1
OS: CentOS 7.8
See attached trace. Please indicate which additional logs might be helpful.
Files
Updated by John McNally about 4 years ago
After 24 hours, I was able to delete the discovered host using the GUI. Perhaps this standard recurring cron job:
15 23 * * * foreman /usr/sbin/foreman-rake db:sessions:clear >>/var/log/foreman/cron.log 2>&1
...cleared up the database inconsistency. Root cause still unknown.
Updated by Lukas Zapletal about 4 years ago
- Status changed from New to Closed
- Triaged changed from No to Yes
We have quite few (and slow) cron jobs. I am closing for now, until you find out what was wrong.