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.

Bug 1362194

Summary: No proper subscriptions created for custom products
Product: Red Hat Satellite Reporter: Maxim Burgerhout <mburgerh>
Component: Content ManagementAssignee: John Mitsch <jomitsch>
Status: CLOSED ERRATA QA Contact: jcallaha
Severity: high Docs Contact:
Priority: high    
Version: 6.2.0CC: abalakht, ahumbe, bbuckingham, bkearney, brubisch, chrobert, cwelton, egolov, ggatward, jcallaha, jomitsch, ktordeur, mmccune, mtenheuv, pcfe, peter.vreman, rjerrido, shetze, snemeth, sreber, tasander, tomckay, walden, xdmoon
Target Milestone: UnspecifiedKeywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/15981
Whiteboard:
Fixed In Version: rubygem-katello-3.0.0.74-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-14 21:01:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1122832    
Attachments:
Description Flags
The 'null' product
none
derived SKU from virtual datacetre subscription.
none
foreman-tail with candlepin and foreman debug enabled while accessing the null subscription
none
foreman-tail while uploading manifest
none
sosreport
none
jcalla foreman debug
none
jcalla production.log
none
Ver1
none
Ver2 none

Description Maxim Burgerhout 2016-08-01 13:37:53 UTC
Created attachment 1186435 [details]
The 'null' product

Description of problem:
When trying to assign a subscription for a custom product to an activation key, the activation key doesn't show up. The only thing that does show up in the list of subscriptions, is an entry named 'null', which you cannot add to the activation key either, because of the following error:

redhat?' for nil:NilClass

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

How reproducible:


Steps to Reproduce:
1. Create custom product
2. Navigate to an activation key, subscriptions, add
3. 

Actual results:
Product does not show up by itself, only an entry named 'null', which you cannot use (see above for error)

Expected results:
For each custom product a properly named subscription is created and it's possible to add those subs to activation keys

Additional info:

Comment 3 Stefan Nemeth 2016-08-02 13:32:11 UTC
Isn't it also related to bz 1343080 ? 

in case #01677258

Instead of derived SKU in webui, null is created for virtual datacenre subscription, however in cp_pool table, everything looks OK.

Comment 4 Stefan Nemeth 2016-08-02 13:34:02 UTC
Created attachment 1186829 [details]
derived SKU from virtual datacetre subscription.

Comment 5 Stefan Nemeth 2016-08-02 13:35:24 UTC
Created attachment 1186830 [details]
foreman-tail with candlepin and foreman debug enabled while accessing the null subscription

Comment 6 Stefan Nemeth 2016-08-02 13:36:51 UTC
Created attachment 1186831 [details]
foreman-tail while uploading manifest

Comment 7 Stefan Nemeth 2016-08-02 14:28:40 UTC
Created attachment 1186851 [details]
sosreport

Comment 10 John Mitsch 2016-08-04 13:31:40 UTC
Created redmine issue http://projects.theforeman.org/issues/15981 from this bug

Comment 12 Bryan Kearney 2016-08-04 16:16:55 UTC
Upstream bug component is Content Management

Comment 14 John Mitsch 2016-08-08 14:55:53 UTC
Created a new bug https://bugzilla.redhat.com/show_bug.cgi?id=1365189 to track the VDC null subscription issue as that looks like it is going to be a separate fix than a null subscription for a custom product.

Comment 15 jcallaha 2016-08-11 16:09:38 UTC
Came across this today. The product was "z stream". As a temporary workaround, adding the "nil" subscription to a content host will show the custom subscription throughout all interfaces. Have no idea how to reliably reproduce. I will paste and attach some relevant info/logs.  

[root@rhsm-qe-1 ~]# hammer -u admin -p changeme subscription list --organization-id 1
---|----------------------------------|-----------------------------------------|----------|---------|--------------|-----------|----------|------------------------------|-----------|---------
ID | UUID                             | NAME                                    | CONTRACT | ACCOUNT | SUPPORT      | QUANTITY  | CONSUMED | END DATE                     | QUANTITY  | ATTACHED
---|----------------------------------|-----------------------------------------|----------|---------|--------------|-----------|----------|------------------------------|-----------|---------
1  | 8a9084ef566b6ff101566b7a24d10230 | Employee SKU                            | 10169793 | 477931  | Self-Support | 10        | 3        | 2022-01-01T04:59:59.000+0000 | 10        | 3       
3  | 8a9084ef566b6ff101566b7a262d0392 | Red Hat Satellite Employee Subscription | 10538625 | 477931  | Self-Support | 10        | 0        | 2022-01-01T04:59:59.000+0000 | 10        | 0       
6  | 8a9084ef5675f27d01567a26f7f6006c | another one                             |          |         |              | Unlimited | 0        | 2046-08-04T15:09:49.128+0000 | Unlimited | 0       
---|----------------------------------|-----------------------------------------|----------|---------|--------------|-----------|----------|------------------------------|-----------|---------
[root@rhsm-qe-1 ~]# hammer -u admin -p changeme product info --id 147 --organization-id 1
ID:           147
Name:         z stream
Label:        z_stream
Description:  
Sync State:   Syncing Complete.
Sync Plan ID: 
GPG:          
    GPG Key ID: 
    GPG Key:
