Bug #15768
closedDestroying of the host not possible
Description
root@foreman.test.com:~# foreman-rake console
/usr/share/foreman/lib/tasks/console.rake:6: warning: already initialized constant ARGV
For some operations a user must be set, try User.current = User.first
Loading production environment (Rails 4.2.6)
Failed to load console gems, starting anyway
irb(main):001:0> h=Host.find_by_name('linux0034.test.com')
=> #<Host::Managed id: 31, name: "linux0034.test.com", last_compile: nil, last_report: nil, updated_at: "2016-07-21 11:45:25", created_at: "2016-07-21 11:45:25", root_pass: "$5$VptnEWkr$QOk2tahHSPGf8ayd95WprJOrcvKTjC/L756x.0...", architecture_id: 1, operatingsystem_id: 1, environment_id: 9, ptable_id: 64, medium_id: 6, build: true, comment: "", disk: "", installed_at: nil, model_id: nil, hostgroup_id: 8, owner_id: 7, owner_type: "User", enabled: true, puppet_ca_proxy_id: nil, managed: true, use_image: nil, image_file: nil, uuid: nil, compute_resource_id: nil, puppet_proxy_id: nil, certname: nil, image_id: nil, organization_id: nil, location_id: nil, type: "Host::Managed", otp: nil, realm_id: nil, compute_profile_id: nil, provision_method: "build", grub_pass: "$1$EF20dSVF$4ic4BBifobaffkHgJe1uM0", global_status: 0, lookup_value_matcher: "fqdn=linux0034.test.com", discovery_rule_id: nil>
irb(main):002:0> h.destroy
ActiveRecord::RecordNotDestroyed: Failed to destroy the record
from /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/persistence.rb:185:in `destroy!'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/associations/has_many_association.rb:171:in `each'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/associations/has_many_association.rb:171:in `delete_records'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/associations/collection_association.rb:525:in `remove_records'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/associations/collection_association.rb:518:in `block in delete_or_destroy'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/associations/collection_association.rb:183:in `block in transaction'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `transaction'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/transactions.rb:220:in `transaction'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/associations/collection_association.rb:182:in `transaction'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/associations/collection_association.rb:518:in `delete_or_destroy'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/associations/collection_association.rb:279:in `destroy'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/associations/collection_association.rb:223:in `destroy_all'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/associations/has_many_association.rb:27:in `handle_dependency'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/associations/builder/association.rb:146:in `block in add_destroy_callbacks'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:448:in `instance_exec'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:448:in `block in make_lambda'
... 23 levels...
from /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/task.rb:243:in `each'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/task.rb:243:in `execute'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/task.rb:187:in `block in invoke_with_call_chain'
from /usr/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/task.rb:180:in `invoke_with_call_chain'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/task.rb:173:in `invoke'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/application.rb:152:in `invoke_task'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/application.rb:108:in `block (2 levels) in top_level'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/application.rb:108:in `each'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/application.rb:108:in `block in top_level'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/application.rb:117:in `run_with_threads'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/application.rb:102:in `top_level'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/application.rb:80:in `block in run'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/application.rb:178:in `standard_exception_handling'
from /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/application.rb:77:in `run'
Updated by Dominic Cleal over 8 years ago
- Related to Bug #14702: Improve error messages when deleting multiple host fails because of proxy errors added
Updated by Dominic Cleal over 8 years ago
- Category set to Orchestration
#14702 tracks the error reporting aspect of this, it's likely that either a plugin or a smart proxy request is failing - more information may be available in /var/log/foreman-proxy/proxy.log on any associated proxies.
Updated by Ewoud Kohl van Wijngaarden over 8 years ago
We confirmed that the smart proxy for DHCP was offline at the time. When it was started again it could be removed.
Updated by Dominic Cleal over 8 years ago
- Status changed from New to Duplicate
Thanks, we'll continue to track the missing error message under #14702 then.