Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1122736 - Unable to delete host tied back to activation key
Summary: Unable to delete host tied back to activation key
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: WebUI
Version: 6.0.4
Hardware: Unspecified
OS: Unspecified
Target Milestone: Unspecified
Assignee: Brad Buckingham
QA Contact: Tazim Kolhar
URL: http://projects.theforeman.org/issues...
Depends On:
TreeView+ depends on / blocked
Reported: 2014-07-23 23:47 UTC by Jason Montleon
Modified: 2019-09-26 18:09 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-09-11 12:21:21 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 7005 0 None None None 2016-04-22 14:54:52 UTC

Description Jason Montleon 2014-07-23 23:47:52 UTC
Description of problem:
I tried to delete a host and received a trace. Afterwards I could not view the host details though I could see it in the host list

Version-Release number of selected component (if applicable):

How reproducible:
Uncertain, but based on the additional info, probably always

Steps to Reproduce:
1. Create an Activation Key
2. Create a Host and include the activation key

Actual results:
Can't delete the host without error

Expected results:
Host should delete as expected

Additional info:
I had to do the following:
delete from hosts where id = 7;
ERROR:  update or delete on table "hosts" violates foreign key constraint "katello_systems_host_id" on table "katello_systems"
DETAIL:  Key (id)=(7) is still referenced from table "katello_systems".

delete from katello_systems where id = 11;
ERROR:  update or delete on table "katello_systems" violates foreign key constraint "system_activation_keys_system_id_fk" on table "katello_system_activation_keys"
DETAIL:  Key (id)=(11) is still referenced from table "katello_system_activation_keys".

foreman=# delete from katello_system_activation_keys where id = 11;
foreman=# delete from katello_systems where id = 11;
foreman=# delete from hosts where id = 7;
foreman=# \q

Comment 1 RHEL Program Management 2014-07-23 23:53:34 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 3 Jason Montleon 2014-07-29 17:26:21 UTC
After seeing this again I believe this is happening when the host gets re-provisioned (and this re-activated using subscription-manager) by putting it back into build. It looks like multiple content hosts end up referencing the host. I went to delete a host after several reprovisions and there were 7 or 8 content hosts with the same name generated.

I know some tasks end up happening when the kickstart is pulled on the foreman side (puppet ca cert is revoked so the new one can be signed, probably ipa otp password generated, etc.) - maybe at that same point it would make sense to delete the content host as well, or something similar?

Comment 4 Brad Buckingham 2014-08-09 13:18:04 UTC
Created redmine issue http://projects.theforeman.org/issues/7005 from this bug

Comment 5 Brad Buckingham 2014-08-09 13:30:01 UTC
Proposed fix in Katello PR:

See PR for description of the solution.

Comment 8 Tazim Kolhar 2014-08-18 09:29:28 UTC

content-host associated with act_key can be deleted successfully

Comment 9 Bryan Kearney 2014-09-11 12:21:21 UTC
This was delivered with Satellite 6.0 which was released on 10 September 2014.

Note You need to log in before you can comment on or make changes to this bug.