Bug 2054182

Summary: remove pulp2 automatically on upgrade to 6.11 (If the user hasn't already done it)
Product: Red Hat Satellite Reporter: Lukas Pramuk <lpramuk>
Component: Satellite MaintainAssignee: Ian Ballou <iballou>
Status: CLOSED ERRATA QA Contact: Lukas Pramuk <lpramuk>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.11.0CC: apatel, aupadhye, egolov, ehelms, gtalreja, iballou, jsherril, kgaikwad, pcreech, pmoravec
Target Milestone: 6.11.0Keywords: Regression, Triaged, UpgradeBlocker, Upgrades
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-foreman_maintain-1.0.5 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-07-05 14:33:17 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:
Bug Depends On:    
Bug Blocks: 2063910    

Description Lukas Pramuk 2022-02-14 11:23:07 UTC
Description of problem:
python3-pulp-2to3-migration rpm prevents upgrades to solve dependencies as python3-pulp-2to3-migration requirement for "python3-pulpcore < 3.15" conflicts with tfm-pulpcore-python3-pulpcore-3.16 rpm 
 
Version-Release number of selected component (if applicable):
7.0.0

How reproducible:
deterministic

Steps to Reproduce:
1. Have a Sat 6.10.2 (upgraded from 6.9 so it content migration was performed = python3-pulp-2to3-migration is present)
# rpm -q python3-pulp-2to3-migration
python3-pulp-2to3-migration-0.12.0-1.el7pc.noarch

2. Upgrade to 7.0.0
# satellite-maintain upgrade run --target-version 7.0 -w repositories-validate,repositories-setup -y
...

Running Migration scripts to Satellite 7.0
================================================================================
Setup repositories:                                                   [SKIPPED]
--------------------------------------------------------------------------------
Unlock packages:                                                      [OK]
--------------------------------------------------------------------------------
Update package(s) :                                                   [FAIL]
Failed executing yum -y --disableplugin=foreman-protector update, exit status 1:
 Loaded plugins: product-id, search-disabled-repos, subscription-manager
Resolving Dependencies
--> Running transaction check
...

Error: Package: python2-solv-0.7.20-1.el7pc.x86_64 (@rhel-7-server-satellite-6.10-rpms)
           Requires: libsolv(x86-64) = 0.7.20-1.el7pc
           Removing: libsolv-0.7.20-1.el7pc.x86_64 (@rhel-7-server-satellite-6.10-rpms)
               libsolv(x86-64) = 0.7.20-1.el7pc
           Updated By: libsolv-0.7.20-4.el7pc.x86_64 (rhel-7-server-satellite-7.0-rpms)
               libsolv(x86-64) = 0.7.20-4.el7pc
           Available: libsolv-0.6.11-1.el7.x86_64 (rhel-7-server-rpms)
               libsolv(x86-64) = 0.6.11-1.el7
           Available: libsolv-0.6.20-5.el7.x86_64 (rhel-7-server-rpms)
               libsolv(x86-64) = 0.6.20-5.el7
           Available: libsolv-0.6.26-1.el7.x86_64 (rhel-7-server-rpms)
               libsolv(x86-64) = 0.6.26-1.el7
           Available: libsolv-0.6.26-2.el7.x86_64 (rhel-7-server-rpms)
               libsolv(x86-64) = 0.6.26-2.el7
           Available: libsolv-0.6.34-2.el7.x86_64 (rhel-7-server-rpms)
               libsolv(x86-64) = 0.6.34-2.el7
           Available: libsolv-0.6.34-4.el7.x86_64 (rhel-7-server-rpms)
               libsolv(x86-64) = 0.6.34-4.el7
Error: Package: python3-pulp-2to3-migration-0.12.0-1.el7pc.noarch (@rhel-7-server-satellite-6.10-rpms)
           Requires: python3-pulpcore >= 3.13
           Removing: python3-pulpcore-3.14.9-1.el7pc.noarch (@rhel-7-server-satellite-6.10-rpms)
               python3-pulpcore = 3.14.9-1.el7pc
           Obsoleted By: tfm-pulpcore-python3-pulpcore-3.16.1-1.el7pc.noarch (rhel-7-server-satellite-7.0-rpms)
               Not found 
Error: Package: python3-pulp-2to3-migration-0.12.0-1.el7pc.noarch (@rhel-7-server-satellite-6.10-rpms)
           Requires: python3-pulpcore < 3.15
           Removing: python3-pulpcore-3.14.9-1.el7pc.noarch (@rhel-7-server-satellite-6.10-rpms)
               python3-pulpcore = 3.14.9-1.el7pc
           Obsoleted By: tfm-pulpcore-python3-pulpcore-3.16.1-1.el7pc.noarch (rhel-7-server-satellite-7.0-rpms)
               Not found 

 
Actual results:
upgrade failed to solve dependencies

Expected results:
upgrade is successful


Additional info:
the output shows there is yet another issue: python2-solv => yet another BZ

Comment 1 Lukas Pramuk 2022-02-14 11:56:52 UTC
python2-solv issues is tracked by BZ #2054184

Comment 2 Justin Sherrill 2022-02-15 13:57:33 UTC
"satellite-maintain content remove-pulp2 --assumeyes" should be run by all users after upgrading to 6.10 and confirming the operation of the satellite on pulp3. 


For now i would recommend you run that command after upgrading to 6.10 but before you upgrade to 7.0.   That should help the upgrade go through properly, and should unblock you. 

To resolve this, we will add a step to the upgrade to 7.0 to automatically run this command for the user.

Comment 3 Lukas Pramuk 2022-02-15 15:01:57 UTC
*** Bug 2054184 has been marked as a duplicate of this bug. ***

Comment 5 Justin Sherrill 2022-02-16 20:52:01 UTC
Created redmine issue https://projects.theforeman.org/issues/34463 from this bug

Comment 6 Bryan Kearney 2022-03-05 00:05:36 UTC
Upstream bug assigned to iballou

Comment 7 Bryan Kearney 2022-03-05 00:05:38 UTC
Upstream bug assigned to iballou

Comment 8 Bryan Kearney 2022-03-09 08:05:16 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/34463 has been resolved.

Comment 9 Amit Upadhye 2022-03-09 09:48:18 UTC
*** Bug 2061571 has been marked as a duplicate of this bug. ***

Comment 10 Evgeni Golov 2022-03-15 08:29:54 UTC
@jsherril @iballou the current implementation in https://github.com/theforeman/foreman_maintain/pull/589 only runs this automatically on the Satellite, not on Capsules.

The docs for the "to 6.10" upgrade document one shall run it on Capsules too:
https://access.redhat.com/documentation/en-us/red_hat_satellite/6.10/html/upgrading_and_updating_red_hat_satellite/upgrading_red_hat_satellite#upgrading_capsule_server

> If you have migrated content from Pulp 2 to Pulp 3, remove all Pulp 2 content.
> # satellite-maintain content remove-pulp2
> This removes Pulp 2 RPMs, content in /var/lib/pulp/content/, the mongo database, and migration content in the Pulp 3 database. 

So I'd argue this should also automatically happen for Capsule upgrades to newer versions than 6.10?

Comment 11 Lukas Pramuk 2022-03-15 10:37:24 UTC
@egolov Thanks. Lets speed it up. No needinfos needed as I'm failing QA for this BZ.


FailedQA.
@Satellite 7.0.0 Snap13

by just sanity checking the foreman-maintain source:

>>> the same changes in definitions/scenarios/upgrade_to_satellite_7_0.rb should've gone also to definitions/scenarios/upgrade_to_capsule_7_0.rb

Comment 12 Ian Ballou 2022-03-15 14:45:32 UTC
Sounds good, I'll have capsules uninstall Pulp 2 as well.

Comment 15 Justin Sherrill 2022-04-18 12:19:03 UTC
clearing needinfo

Comment 16 Lukas Pramuk 2022-04-20 09:50:22 UTC
VERIFIED.

@Satellite 6.11.0 Snap16
rubygem-foreman_maintain-1.0.7-1.el7sat.noarch

by the manual reproducer described in comment#0:

1) Have a Sat 6.9.9 and Capsule 6.9.9 associated

2) Upgrade both Satellite and Capsule to 6.10.4 (upgraded from 6.9 => python3-pulp-2to3-migration is present)

3) Upgrade both Satellite and Capsule to 6.11.0

# satellite-maintain upgrade run --target-version 6.11 -w repositories-validate,repositories-setup -y
...

--------------------------------------------------------------------------------
Upgrade finished.

>>> upgrade is now successful as there are no failed rpm dependencies

# rpm -q python3-pulp-2to3-migration
package python3-pulp-2to3-migration is not installed

>>> pulp2 removal is now performed automatically upon 6.11 upgrade (on both Satellite and Capsule)

Comment 19 errata-xmlrpc 2022-07-05 14:33:17 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 (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