Project

General

Profile

Bug #34501

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

Added by Jonathon Turel 4 months ago. Updated 4 months ago.

Status:
Closed
Priority:
High
Category:
Inter Server Sync
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

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.

Associated revisions

Revision c90c4bd2 (diff)
Added by Jonathon Turel 4 months ago

Fixes #34501 - Refactor CV import to use MetadataMap + support cp_id product lookup (#9944)

  • Fixes #34501 - Refactor CV import to use MetadataMap + support cp_id product lookup
  • Refs #34501 - fix CreateImport action name

History

#1 Updated by Jonathon Turel 4 months 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

#2 Updated by Chris Roberts 4 months ago

  • Target version changed from Katello 4.4.0 to Katello 4.5.0

#3 Updated by Chris Roberts 4 months ago

  • Triaged changed from No to Yes

#4 Updated by The Foreman Bot 4 months ago

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

#5 Updated by The Foreman Bot 4 months ago

  • Fixed in Releases Katello 4.5.0 added

#6 Updated by Jonathon Turel 4 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF