Red Hat Bugzilla – Bug 1467803
Deleting a host from UI raises error: Fail to destroy record
Last modified: 2017-08-17 02:08:37 EDT
Created attachment 1294487 [details] on deleting host from UI raises error Description of problem: I was trying to remove a host from UI, which was provisioned on libvirt CR. UI raises error: Error: failed to destroy the record. following exception raised in production.log 2017-07-05 04:00:54 9f30a3c9 [app] [I] Started DELETE "/hosts/testhost1.idmqe.lab.eng.bos.redhat.com" for 10.67.116.71 at 2017-07-05 04:00:54 -0400 2017-07-05 04:00:54 9f30a3c9 [app] [I] Processing by HostsController#destroy as HTML 2017-07-05 04:00:54 9f30a3c9 [app] [I] Parameters: {"authenticity_token"=>"oioiSHJHDexlU0ZMvKtP2sBNrU2AnZJuk1ofM5Fa96yQAfeguDOJwog9BwPd0t/qnhk+NtBUfG1YAMZlsi26pQ==", "id"=>"testhost1.idmqe.lab.eng.bos.redhat.com"} 2017-07-05 04:00:54 9f30a3c9 [app] [I] Current user: admin (administrator) 2017-07-05 04:00:54 9f30a3c9 [app] [I] Current user: foreman_admin (administrator) 2017-07-05 04:00:55 9f30a3c9 [app] [I] Current user: admin (administrator) 2017-07-05 04:00:55 9f30a3c9 [app] [I] Current user: foreman_admin (administrator) 2017-07-05 04:00:55 9f30a3c9 [app] [I] Current user: admin (administrator) 2017-07-05 04:00:55 9f30a3c9 [app] [I] Delete the DNS A record for testhost1.idmqe.lab.eng.bos.redhat.com/192.168.100.5 2017-07-05 04:00:55 9f30a3c9 [app] [I] Delete the DNS PTR record for 192.168.100.5/testhost1.idmqe.lab.eng.bos.redhat.com 2017-07-05 04:00:56 9f30a3c9 [app] [I] Delete DHCP reservation testhost1.idmqe.lab.eng.bos.redhat.com for testhost1.idmqe.lab.eng.bos.redhat.com-52:54:00:3e:5e:82/192.168.100.5 2017-07-05 04:00:56 9f30a3c9 [app] [W] Failed to parse response: null -> 784: unexpected token at 'null' 2017-07-05 04:00:56 9f30a3c9 [app] [I] Add DNS PTR record for 192.168.100.5/testhost1.idmqe.lab.eng.bos.redhat.com 2017-07-05 04:00:56 9f30a3c9 [app] [I] Add DNS A record for testhost1.idmqe.lab.eng.bos.redhat.com/192.168.100.5 2017-07-05 04:00:56 9f30a3c9 [foreman-tasks/action] [E] Failed to destroy the record (ActiveRecord::RecordNotDestroyed) | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/persistence.rb:185:in `destroy!' | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/associations/has_many_association.rb:171:in `each' | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/associations/has_many_association.rb:171:in `delete_records' | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/associations/collection_association.rb:525:in `remove_records' | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/associations/collection_association.rb:518:in `block in delete_or_destroy' | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/associations/collection_association.rb:183:in `block in transaction' | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `transaction' | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/transactions.rb:220:in `transaction' | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/associations/collection_association.rb:182:in `transaction' | /opt/rh/rh-ror42/root/usr/share Please note that above error appears only first time. second time when I re-tried to remove host, it was deleted successfully. Version-Release number of selected component (if applicable): sat6.3 snap4 How reproducible: Steps to Reproduce: 1. create a host 2. delete it ( first time error appears Fail to destroy record) 3. Actual results: Expected results: Host should be deleted cleanly first time. Additional info:
Looks like the failure originates from a failed attempt to delete the DHCP reservation, moving to DHCP component
Yeah facing the same issue...In production.log, it shows Unable to delete DHCP entry ([RestClient::BadRequest]: 400 Bad Request) for Capsule https://capsule/dhcp | ProxyAPI::ProxyException: ERF12-0635 [ProxyAPI::ProxyException]
Sachin, I assume this is a regression from 6.2. Is that correct?
Yeah.. its a regression.
Are you using standard ISC DHCP? Just to make sure you are not using libvirt smart-proxy DHCP plugin which is unsupported and does not currently work.
Not reproducible w/ sat6.3 snap10. will reopen if come across same issue again.