Bug 2092039

Summary: Content import fails if repo labels differ and repo is already imported
Product: Red Hat Satellite Reporter: Joniel Pasqualetto <jpasqual>
Component: Inter Satellite SyncAssignee: Partha Aji <paji>
Status: CLOSED ERRATA QA Contact: Radek Mynar <rmynar>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.10.5CC: ahumbe, vsedmik, wclark, zhunting
Target Milestone: 6.12.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2112350 (view as bug list) Environment:
Last Closed: 2022-11-16 13:33:51 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:
Attachments:
Description Flags
Hotfix RPM for Satellite 6.10.7 none

Description Joniel Pasqualetto 2022-05-31 15:21:27 UTC
Description of problem:

When repository labels between exporting and importing satellites don't match, the import process will fail with a conflict error if the repository being imported is already enabled (due to a previous import).

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

This issue only happens on Satellite 6.10.5+

How reproducible:

Always

Steps to Reproduce:
1. Ensure the exporting and importing Satellite has a mismatch in the label of a repository
2. Export the repository on exporting server
3. Import the repository on importing server
4. Export a version 2.0 of the repository (incremental or complete, doesn't matter)
5. Try importing version 2.0

Actual results:

Import of version 2.0 fails with a conflict:

~~~
 hammer content-import library --path /var/lib/pulp/imports/Org/Export-Library/2.0/2022-05-31T09-56-09-04-00/ --organization-id 1
Could not import the archive.:
  Error: 409 Conflict
~~~

Logs show a stacktrace like this:

~~~
2022-05-31T10:08:47 [E|app|a6c5fda2] Katello::Errors::ConflictException: The repository is already enabled
 a6c5fda2 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.56/app/lib/actions/katello/repository_set/enable_repository.rb:15:in `plan'
 a6c5fda2 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.9/lib/dynflow/action.rb:515:in `block (3 levels) in execute_plan'
 a6c5fda2 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.9/lib/dynflow/middleware/stack.rb:27:in `pass'
 a6c5fda2 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.9/lib/dynflow/middleware.rb:19:in `pass'
 a6c5fda2 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.9/lib/dynflow/middleware.rb:36:in `plan'
 a6c5fda2 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.9/lib/dynflow/middleware/stack.rb:23:in `call'
 a6c5fda2 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.9/lib/dynflow/middleware/stack.rb:27:in `pass'
~~~

Expected results:

Import should work and update the existing repository, instead of trying to enable it again

Additional info:

Comment 2 Bryan Kearney 2022-06-14 04:04:33 UTC
Upstream bug assigned to paji

Comment 3 Bryan Kearney 2022-06-14 04:04:35 UTC
Upstream bug assigned to paji

Comment 4 Bryan Kearney 2022-06-14 20:04:36 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/34992 has been resolved.

Comment 5 wclark 2022-07-12 19:36:02 UTC
Created attachment 1896492 [details]
Hotfix RPM for Satellite 6.10.7

INSTALL INSTRUCTIONS:

1. Take a complete backup or snapshot of Satellite 6.10.7 server

2. Download the hotfix RPM attached to this BZ and copy it to Satellite server

3. # yum install ./tfm-rubygem-katello-4.1.1.60-3.HOTFIXRHBZ2092039.el7sat.noarch.rpm --disableplugin=foreman-protector

4. # satellite-maintain service restart

Comment 6 Radek Mynar 2022-09-23 15:41:28 UTC
RH repositories can be imported even when export and import repo labels don't match.

VERIFIED with Satellite 6.12 SNAP10 @ RHEL8.6

Comment 10 errata-xmlrpc 2022-11-16 13:33:51 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.12 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:8506