Bug #9488
closedUnable delete the discovered hosts from foreman
Description
Hi,
I am unable delete the discovered hosts from foreman, when I attempt to do it, I am getting following error. I have also ensured environment set to non discover (production) and cancelled any build in progress.
Warning!
ERROR: update or delete on table "hosts" violates foreign key constraint "discovery_attribute_sets_host_id_fk" on table "discovery_attribute_sets" DETAIL: Key (id)=(2) is still referenced from table "discovery_attribute_sets".
Installed foreman-version:
foreman-1.7.2-1.el6.noarch
ruby193-rubygem-foreman_discovery-2.0.0-0.1.rc2.el6.noarch
Any help appreciated.
Thanks
Anil
Updated by Dominic Cleal almost 10 years ago
- Project changed from Foreman to Discovery
Updated by Anil Vatti almost 10 years ago
By the way this is a brand new install and I have tried multiple times installing from scratch and it still errors out same way. Any further help appreciated.
production.log shows following:
Started POST "/hosts/submit_multiple_destroy?host_ids%5B%5D=4&host_ids%5B%5D=3" for 10.33.6.109 at 2015-02-23 15:11:19 +0000
Processing by HostsController#submit_multiple_destroy as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"tYacd6J525A45OaKMxhCivSxVFJShGHu8z6HD1aPhYY=", "host_ids"=>["4", "3"]}
Operation FAILED: ERROR: update or delete on table "hosts" violates foreign key constraint "discovery_attribute_sets_host_id_fk" on table "discovery_attribute_sets"
DETAIL: Key (id)=(3) is still referenced from table "discovery_attribute_sets".
Rendered common/500.html.erb within layouts/application (4.8ms)
Rendered layouts/base.html.erb (1.2ms)
Completed 500 Internal Server Error in 63ms (Views: 13.0ms | ActiveRecord: 8.8ms)
Web console, trace shows following:
PGError
ERROR: update or delete on table "hosts" violates foreign key constraint "discovery_attribute_sets_host_id_fk" on table "discovery_attribute_sets" DETAIL: Key (id)=(3) is still referenced from table "discovery_attribute_sets".
app/controllers/hosts_controller.rb:431:in `block in submit_multiple_destroy'
app/controllers/hosts_controller.rb:431:in `submit_multiple_destroy'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call'
Updated by Ori Rabin almost 10 years ago
- Status changed from New to Assigned
- Assignee set to Ori Rabin
Updated by Anil Vatti almost 10 years ago
Another additional information on this.
We have staypuft plugin installed and once we have assigned the discovered systems to openstack controller or compute nodes and deploy them, then foreman is not allowing to delete those hosts.
We have even tried by unassign the hosts from openstack deployment and results is same.
Updated by Ori Rabin almost 10 years ago
- Related to Refactor #9546: Discovery should provide a convinient method to convert discovered host into managed host (aka provision) added
Updated by Ori Rabin almost 10 years ago
- Status changed from Assigned to New
- Assignee deleted (
Ori Rabin)
This should be fixed after #9546 is merged and a change is made to staypuft to use the new code.
Updated by Lukas Zapletal almost 10 years ago
- Subject changed from unable delete the discovered hosts from foreman to Unable delete the discovered hosts from foreman
- Category set to Discovery plugin
- Assignee set to Ori Rabin
- Target version set to Discovery Plugin 2.0.1
Updated by Lukas Zapletal almost 10 years ago
- Priority changed from Normal to Urgent
Updated by The Foreman Bot almost 10 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman_discovery/pull/168 added
- Pull request deleted (
)
Updated by Ori Rabin almost 10 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset foreman_discovery|1bc77ee8f3c82582be79d15df66f787574bc5fa9.
Updated by Lukas Zapletal almost 10 years ago
- Is duplicate of Bug #9777: Trying to delete a discovered host after a failed provisioning request fails added
Updated by Lukas Zapletal almost 10 years ago
- Is duplicate of deleted (Bug #9777: Trying to delete a discovered host after a failed provisioning request fails)