Red Hat Satellite/Capsule upgrade from 6.16 to 6.17 release failed with CommandError: Unknown issue: '4073'
Environment
-
Red Hat Satellite 6.16
- After leapp upgrade from RHEL 8.x to RHEL 9.x
-
After the upgrade failed, the following packages are installed on the Satellite/Capsule server:
satellite-6.17.9-1.el9sat.noarch(on Satellite) orsatellite-capsule-6.17.9-1.el9sat.noarch(on Capsule)python3.11-pulp-rpm-3.27.10-2.el9pc.noarchrubygem-foreman_maintain-1.10.5-1.el9sat.noarch
Issue
After successful in-place upgrade of Red Hat Satellite/Capsule 6.16 server from RHEL 8.x to RHEL 9.x, upgrade form Red Hat Satellite 6.16 to 6.17 failed with the following error:
--------------------------------------------------------------------------------
Rename ContentArtifact relative_paths to match `{N-V-R.A.rpm}`:
\ Running pulpcore-manager rpm-datarepair 4073 [FAIL]
Failed executing PULP_SETTINGS=/etc/pulp/settings.py runuser -u pulp -- pulpcore-manager rpm-datarepair 4073, exit status 1:
CommandError: Unknown issue: '4073'
--------------------------------------------------------------------------------
Scenario [Procedures after migrating] failed.
Resolution
The Content from redhat.atlassian.net is not included.Satellite 6.16→6.17 upgrade fails: pulpcore-manager rpm-datarepair 4073 CommandError: Unknown issue: '4073' bug report addresses the issue.
Workaround:
-
Follow the Diagnostic Steps section to confirm that the workaround is applicable for the reported issue before proceeding with the next steps of the resolution.
-
Make a backup copy of the
/usr/share/gems/gems/foreman_maintain-1.10.5/definitions/procedures/pulpcore/rpm_datarepair.rbfile on the affected Satellite/Capsule server:
# cp -a /usr/share/gems/gems/foreman_maintain-1.10.5/definitions/procedures/pulpcore/rpm_datarepair.rb \ /usr/share/gems/gems/foreman_maintain-1.10.5/definitions/procedures/pulpcore/rpm_datarepair.rb.bak
-
Edit the file to replace the explicit invocation of
pulpcore-manager rpm-datarepair 4073with a bypass via Ruby native return statement.
So instead of:# cat /usr/share/gems/gems/foreman_maintain-1.10.5/definitions/procedures/pulpcore/rpm_datarepair.rb module Procedures::Pulpcore class RpmDatarepair < ForemanMaintain::Procedure include ForemanMaintain::Concerns::PulpCommon metadata do description 'Rename ContentArtifact relative_paths to match `{N-V-R.A.rpm}`' for_feature :pulpcore end def run with_spinner('Running pulpcore-manager rpm-datarepair 4073') do # Assumption: services are already started execute!(pulpcore_manager('rpm-datarepair 4073')) end end end end
The file should look like:
# cat /usr/share/gems/gems/foreman_maintain-1.10.5/definitions/procedures/pulpcore/rpm_datarepair.rb
module Procedures::Pulpcore
class RpmDatarepair < ForemanMaintain::Procedure
include ForemanMaintain::Concerns::PulpCommon
metadata do
description 'Rename ContentArtifact relative_paths to match `{N-V-R.A.rpm}`'
for_feature :pulpcore
end
def run
with_spinner('Running pulpcore-manager rpm-datarepair 4073') do
# Bypassed via Ruby native return statement to avoid invoking pulpcore-manager wrapper wrapper
true
end
end
end
end
So basically, replacing the following 2 lines:
# Assumption: services are already started
execute!(pulpcore_manager('rpm-datarepair 4073'))
with:
# Bypassed via Ruby native return statement to avoid invoking pulpcore-manager wrapper wrapper
true
-
Confirm the change:
# diff /usr/share/gems/gems/foreman_maintain-1.10.5/definitions/procedures/pulpcore/rpm_datarepair.rb /usr/share/gems/gems/foreman_maintain-1.10.5/definitions/procedures/pulpcore/rpm_datarepair.rb.bakThis should return:
12,13c12,13 < # Bypassed via Ruby native return statement to avoid invoking pulpcore-manager wrapper wrapper < true --- > # Assumption: services are already started > execute!(pulpcore_manager('rpm-datarepair 4073')) -
Run the following command:
# satellite-installer -
Re-run the failed upgrade command:
# satellite-maintain upgrade run
For more KB articles/solutions related to Red Hat Satellite 6.x Installation/Upgrade/Update Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Installation/Upgrade/Update Issues.
Root Cause
The automation step in /usr/share/gems/gems/foreman_maintain-1.10.5/definitions/procedures/pulpcore/rpm_datarepair.rb explicitly invokes pulpcore-manager rpm-datarepair 4073. However, python3.11-pulp-rpm-3.27.10-2.el9pc does not ship with issue 4073 backported into its database mapping registry. Because execute! uses a strict assertion that forces a script exit on non-zero returns, the post-migration phase fails immediately.
Diagnostic Steps
-
Confirm that the
/usr/share/gems/gems/foreman_maintain-1.10.5/definitions/procedures/pulpcore/rpm_datarepair.rbexplicitly invokespulpcore-manager rpm-datarepair 4073:# cat /usr/share/gems/gems/foreman_maintain-1.10.5/definitions/procedures/pulpcore/rpm_datarepair.rb module Procedures::Pulpcore class RpmDatarepair < ForemanMaintain::Procedure include ForemanMaintain::Concerns::PulpCommon metadata do description 'Rename ContentArtifact relative_paths to match `{N-V-R.A.rpm}`' for_feature :pulpcore end def run with_spinner('Running pulpcore-manager rpm-datarepair 4073') do # Assumption: services are already started execute!(pulpcore_manager('rpm-datarepair 4073')) end end end end -
Confirm that
python3.11-pulp-rpm-3.27.10-2.el9pcdoes not ship with issue 4073 backported into its database mapping registry:
# sudo -u pulp PULP_SETTINGS='/etc/pulp/settings.py' DJANGO_SETTINGS_MODULE='pulpcore.app.settings' pulpcore-manager rpm-datarepair --help
usage: pulpcore-manager rpm-datarepair [-h] [--version] [-v {0,1,2,3}] [--settings SETTINGS] [--pythonpath PYTHONPATH] [--traceback] [--no-color] [--force-color] [--skip-checks]
issue
Django management command for repairing RPM metadata in the Pulp database.
positional arguments:
issue The github issue # of the issue to be fixed.
options:
-h, --help show this help message and exit
--version Show program's version number and exit.
-v {0,1,2,3}, --verbosity {0,1,2,3}
Verbosity level; 0=minimal output, 1=normal output, 2=verbose output, 3=very verbose output
--settings SETTINGS The Python path to a settings module, e.g. "myproject.settings.main". If this isn't provided, the DJANGO_SETTINGS_MODULE environment variable will be used.
--pythonpath PYTHONPATH
A directory to add to the Python path, e.g. "/home/djangoprojects/myproject".
--traceback Raise on CommandError exceptions.
--no-color Don't colorize the command output.
--force-color Force colorization of the command output.
--skip-checks Skip system checks.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.