Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
*Known Issue*
If you try to delete a subnet that is used to provision a machine, instead of receiving a user-friendly error message, you receive a confusing error message:
----
| NoMethodError: undefined method `klass' for nil:NilClass
| Did you mean? class
----
Created attachment 1389513[details]
log in production.log file
Description of problem: Trying to delete subnet which is used by provisioned host gives error
2018-02-01 08:40:36 c64b0466 [app] [W] Action failed
| NoMethodError: undefined method `klass' for nil:NilClass
| Did you mean? class
| /opt/theforeman/tfm/root/usr/share/gems/gems/scoped_search-4.1.2/lib/scoped_search/query_builder.rb:31:in `class_for'
| /opt/theforeman/tfm/root/usr/share/gems/gems/scoped_search-4.1.2/lib/scoped_search/query_builder.rb:18:in `build_query'
| /usr/share/foreman/app/services/authorizer.rb:96:in `build_filtered_scope_components'
| /usr/share/foreman/app/services/authorizer.rb:55:in `find_collection'
| /usr/share/foreman/app/models/concerns/authorizable.rb:27:in `authorized_as'
| /usr/share/foreman/app/models/concerns/authorizable.rb:65:in `authorized'
| /usr/share/foreman/app/services/association_authorizer.rb:10:in `authorized_associations'
| /usr/share/foreman/lib/core_extensions.rb:45:in `block (2 levels) in before_destroy'
| /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/relation/delegation.rb:46:in `each'
| /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/relation/delegation.rb:46:in `each'
| /usr/share/foreman/lib/core_extensions.rb:42:in `block in before_destroy'
| /usr/share/foreman/lib/core_extensions.rb:41:in `each'
Version-Release number of selected component (if applicable): Satellite 6.3 snap 34
How reproducible: always
Steps to Reproduce:
1. Create subnet
2. Provision a host using created subnet
3. Try to delete subnet
Actual results:
Error as Oops, we're sorry but something went wrong undefined method `klass' for nil:NilClass Did you mean? class
and production.log showed 500 internal server error (see attachment).
Expected results: It should show warning as "subnet is used by host"
Additional info: It is regression. Working correctly in 6.2.14.
Changes in reproducible steps:
1. Create user with role cloning organization_admin role
2. Login with created user
3. Create subnet
4. Provision a host using created subnet
5. Try to delete subnet
Additional info :
Removing regression as not sure about it.
FailedQA
# rpm -q foreman
foreman-1.18.0.18-1.el7sat.noarch
# rpm -q satellite
satellite-6.4.0-13.el7sat.noarch
Can see same error.
No changes as per PR. (As per comment #13, PR is reverted)
VERIFIED
Version tested:
Satellite 6.4 snap 22
Expected warning as $subnet is used by lola-borges.host.domain, $subnet is used by RHEL 7 Server 64-bit HG, $subnet is used by RHEL 6 Server 64-bit HG, $subnet is used by lola-borges.host.domain, and foreman is used by host.domain
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHSA-2018:2927
Created attachment 1389513 [details] log in production.log file Description of problem: Trying to delete subnet which is used by provisioned host gives error 2018-02-01 08:40:36 c64b0466 [app] [W] Action failed | NoMethodError: undefined method `klass' for nil:NilClass | Did you mean? class | /opt/theforeman/tfm/root/usr/share/gems/gems/scoped_search-4.1.2/lib/scoped_search/query_builder.rb:31:in `class_for' | /opt/theforeman/tfm/root/usr/share/gems/gems/scoped_search-4.1.2/lib/scoped_search/query_builder.rb:18:in `build_query' | /usr/share/foreman/app/services/authorizer.rb:96:in `build_filtered_scope_components' | /usr/share/foreman/app/services/authorizer.rb:55:in `find_collection' | /usr/share/foreman/app/models/concerns/authorizable.rb:27:in `authorized_as' | /usr/share/foreman/app/models/concerns/authorizable.rb:65:in `authorized' | /usr/share/foreman/app/services/association_authorizer.rb:10:in `authorized_associations' | /usr/share/foreman/lib/core_extensions.rb:45:in `block (2 levels) in before_destroy' | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/relation/delegation.rb:46:in `each' | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/relation/delegation.rb:46:in `each' | /usr/share/foreman/lib/core_extensions.rb:42:in `block in before_destroy' | /usr/share/foreman/lib/core_extensions.rb:41:in `each' Version-Release number of selected component (if applicable): Satellite 6.3 snap 34 How reproducible: always Steps to Reproduce: 1. Create subnet 2. Provision a host using created subnet 3. Try to delete subnet Actual results: Error as Oops, we're sorry but something went wrong undefined method `klass' for nil:NilClass Did you mean? class and production.log showed 500 internal server error (see attachment). Expected results: It should show warning as "subnet is used by host" Additional info: It is regression. Working correctly in 6.2.14.