Project

General

Profile

Actions

Bug #9488

closed

Unable delete the discovered hosts from foreman

Added by Anil Vatti about 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Urgent
Assignee:
Category:
Discovery plugin
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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


Related issues 1 (0 open1 closed)

Related to Discovery - Refactor #9546: Discovery should provide a convinient method to convert discovered host into managed host (aka provision)ClosedLukas Zapletal02/25/2015Actions
Actions #1

Updated by Dominic Cleal about 9 years ago

  • Project changed from Foreman to Discovery
Actions #2

Updated by Anil Vatti about 9 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'

Actions #3

Updated by Ori Rabin about 9 years ago

  • Status changed from New to Assigned
  • Assignee set to Ori Rabin
Actions #4

Updated by Anil Vatti about 9 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.

Actions #5

Updated by Ori Rabin about 9 years ago

  • Related to Refactor #9546: Discovery should provide a convinient method to convert discovered host into managed host (aka provision) added
Actions #6

Updated by Ori Rabin about 9 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.

Actions #7

Updated by Lukas Zapletal about 9 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
Actions #8

Updated by Lukas Zapletal about 9 years ago

  • Priority changed from Normal to Urgent
Actions #9

Updated by The Foreman Bot about 9 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman_discovery/pull/168 added
  • Pull request deleted ()
Actions #10

Updated by Ori Rabin about 9 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #11

Updated by Lukas Zapletal about 9 years ago

  • Is duplicate of Bug #9777: Trying to delete a discovered host after a failed provisioning request fails added
Actions #12

Updated by Lukas Zapletal about 9 years ago

  • Is duplicate of deleted (Bug #9777: Trying to delete a discovered host after a failed provisioning request fails)
Actions

Also available in: Atom PDF