Can't delete host

Problem: Can’t delete host (webUI or CLI)

Expected outcome: Host is removed from the Foreman/katello

Foreman and Proxy versions: 3.13.0

Foreman and Proxy plugin versions: 3.13.0-1

Distribution and version: Oracle Linux 9.5

Other relevant data: Task returns this error

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

Hi @dvolf ,

I’m not sure why that record is getting left behind, but you can try the following in the foreman-rake console:

::ForemanRegister::RegistrationFacet.find_by(host_id: 23).destroy!

@nofaralfasi has your team seen any similar issues in the past?

Hi @iballou
It did worked :slight_smile:
I will be forever in your debt :smiley:
thanks.

1 Like