Organization: Default Organization
Readonly:     
Deletable:    
Content:      
 1) Repo Name:    capsule
    URL:          /custom/z_stream/capsule
    Content Type: yum
 2) Repo Name:    tools
    URL:          /custom/z_stream/tools
    Content Type: yum


after adding to content host

[root@rhsm-qe-1 ~]# hammer -u admin -p changeme subscription list --organization-id 1
---|----------------------------------|-----------------------------------------|----------|---------|--------------|-----------|----------|------------------------------|-----------|---------
ID | UUID                             | NAME                                    | CONTRACT | ACCOUNT | SUPPORT      | QUANTITY  | CONSUMED | END DATE                     | QUANTITY  | ATTACHED
---|----------------------------------|-----------------------------------------|----------|---------|--------------|-----------|----------|------------------------------|-----------|---------
1  | 8a9084ef566b6ff101566b7a24d10230 | Employee SKU                            | 10169793 | 477931  | Self-Support | 10        | 4        | 2022-01-01T04:59:59.000+0000 | 10        | 4       
3  | 8a9084ef566b6ff101566b7a262d0392 | Red Hat Satellite Employee Subscription | 10538625 | 477931  | Self-Support | 10        | 1        | 2022-01-01T04:59:59.000+0000 | 10        | 1       
5  | 8a9084ef5675f27d01567a1b20510056 | z stream                                |          |         |              | Unlimited | 1        | 2046-08-04T14:56:52.640+0000 | Unlimited | 1       
6  | 8a9084ef5675f27d01567a26f7f6006c | another one                             |          |         |              | Unlimited | 0        | 2046-08-04T15:09:49.128+0000 | Unlimited | 0       
7  | 8a9084ef5675f27d01567a4d3e7c0079 | Employee SKU                            | 10169793 | 477931  | Self-Support | Unlimited | 0        | 2022-01-01T04:59:59.000+0000 | Unlimited | 0       
---|----------------------------------|-----------------------------------------|----------|---------|--------------|-----------|----------|------------------------------|-----------|---------

Comment 16 jcallaha 2016-08-11 16:10:10 UTC
Created attachment 1190110 [details]
jcalla foreman debug

Comment 17 jcallaha 2016-08-11 16:16:21 UTC
Created attachment 1190111 [details]
jcalla production.log

Comment 18 John Mitsch 2016-08-15 17:59:37 UTC
jcalla,

This has split into two different bugs: null subscription after adding a custom product(tracked here), and null subscription from a VDC host (tracked in https://bugzilla.redhat.com/show_bug.cgi?id=1365189 ) 

Can you confirm that what you described happened after adding a custom product?

Comment 19 jcallaha 2016-08-15 18:01:34 UTC
John,

    Yep. This only happened after adding the first custom product. Subsequent custom products didn't have the same issue.

Comment 20 John Mitsch 2016-08-15 18:07:02 UTC
Thank you for clarifying

Comment 21 Brad Buckingham 2016-08-17 00:58:14 UTC
*** Bug 1365672 has been marked as a duplicate of this bug. ***

Comment 22 Brad Buckingham 2016-08-17 01:01:01 UTC
*** Bug 1367421 has been marked as a duplicate of this bug. ***

Comment 23 Sebastian Hetze 2016-08-18 11:10:30 UTC
Workaround:

For my BZ#1367421 I find that 'foreman-rake katello:reindex' makes the products appear correctly in the subscription list.

Comment 24 Maxim Burgerhout 2016-08-18 13:34:28 UTC
(In reply to Sebastian Hetze from comment #23)
> Workaround:
> 
> For my BZ#1367421 I find that 'foreman-rake katello:reindex' makes the
> products appear correctly in the subscription list.

+1 

Noticed the same thing this morning. Any chance we can get this documented in a KCS at the very least?

Comment 25 Zach Huntington-Meath 2016-08-19 14:43:38 UTC
*** Bug 1368377 has been marked as a duplicate of this bug. ***

Comment 26 Peter Vreman 2016-08-22 08:04:34 UTC
I did a clean installation again and applied the proposed fix https://patch-diff.githubusercontent.com/raw/Katello/katello/pull/6227.diff before starting any provisiioning.

I can confirm that the fix works

Comment 27 jcallaha 2016-09-01 17:48:06 UTC
Verified in Satellite 6.2.2. Custom subscriptions are now being created correctly for custom products. See attached images for verification.

Comment 28 jcallaha 2016-09-01 17:56:51 UTC
Created attachment 1196919 [details]
Ver1

Comment 29 jcallaha 2016-09-01 17:57:43 UTC
Created attachment 1196921 [details]
Ver2

Comment 32 errata-xmlrpc 2016-09-14 21:01:19 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/RHBA-2016:1885