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.
The labels are generated by Katello from name field of the product. Once set they stay immutable (since it is used as key.) So sounds like at some point "Red Hat Enterprise Linux High Availability for x86_64" was called "Red Hat Enterprise Linux High Availability for RHEL Server". A label was generated then and when the manifest got re-imported on the connected server it updated the name but not the label. As Hao points out using the cp_id is probably a better idea at least for RH products.
Connecting redmine issue https://projects.theforeman.org/issues/34501 from this bug
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/34501 has been resolved.
I created Export and Import organizations, imported manifest, synced RH Repository (Red Hat Satellite Capsule 6.10 for RHEL 7 Server RPMs x86_64) and prepared an export Then launched following command in 'foreman-rake console' (organization_id: 4 is id of my import org): prod = Katello::Product.where(label: 'Red_Hat_Satellite_Capsule', organization_id: 4).first prod.update_attribute(:label, prod.label + "-updated") After that i performed the import successfully. I also checked presence of "cp_id" in metadata.json. When label is changed, then import from older Satellite (without this fix and without cp_id in metadata.json) is not possible. Import of data without 'cp_id' is possible when label does not differ. VERIFIED with Satellite 6.11 SNAP 17.0
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 (Moderate: Satellite 6.11 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-2022:5498