Bug 1857124 - Attempting to attach a subscription to an unregistered host results in ISE 500
Summary: Attempting to attach a subscription to an unregistered host results in ISE 500
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Subscription Management
Version: 6.8.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.8.0
Assignee: piytiwar
QA Contact: Stephen Wadeley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-15 08:04 UTC by Stephen Wadeley
Modified: 2020-10-27 13:04 UTC (History)
2 users (show)

Fixed In Version: tfm-rubygem-katello-3.16.0-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-27 13:04:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 30451 0 Normal Closed Attempting to attach a subscription to an unregistered host results in ISE 500 2020-10-28 17:44:30 UTC
Red Hat Product Errata RHSA-2020:4366 0 None None None 2020-10-27 13:04:35 UTC

Description Stephen Wadeley 2020-07-15 08:04:23 UTC
Description of problem:

    Trying to make API call:
    PUT /api/v2/hosts/bulk/add_subscriptions
     
    With data:
     
    {"organization_id": 15, "included": {"ids": [13, 14]}, "excluded": {}, "subscriptions": [{"id": 59, "quantity": 1}]}
     
    I get error:
    NoMethodError: undefined method `candlepin_consumer' for nil:NilClass



Version-Release number of selected component (if applicable):
~]# rpm -q satellite
satellite-6.8.0-0.6.beta.el7sat.noarch
~]# rpm -q candlepin
candlepin-3.1.14-1.el7sat.noarch

How reproducible:
Every time


Steps to Reproduce:
1. Create host collection with two content host entries
2. Create a custom product
3. Attempt to attach subscription for custom product using API path: PUT /api/v2/hosts/bulk/add_subscriptions

Actual results:
Internal Service Error (ISE)
NoMethodError: undefined method `candlepin_consumer' for nil:NilClass

Expected results:
useful error message


Additional info:
https://theforeman.org/plugins/katello/3.15/api/apidoc/v2/hosts_bulk_actions/add_subscriptions.html

Comment 1 piytiwar 2020-07-20 21:12:48 UTC
Connecting redmine issue https://projects.theforeman.org/issues/30451 from this bug

Comment 2 Bryan Kearney 2020-07-22 16:02:04 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/30451 has been resolved.

Comment 6 errata-xmlrpc 2020-10-27 13:04:18 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 (Important: Satellite 6.8 release), 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-2020:4366


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