Bug 1425052

Summary: Host associated subscription links are incorrect as well as the associated host in RH Subscriptions
Product: Red Hat Satellite Reporter: Marcel Gazdík <mgazdik>
Component: Hosts - ContentAssignee: John Mitsch <jomitsch>
Status: CLOSED DUPLICATE QA Contact: Katello QA List <katello-qa-list>
Severity: high Docs Contact:
Priority: high    
Version: 6.2.7CC: bbuckingham, jcallaha, ktordeur
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-04-08 07:01:31 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:

Description Marcel Gazdík 2017-02-20 12:57:19 UTC
Description of problem:
  Link to subscription listed in the Content host -> Subscriptions are pointing to an incorrect subscription or even to non-existing subscription. Also the page RH Subscriptions -> (Subscription) -> Associations -> Hosts does not show any associated host mainly for the VDC subscription.

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

How reproducible:
  On system with multiple subscriptions, install new HyperVisor, attach VDC subscription with some other available subscriptions for sake of debug. You will be able to see wrong links in the content host detail page as well as no host associated for the VDC subscription on the RH Subscriptions page although there is clearly mentioned that the subscription is being consumed.


Actual results:
  1) Links in Content Hosts -> Detail of the host -> Subscriptions to the subscription detail page are wrong.
  2) Associated hosts list in RH Subscriptions -> Subscription detail -> Associations -> Hosts are not listed

Expected results:
  1) Link will be corrected
  2) Page will list all hosts to which was the subscription assigned

Additional info:
  The reason for the 1) issue, probably even both issues is discrepancy between subscription_id and id in the API JSON response, where the subscription_id for the link is being used instead of id. 
  Example:
API Response snippet:
~~~
quantity_consumed: 1,
id: 4,
cp_id: "8a8a8a84503ca5bc01503cf0bf8f01ef",
subscription_id: 2,
name: "Employee SKU",
start_date: "2013-04-24T04:00:00.000+0000",
end_date: "2022-01-01T04:59:59.000+0000",
available: 2,
quantity: 6,
consumed: 4,
account_number: 540155,
contract_number: 10169621,
support_level: "Self-Support",
product_id: "ES0113909",
sockets: 128,
cores: null,
ram: null,
instance_multiplier: 1,
stacking_id: null,
multi_entitlement: null,
type: "NORMAL",
product_name: "Employee SKU",
unmapped_guest: false,
virt_only: false
~~~

Links in the WebUI generated based on the above response:
~~~
https://sat.example.com/subscriptions/2/info
~~~

The ID in the above link should be 4 in this case.

Comment 2 Brad Buckingham 2017-02-27 18:58:01 UTC
Created redmine issue http://projects.theforeman.org/issues/18707 from this bug

Comment 3 Satellite Program 2017-03-15 20:01:34 UTC
Upstream bug assigned to jomitsch

Comment 4 Kenny Tordeurs 2017-04-08 07:01:31 UTC

*** This bug has been marked as a duplicate of bug 1406450 ***