Description of problem: The goal of using "satellite-maintain self-upgrade" is usually for performing a major version upgrade i.e. 6.10 to 6.11 , but when we execute this command on Satellite\Capsule 6.11.1.1 , It tries to enable the maintenance-rpms repo with a wrong version. Version-Release number of selected component (if applicable): Satellite\Capsule 6.11.1.1 How reproducible: 100% Steps to Reproduce: 1. Install the latest most version of Satellite 6.11 and ensure we are on 6.11.1.1-1 2. Run "satellite-maintain self-upgrade" Actual results: On RHEL 7: ~~~ Failed executing yum --enablerepo=rhel-7-server-rpms --enablerepo=rhel-server-rhscl-7-rpms --enablerepo=rhel-7-server-satellite-maintenance-6.11.2-rpms -y --disableplugin=foreman-protector update satellite-maintain rubygem-foreman_maintain, exit status 1: Loaded plugins: enabled_repos_upload, package_upload, product-id, search- : disabled-repos, subscription-manager Error getting repository data for rhel-7-server-satellite-maintenance-6.11.2-rpms, repository not found Uploading Enabled Repositories Report Loaded plugins: product-id, subscription-manager ~~~ On RHEL 8: ~~~ / Enabling repositories [FAIL] Failed executing subscription-manager repos --enable=rhel-8-for-x86_64-baseos-rpms --enable=rhel-8-for-x86_64-appstream-rpms --enable=satellite-maintenance-6.11.2-for-rhel-8-x86_64-rpms, exit status 1: Error: 'satellite-maintenance-6.11.2-for-rhel-8-x86_64-rpms' does not match a valid repository ID. Use "subscription-manager repos --list" to see valid repositories. Repository 'rhel-8-for-x86_64-baseos-rpms' is enabled for this system. Repository 'rhel-8-for-x86_64-appstream-rpms' is enabled for this system. -------------------------------------------------------------------------------- ~~~ As we can see, it tries to enable 6.11.2 instead of 6.12 which is not correct. Expected results: If the next major version ( 6.12 ) is not available, the command should immediately stop it's execution. the next major version ( 6.12 ) is available then the command should try to enable the right maintenance repo for 6.12 Additional info: From a small testing, the main root cause seems to be the way 6.11.1.1 and 6.11.1 is being processed by the .bump method ruby. # foreman-rake console API controllers newer than Apipie cache! Run apipie:cache rake task to regenerate cache. Loading production environment (Rails 6.0.4.7) irb(main):002:0> Gem::Version.new('6.11.1.1').bump => #<Gem::Version "6.11.2"> irb(main):003:0> Gem::Version.new('6.11.1.0').bump => #<Gem::Version "6.11.2"> irb(main):004:0> Gem::Version.new('6.11.1').bump => #<Gem::Version "6.12"> irb(main):005:0> Gem::Version.new('6.11.0').bump => #<Gem::Version "6.12"> irb(main):006:0> Gem::Version.new('6.11').bump => #<Gem::Version "7"> irb(main):007:0> exit
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/35404 has been resolved.
Hi, Since we don't have 6.12.0.x at the moment, it's not possible to test it on 6.12. Alternatively, I patched 6.11.1.1 with this fix and got below error, is this expected or should the issue be moved back to ASSIGNED? # foreman-maintain self-upgrade undefined method `bump' for "6.11":String Thanks, Gaurav
@ehelms Since Amit is not around, could you please take a look at the issue in comment 8?
@gtalreja please failQA this one, there is more work needed: https://github.com/theforeman/foreman_maintain/pull/648
Evgeni, Thanks for the confirmation, moving this back to ASSIGNED.
The patch posted in comment 10 is now merged. Thanks Evgeni!
Verified Tested on Satellite 6.12.0 Snap 14.0 Version: rubygem-foreman_maintain-1.1.8-1.el8sat.noarch Steps: Applied this fix on 6.11.1.1/6.12.0 and ran "foreman-maintain self-upgrade" Observation For 6.11.1.1, self-upgrade enables 6.12 maintenance repo and for 6.12.0, self-upgrade enables 6.13 maintenance repo
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