Skip to content

Conversation

@PeterMocary
Copy link
Member

@PeterMocary PeterMocary commented Oct 24, 2025

This PR contains the solution to the root cause of the problem from ticket RHEL-120252 in the first commit. The second commit proposes an improvement to the fallback mechanism described below. Lets decide if this improvement should be included or not. If it is not included, the upgrade paths map should be updated for the Alma Linux with the original fallback definitions same as for RHEL.

I've tried to run preupgrade with the following changes on Alma Linux 9.6 and RHEL 9.6.

Commit#1: fix unsupported source version crash

This patch fixes a crash when executing upgrade on a system with version
that is not defined in the supported upgrade paths map and when the
fallback mechanism for this particular case fails as well. The upgrade
process is now terminated with an error instead of a trace back.

Commit#2: improve fallback mechanism for source version matching

When searching in the upgrade paths map by the system version, we had
implemented a fallback that allowed the upgrade process to find a target
version even if the minor version of the system did not match exactly
with the ones defined in the map.

The fallback mechanism was implemented using additional definitions in
the map which did not have a minor version explicitly defined and thus
would be only used as a fallback when the system version did not match
any minor version.

This patch changes this fallback mechanism to instead search in the map
by the latest minor version of the system's major version. The
additional records are removed from the map as well.

Jira: RHEL-120252

@github-actions
Copy link

Thank you for contributing to the Leapp project!

Please note that every PR needs to comply with the leapp-repository contribution and development guidelines and must pass all tests in order to be mergeable.
If you want to request a review or rebuild a package in copr, you can use following commands as a comment:

  • review please @oamg/developers to notify leapp developers of the review request
  • /packit copr-build to submit a public copr build using packit

Packit will automatically schedule regression tests for this PR's build and latest upstream leapp build.
However, here are additional useful commands for packit:

  • /packit test to re-run manually the default tests
  • /packit retest-failed to re-run failed tests manually
  • /packit test oamg/leapp#42 to run tests with leapp builds for the leapp PR#42 (default is latest upstream - main - build)

Note that first time contributors cannot run tests automatically - they need to be started by a reviewer.

It is possible to schedule specific on-demand tests as well. Currently 2 test sets are supported, beaker-minimal and kernel-rt, both can be used to be run on all upgrade paths or just a couple of specific ones.
To launch on-demand tests with packit:

  • /packit test --labels kernel-rt to schedule kernel-rt tests set for all upgrade paths
  • /packit test --labels beaker-minimal-8.10to9.4,kernel-rt-8.10to9.4 to schedule kernel-rt and beaker-minimal test sets for 8.10->9.4 upgrade path

See other labels for particular jobs defined in the .packit.yaml file.

Please open ticket in case you experience technical problem with the CI. (RH internal only)

Note: In case there are problems with tests not being triggered automatically on new PR/commit or pending for a long time, please contact leapp-infra.

@pirat89 pirat89 force-pushed the fix-unsupported-source-version-crash branch from 40427ce to 0925960 Compare October 27, 2025 09:20
@pirat89
Copy link
Member

pirat89 commented Oct 27, 2025

Rebased after the mass change in upstream.

@pirat89 pirat89 added the bug Something isn't working label Oct 30, 2025
@pirat89 pirat89 added this to the 8.10/9.8 milestone Oct 30, 2025
@PeterMocary PeterMocary force-pushed the fix-unsupported-source-version-crash branch 2 times, most recently from 9dfee8f to d634f5a Compare November 6, 2025 15:12
@PeterMocary
Copy link
Member Author

Based on discussion with the team, we decided to not include the improvement at this time. I dropped the improvement commit and defined the original fallback mechanism for the Alma linux upgrade paths as well. This makes sure the error won't be hit for any distribution and the unsupported source version will result into an inhibitor informing the user about unsupported upgrade path.

This patch fixes a crash when executing upgrade on a system with version
that is not defined in the supported upgrade path map and when the
fallback mechanism for this particular case fails as well. The upgrade
process is now terminated with an error instead of a trace back.

Jira: RHEL-120252
@PeterMocary PeterMocary force-pushed the fix-unsupported-source-version-crash branch from d634f5a to e640511 Compare November 6, 2025 15:29
@PeterMocary
Copy link
Member Author

Rebased.

Copy link
Member

@matejmatuska matejmatuska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, works as expected, when the fallback paths are not defined for almalinux, the upgrade raises the error. When they are, the upgrade is inhibited due to unsupported version.

However please edit the commit message to include that almalinux paths have changed. The other suggestions are just nitpicks.

I can approve then, but probably not merge as we want to prioritize #1438 and merging this would create conflicts.

Comment on lines +166 to +168
details['detail'] = 'This is due to an unsupported system distribution.'
elif source_version not in raw_upgrade_paths:
details['detail'] = 'This is due to an unsupported source version of the system.'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really a problem, but we usually call it details.

Suggested change
details['detail'] = 'This is due to an unsupported system distribution.'
elif source_version not in raw_upgrade_paths:
details['detail'] = 'This is due to an unsupported source version of the system.'
details['details'] = 'This is due to an unsupported system distribution.'
elif source_version not in raw_upgrade_paths:
details['details'] = 'This is due to an unsupported source version of the system.'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants