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.
Bug 1580436 - subscriptions pages/api errors with 'NoMethodError: undefined method `id' for nil:NilClass'
Summary: subscriptions pages/api errors with 'NoMethodError: undefined method `id' for...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Subscription Management
Version: 6.3.1
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.4.0
Assignee: Stephen Benjamin
QA Contact: Jitendra Yejare
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-21 13:03 UTC by Justin Sherrill
Modified: 2021-12-10 16:11 UTC (History)
14 users (show)

Fixed In Version: tfm-rubygem-katello-3.7.0.rc1.2-0.1.rc1.2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-16 19:15:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
workaround.patch (695 bytes, patch)
2018-05-21 13:09 UTC, Justin Sherrill
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 23823 0 Normal Closed subscriptions pages/api errors with 'NoMethodError: undefined method `id' for nil:NilClass' 2020-06-01 14:31:55 UTC
Red Hat Knowledge Base (Solution) 3637181 0 None None None 2019-12-12 05:16:30 UTC

Description Justin Sherrill 2018-05-21 13:03:29 UTC
Description of problem:

Customer reported, after upgrade to 6.3.1, his subscription pages erroring with:


2018-05-18 21:00:18 d0f6c16b [app] [I] Started GET "/api/v2/hosts?organization_id=3&page=1&paged=true&per_page=50&search=&sort_by=name&sort_order=ASC" for
2018-05-18 21:00:18 7d017c23 [app] [I]   Rendered home/_submenu.html.erb (0.9ms)
2018-05-18 21:00:18 7d017c23 [app] [I]   Rendered home/_user_dropdown.html.erb (2.0ms)
2018-05-18 21:00:18 7d017c23 [app] [I] Read fragment views/tabs_and_title_records-4 (0.1ms)
2018-05-18 21:00:18 d0f6c16b [app] [I] Processing by Api::V2::HostsController#index as JSON
2018-05-18 21:00:18 d0f6c16b [app] [I]   Parameters: {"organization_id"=>"3", "page"=>"1", "paged"=>"true", "per_page"=>"50", "search"=>"", "sort_by"=>"name", "sort_order"=>
"ASC", "apiv"=>"v2"}
2018-05-18 21:00:18 7d017c23 [app] [I]   Rendered home/_organization_dropdown.html.erb (2.9ms)
2018-05-18 21:00:18 d0f6c16b [app] [I] Current user: berj02 (administrator)
2018-05-18 21:00:18 d0f6c16b [app] [I] Expire fragment views/tabs_and_title_records-4 (0.1ms)

2018-05-18 21:00:38 d706e273 [app] [E] NoMethodError: undefined method `id' for nil:NilClass
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.64.2/app/views/katello/api/v2/subscriptions/base.json.rabl:22:in `block in eval_source'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.12.0/lib/rabl/builder.rb:152:in `node'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.12.0/lib/rabl/builder.rb:114:in `block in compile_settings'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.12.0/lib/rabl/builder.rb:113:in `each'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.12.0/lib/rabl/builder.rb:113:in `compile_settings'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.12.0/lib/rabl/builder.rb:58:in `block in to_hash'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.12.0/lib/rabl/builder.rb:248:in `cache_results'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.12.0/lib/rabl/builder.rb:49:in `to_hash'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.12.0/lib/rabl/engine.rb:86:in `to_hash'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.12.0/lib/rabl/engine.rb:48:in `block in render'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.12.0/lib/rabl/engine.rb:382:in `cache_results'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/rabl-0.12.0/lib/rabl/engine.rb:47:in `render'


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

How reproducible:
Unknown

Comment 1 Justin Sherrill 2018-05-21 13:09:05 UTC
Temporary Workaround:

Apply the included workaround.patch, restart httpd.  This will stop returning the 'hypervisor' information for the subscriptions that are erroring.  This will allow the user to still access the relevant pages until a proper fix can be done.

Comment 2 Justin Sherrill 2018-05-21 13:09:36 UTC
Created attachment 1439613 [details]
workaround.patch

Comment 4 Stephen Benjamin 2018-06-05 19:11:23 UTC
Created redmine issue http://projects.theforeman.org/issues/23823 from this bug

Comment 5 Satellite Program 2018-06-05 20:17:16 UTC
Upstream bug assigned to stbenjam

Comment 6 Satellite Program 2018-06-05 20:17:19 UTC
Upstream bug assigned to stbenjam

Comment 7 Brad Buckingham 2018-06-14 21:32:43 UTC
Moving to POST as the upstream issue has been merged and issue closed.

Comment 10 Jitendra Yejare 2018-09-07 12:02:31 UTC
@Justin,

Need steps to repro/Verify this bug. Is it required to have virt-who subscription in manifest ?

Comment 11 Stephen Benjamin 2018-09-07 12:55:06 UTC
We do not know how the original customer got into this state, I believe a no-break test would just be fine: set up virt who and some VDC subs.

The only other way is to manually assign a hypervisor id that doesn't exist to a pool, overriding any rails validations.

Comment 12 Jitendra Yejare 2018-09-19 12:02:42 UTC
Verified!

@ Satellite 6.4 snap 22

Steps:

1. Import manifest with VDC Subscriptions.
2. Register virt-who clients to the satellite and add the virt-who subscriptions to the clients.
3, Upgrade Satellite 6.3 to 6.4
4. Verify the subscription page and virt-who clients.


Observation:
1. The subscription page post upgrade is not errored out and showing the subscriptions correctly with clients.
2. The virt-who clients are intact post upgrade and subscribed.

Comment 13 Bryan Kearney 2018-10-16 19:15:48 UTC
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


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