Bug 2168330

Summary: refreshing the manifest sends invalid DISTRIBUTION_VERSION fact to the upstream candlepin
Product: Red Hat Satellite Reporter: Roman Plevka <rplevka>
Component: Subscription ManagementAssignee: Chris Roberts <chrobert>
Status: CLOSED ERRATA QA Contact: Ian Ballou <iballou>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.13.0CC: ahumbe, chrobert, iballou, pcreech, risantam
Target Milestone: 6.13.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-foreman_theme_satellite-11.0.0.5-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-03 13:25:08 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 Roman Plevka 2023-02-08 18:16:48 UTC
Description of problem:
whenever we refresh a manifest, a POST and PUT requests are made to the upstream candlepin with an invalid satellite version format in facts.

Sadly, upstream candlepin accepts the version but this causes issues down the road (missing SCA attribute in the RHSM api response, etc. )

The request looks like this:

```
2023-02-08T12:11:01 [debug|kat|8ec0c781] Sending POST request to upstream Candlepin: https://subscription.rhsm.redhat.com/subscription/consumers/<redacted uuid> {"capabilities":[{"name":"instance_multiplier"},{"name":"derived_product"},{"name":"vcpu"},{"name":"cert_v3"},{"name":"hypervisors_heartbeat"},{"name":"remove_by_pool_id"},{"name":"syspurpose"},{"name":"storage_band"},{"name":"cores"},{"name":"multi_environment"},{"name":"hypervisors_async"},{"name":"org_level_content_access"},{"name":"guest_limit"},{"name":"ram"},{"name":"batch_bind"}],"facts":{"distributor_version":"sat-6"}}
```


Note, that the valid values for the `distributor_version` according RHSM api are "sat-6.<y>" with `6.12` currently being the latest.

Version-Release number of selected component (if applicable):
6.13.0-snap8  but this has been occurring in 6.12 as well

How reproducible:
always on manifest refresh triggered from satellite

Steps to Reproduce:
1. create a subscription allocation on access.redhat.com
2. choose an appropriate version of satellite
3. download the manifest and upload it to the satellite organization
4. navigate to subscriptions->manage manifest and hit "Refresh"
5. after the refresh is finished, check the subscription allocation details on access.redhat.com
6. the Satellite version is now "Satellite 6"


Actual results:
Satellite version of the allocation is set to invalid value on access.redhat.com

Expected results:
satellite version stays untouched

Additional info:

Comment 4 Nikos Moumoulidis 2023-03-22 13:36:04 UTC
*** Bug 2178845 has been marked as a duplicate of this bug. ***

Comment 7 errata-xmlrpc 2023-05-03 13:25:08 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.13 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-2023:2097