Red Hat Bugzilla – 1241923 – Unable to delete 3 provisioned hosts: Cannot delete record because of dependent content_host (ActiveRecord::DeleteRestrictionError)
Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
John,
can you give me please reproduce steps for Satellite 6.1? Because Discovery itself never associate Content Host, have you assigned it manually somehow?
Also if we manage to unassociate it manually, this is not a blocker bug.
Thanks!
Lukas,
I don't have exact steps to recreate this and when I say we provisioned 3 hosts with discovery I meant we provisioned 3 discovered hosts, the provisioning is triggered by RHCI.
I've seen the delete of the provisioned hosts work for the past few runs I've done (same release of Sat 6.1 RPMs)
The steps I've followed have been provisioning RHEV with RHCI.
1) Bring up 3 discovered hosts (VMs for my case)
2) Select the hosts in RHCI webui and provision to RHEV
The 3 hosts are subscribed to red hat content repositories with an activation key during their provisioning.
The provisioning is triggered by the fusor_server plugin
3) Sometime later perform a bulk delete on the hosts
Last time I saw this problem occur the hosts that did not delete said they were "Out Of Sync". I'm not sure if that is related to the problem.
Question:
Is there any other information that would be helpful for me to grab if I see this occur again?
Ok now I understand, you are not deleting Discovered Host, but Managed Host. Flipping over to Katello guys, I have no clue how delete orchestration are made there.
Created attachment 1050667 [details] foreman-debug info Description of problem: Provisioned 3 hosts with discovery, then I selected all 3 hosts and did a bulk delete. Actions::BulkAction Input: {"action_class"=>"Actions::Katello::System::HostDestroy", "target_ids"=>[2, 3, 4], "target_class"=>"Host::Managed", "args"=>[], "current_user_id"=>3, "locale"=>"en"} Output: {"total_count"=>3, "failed_count"=>1, "success_count"=>2} Exception: RuntimeError: A sub task failed Backtrace: /opt/rh/ruby193/root/usr/share/gems/gems/dynflow-0.7.7.7/lib/dynflow/action/with_sub_plans.rb:158:in `check_for_errors!' 2015-07-10 08:14:14 [I] Delete the DNS PTR record for 192.168.252.15/mac5254009536eb.example.com 2015-07-10 08:14:14 [I] Delete the DNS A record for mac5254009536eb.example.com/192.168.252.15 2015-07-10 08:14:14 [I] Delete DHCP reservation for mac5254009536eb.example.com-52:54:00:95:36:eb/192.168.252.15 2015-07-10 08:14:14 [I] Delete the TFTP configuration for mac5254009536eb.example.com 2015-07-10 08:14:14 [I] Remove puppet certificate for mac5254009536eb.example.com 2015-07-10 08:14:15 [I] Delete the autosign entry for mac5254009536eb.example.com 2015-07-10 08:14:15 [E] Cannot delete record because of dependent content_host (ActiveRecord::DeleteRestrictionError) /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/associations/builder/has_one.rb:58:in `block in define_restrict_dependency_method' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:649:in `_run__3594044184734710221__destroy__76214477243478740__callbacks' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in `_run_destroy_callbacks' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/callbacks.rb:254:in `destroy' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:236:in `block in destroy' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:295:in `block in with_transaction_returning_status' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:208:in `transaction' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:293:in `with_transaction_returning_status' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:236:in `destroy' /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.51/app/lib/actions/katello/system/host_destroy.rb:33:in `finalize' Version-Release number of selected component (if applicable): # rpm -qa | grep katello katello-server-ca-1.0-1.noarch katello-debug-2.2.0.11-1.el7sat.noarch pulp-katello-0.5-1.el7sat.noarch katello-certs-tools-2.2.1-1.el7sat.noarch katello-common-2.2.0.11-1.el7sat.noarch katello-service-2.2.0.11-1.el7sat.noarch katello-installer-base-2.3.12-1.el7sat.noarch katello-2.2.0.11-1.el7sat.noarch rubygem-hammer_cli_katello-0.0.7.15-1.el7sat.noarch katello-installer-2.3.12-1.el7sat.noarch ruby193-rubygem-katello-2.2.0.51-1.el7sat.noarch katello-default-ca-1.0-1.noarch # rpm -qa | grep foreman ruby193-rubygem-foreman_docker-1.2.0.14-1.el7sat.noarch rubygem-hammer_cli_foreman_bootdisk-0.1.2.7-1.el7sat.noarch foreman-selinux-1.7.2.13-1.el7sat.noarch foreman-discovery-image-2.1.0-29.el7sat.noarch foreman-proxy-1.7.2.5-1.el7sat.noarch sat61fusor.example.com-foreman-proxy-client-1.0-1.noarch ruby193-rubygem-foreman_discovery-2.0.0.15-1.el7sat.noarch rubygem-hammer_cli_foreman_docker-0.0.3.7-1.el7sat.noarch ruby193-rubygem-foreman_gutterball-0.0.1.9-1.el7sat.noarch foreman-vmware-1.7.2.27-1.el7sat.noarch ruby193-rubygem-foreman-tasks-0.6.12.8-1.el7sat.noarch rubygem-hammer_cli_foreman-0.1.4.14-1.el7sat.noarch foreman-libvirt-1.7.2.27-1.el7sat.noarch ruby193-rubygem-foreman_bootdisk-4.0.2.13-1.el7sat.noarch sat61fusor.example.com-foreman-client-1.0-1.noarch sat61fusor.example.com-foreman-proxy-1.0-1.noarch foreman-compute-1.7.2.27-1.el7sat.noarch foreman-gce-1.7.2.27-1.el7sat.noarch ruby193-rubygem-foreman_hooks-0.3.7-2.el7sat.noarch rubygem-hammer_cli_foreman_discovery-0.0.1.10-1.el7sat.noarch foreman-debug-1.7.2.27-1.el7sat.noarch foreman-1.7.2.27-1.el7sat.noarch ruby193-rubygem-foreman-redhat_access-0.2.0-8.el7sat.noarch foreman-postgresql-1.7.2.27-1.el7sat.noarch foreman-ovirt-1.7.2.27-1.el7sat.noarch rubygem-hammer_cli_foreman_tasks-0.0.3.4-1.el7sat.noarch How reproducible: Unsure Steps to Reproduce: 1. Provision 3 hosts from discovery 2. Do a bulk delete of the 3 hosts 3.