Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #37166 - Add procedure to remove corrupted host statuses #798

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sbernhard
Copy link
Contributor

From time to time we have some hosts, which can not be deleted because of errorrs like:

PG::ForeignKeyViolation: ERROR: update or delete on table "hosts" violates foreign key constraint "host_status_hosts_host_id_fk" on table "host_status" DETAIL: Key (id)=(HOST_ID) is still referenced from table "host_status".

This procedure is able to find and fix these issues.

@sbernhard sbernhard changed the title Add procedure to remove corrupted host statuses Fixes #37166 - Add procedure to remove corrupted host statuses Feb 15, 2024
@@ -0,0 +1,43 @@
module Procedures::Foreman
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not included in any scenarios - where are you wanting it to run?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Actually I was unsure if we want to have this to run on every upgrade or backup or other places.
The procedures can be called as a single routine and I think it make sense to have a collection of these "maintenance" routines which can solve issues. What are your thougths?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants