Bug 1467803 - Deleting a host from UI raises error: Fail to destroy record
Deleting a host from UI raises error: Fail to destroy record
Status: CLOSED WORKSFORME
Product: Red Hat Satellite 6
Classification: Red Hat
Component: DHCP & DNS (Show other bugs)
6.3.0
Unspecified Unspecified
unspecified Severity high (vote)
: Beta
: --
Assigned To: Lukas Zapletal
: Regression, Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-05 04:10 EDT by Sachin Ghai
Modified: 2017-08-17 02:08 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-17 02:08:37 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
on deleting host from UI raises error (54.81 KB, image/png)
2017-07-05 04:10 EDT, Sachin Ghai
no flags Details

  None (edit)
Description Sachin Ghai 2017-07-05 04:10:47 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:
Comment 2 Tomer Brisker 2017-07-05 04:20:44 EDT
Looks like the failure originates from a failed attempt to delete the DHCP reservation, moving to DHCP component
Comment 3 Nikhil Kathole 2017-07-06 10:56:14 EDT
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]
Comment 4 Brad Buckingham 2017-07-07 11:14:09 EDT
Sachin, I assume this is a regression from 6.2.  Is that correct?
Comment 5 Sachin Ghai 2017-07-13 09:53:22 EDT
Yeah.. its a regression.
Comment 8 Lukas Zapletal 2017-07-21 09:05:37 EDT
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.
Comment 9 Sachin Ghai 2017-08-17 02:08:37 EDT
Not reproducible w/ sat6.3 snap10. will reopen if come across same issue again.

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