Project

General

Profile

Actions

Bug #34501

closed

Fail to import contents when the connected and disconnected servers have different product labels for the same product

Added by Jonathon Turel about 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
High
Category:
Inter Server Sync
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=2041701

Description of problem:
hammer content-import version --organization Default_Organization --path /var/lib/pulp/imports/Default_Organization/cv-ha/1.0/2022-01-13T19-50-44-11-00

Could not import the archive:
The organization manifest does not contain the subscriptions required to enable the following repositories. * Product = 'Red Hat Enterprise Linux High Availability for x86_64', Repository = 'Red Hat Enterprise Linux High Availability for RHEL 7 Server RPM x86_64 7Server'

This is happening because the connected and disconnected Satellite have different product labels for the same product. For example, the connected Satellite has "Red_Hat_Enterprise_Linux_High_Availability_for_RHEL_Server_" (old product name) but the disconnected Satellite is expecting label "Red_Hat_Enterprise_Linux_High_Availability_for_x86_64" (new product name). Due to this mismatch, the import fails.

#<Katello::Product:0x0000000013fe9b20
...
name: "Red Hat Enterprise Linux High Availability for x86_64",
...
cp_id: "83",
label: "Red_Hat_Enterprise_Linux_High_Availability__for_RHEL_Server_", <==== connected satellite
organization_id: 1,
...>

#<Katello::Product:0x0000000015596888
...
name: "Red Hat Enterprise Linux High Availability for x86_64",
...
cp_id: "83",
label: "Red_Hat_Enterprise_Linux_High_Availability_for_x86_64", <==== disconnected satellite
...>

This can be fixed by updating the product label of the connected Satellite.

----------------------------------------
foreman-rake console
prod = Katello::Product.find_by_name("Red Hat Enterprise Linux High Availability for x86_64")
prod.label = Katello::Util::Model.labelize(prod.name)
prod.save(validate: false)
exit
----------------------------------------

However, I am thinking it might be better to use the product name or the cp_id to validate the import instead of using product label. For example, "Red Hat Enterprise Linux Server", cp id is "69" and "Red Hat Enterprise Linux High Availability for x86_64" is "83". This is because product name is subject to change upstream but product label must be constant in Satellite.

Actions #1

Updated by Jonathon Turel about 2 years ago

  • Subject changed from Fail to import contents when the connected and disconnected servers have different product labels for the same product to Fail to import contents when the connected and disconnected servers have different product labels for the same product
  • Pull request https://github.com/Katello/katello/pull/9944 added
Actions #2

Updated by Chris Roberts about 2 years ago

  • Target version changed from Katello 4.4.0 to Katello 4.5.0
Actions #3

Updated by Chris Roberts about 2 years ago

  • Triaged changed from No to Yes
Actions #4

Updated by The Foreman Bot about 2 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Jonathon Turel
Actions #5

Updated by The Foreman Bot about 2 years ago

  • Fixed in Releases Katello 4.5.0 added
Actions #6

Updated by Jonathon Turel about 2 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF