Bug 1294470 - Error message does not help end-user "Cannot delete record because of dependent hosts"
Error message does not help end-user "Cannot delete record because of depende...
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Content Management (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified (vote)
: Unspecified
: --
Assigned To: Katello Bug Bin
Katello QA List
Depends On:
Blocks: 1122832
  Show dependency treegraph
Reported: 2015-12-28 06:28 EST by Peter Vreman
Modified: 2016-02-18 03:28 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-02-18 03:28:42 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Peter Vreman 2015-12-28 06:28:59 EST
Description of problem:
I have the error to delete a Content View. The error message is too generic to help the end user to solve the problem.
Please extend the error message with details of the list dependent hosts that are preventing the deletion.




 "organization"=>{"id"=>3, "name"=>"Hilti", "label"=>"Hilti"},




ActiveRecord::DeleteRestrictionError: Cannot delete record because of dependent hosts


/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/associations/builder/has_many.rb:63:in `block in define_restrict_dependency_method'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:517:in `_run__341289337038255713__destroy__217011182686457229__callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in `_run_destroy_callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/callbacks.rb:254:in `destroy'

This does not

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Delete content view that has dependent hosts

Actual results:
Unspecified error

Expected results:
Details on the error which hosts are preventing the deletion

Additional info:
Comment 1 Pavel Moravec 2016-02-03 08:30:00 EST
Setting #c0 private since it has customer name.
Comment 2 Pavel Moravec 2016-02-03 08:33:39 EST
(In reply to Pavel Moravec from comment #1)
> Setting #c0 private since it has customer name.

Ah, I havent checked who reported the bug, reverting the change, sorry :)

Anyway this has been fixed in ruby193-rubygem-katello- / Satellite 6.1.6 I have (maybe sooner, not sure what 6.1.z upstaed this package).

Now production.log and also any error string has something like:

2016-02-03 14:24:28 [E] RuntimeError: Cannot delete 'cv_2' due to associated environments: Library. Cannot delete 'cv_2' due to associated systems: pmoravec-rhel6.gsslab.brq.redhat.com.

Please check if it works as expected.
Comment 3 Peter Vreman 2016-02-18 03:28:42 EST
Closing. I cannot reproduce it anymore. I now always get the error message mentioned in Comment 2.
I expect my situation at that time was the result of other failures.

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