Project

General

Profile

Actions

Bug #30565

closed

Unable to delete discovered host

Added by John McNally almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Database
Target version:
-
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

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

Actions #1

Updated by John McNally almost 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.

Actions #2

Updated by Lukas Zapletal almost 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.

Actions

Also available in: Atom PDF