Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updategrubcore: Skip on IBM Z systems and cover non-grub2 systems in general #1117

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

pirat89
Copy link
Member

@pirat89 pirat89 commented Aug 21, 2023

As GRUB2 is not present on IBM Z, related commands cannot be used on this architecture as they just fail (as the executors are not present). In this particular case, logs contain a confusing traceback msg, which is not harmful, but it's not nice niether. Added check for s390x architecture.

Note that similar problem could possibly appear on baremetal POWER machines, where petitboot is used. After the fix of the leapp run functions from the stdlib, catch also OSError exception. In such a case, print info the grub2-core is not present with the hint that's most likely it should not be even called on the particular machine and the actor execution too.

Suppress deprecated warnings in unit tests for get_grub_device() tests.

Additional info

Previous runs could provide errors like:

2023-08-17 13:02:25.757 DEBUG    PID: 12623 leapp.workflow.RPMUpgrade.update_grub_core: External command has started: ['grub2-probe', '--target=device', '/boot']
2023-08-17 13:02:25.769 DEBUG    PID: 12631 leapp.workflow.RPMUpgrade.update_grub_core: External command has finished: ['grub2-probe', '--target=device', '/boot']
2023-08-17 13:02:25.773 DEBUG    PID: 12623 leapp.workflow.RPMUpgrade.update_grub_core: Process Process-193:
2023-08-17 13:02:25.777 DEBUG    PID: 12623 leapp.workflow.RPMUpgrade.update_grub_core: Traceback (most recent call last):
2023-08-17 13:02:25.780 DEBUG    PID: 12623 leapp.workflow.RPMUpgrade.update_grub_core:   File "/usr/lib64/python3.6/multiprocessing/process.py", line 258, in _bootstrap
2023-08-17 13:02:25.785 DEBUG    PID: 12623 leapp.workflow.RPMUpgrade.update_grub_core:   File "/usr/lib64/python3.6/multiprocessing/process.py", line 93, in run 
2023-08-17 13:02:25.788 DEBUG    PID: 12623 leapp.workflow.RPMUpgrade.update_grub_core:   File "/usr/lib/python3.6/site-packages/leapp/repository/actor_definition.py", line 74, in _do_run
2023-08-17 13:02:25.792 DEBUG    PID: 12623 leapp.workflow.RPMUpgrade.update_grub_core:     actor_instance.run(*args, **kwargs)
2023-08-17 13:02:25.795 DEBUG    PID: 12623 leapp.workflow.RPMUpgrade.update_grub_core:   File "/usr/lib/python3.6/site-packages/leapp/actors/__init__.py", line 289, in run
2023-08-17 13:02:25.797 DEBUG    PID: 12623 leapp.workflow.RPMUpgrade.update_grub_core:     self.process(*args)
2023-08-17 13:02:25.800 DEBUG    PID: 12623 leapp.workflow.RPMUpgrade.update_grub_core:   File "/etc/leapp/repos.d/system_upgrade/common/actors/updategrubcore/actor.py", line 24, in process
2023-08-17 13:02:25.803 DEBUG    PID: 12623 leapp.workflow.RPMUpgrade.update_grub_core:     grub_devs = grub.get_grub_devices()
2023-08-17 13:02:25.806 DEBUG    PID: 12623 leapp.workflow.RPMUpgrade.update_grub_core:   File "/etc/leapp/repos.d/system_upgrade/common/libraries/grub.py", line 73, in get_grub_devices
2023-08-17 13:02:25.809 DEBUG    PID: 12623 leapp.workflow.RPMUpgrade.update_grub_core:     boot_device = get_boot_partition()
2023-08-17 13:02:25.812 DEBUG    PID: 12623 leapp.workflow.RPMUpgrade.update_grub_core:   File "/etc/leapp/repos.d/system_upgrade/common/libraries/grub.py", line 53, in get_boot_partition
2023-08-17 13:02:25.814 DEBUG    PID: 12623 leapp.workflow.RPMUpgrade.update_grub_core:     result = run(['grub2-probe', '--target=device', '/boot'])
2023-08-17 13:02:25.817 DEBUG    PID: 12623 leapp.workflow.RPMUpgrade.update_grub_core:   File "/usr/lib/python3.6/site-packages/leapp/libraries/stdlib/__init__.py", line 181, in run
2023-08-17 13:02:25.820 DEBUG    PID: 12623 leapp.workflow.RPMUpgrade.update_grub_core:     stdin=stdin, env=env, encoding=encoding)
2023-08-17 13:02:25.823 DEBUG    PID: 12623 leapp.workflow.RPMUpgrade.update_grub_core:   File "/usr/lib/python3.6/site-packages/leapp/libraries/stdlib/call.py", line 217, in _call
2023-08-17 13:02:25.827 DEBUG    PID: 12623 leapp.workflow.RPMUpgrade.update_grub_core:     os.execvpe(command[0], command, env=environ)
2023-08-17 13:02:25.830 DEBUG    PID: 12623 leapp.workflow.RPMUpgrade.update_grub_core:   File "/usr/lib64/python3.6/os.py", line 568, in execvpe
2023-08-17 13:02:25.833 DEBUG    PID: 12623 leapp.workflow.RPMUpgrade.update_grub_core:   File "/usr/lib64/python3.6/os.py", line 604, in _execvpe
2023-08-17 13:02:25.836 DEBUG    PID: 12623 leapp.workflow.RPMUpgrade.update_grub_core:   File "/usr/lib64/python3.6/os.py", line 594, in _execvpe
2023-08-17 13:02:25.839 DEBUG    PID: 12623 leapp.workflow.RPMUpgrade.update_grub_core: FileNotFoundError: [Errno 2] No such file or directory: b'/etc/leapp/repos.d/system_upgrade/el8toel9/tools/grub2-probe'
2023-08-17 13:02:25.842 DEBUG    PID: 12623 leapp.workflow.RPMUpgrade.update_grub_core: Command ['grub2-probe', '--target=device', '/boot'] failed with exit code 1.
2023-08-17 13:02:25.847 DEBUG    PID: 12623 leapp.workflow.RPMUpgrade.update_grub_core: External command has finished: ['grub2-probe', '--target=device', '/boot'] 
2023-08-17 13:02:25.851 WARNING  PID: 12623 leapp.workflow.RPMUpgrade.update_grub_core: Could not get name of underlying /boot partition

@pirat89 pirat89 added the bug Something isn't working label Aug 21, 2023
@pirat89 pirat89 added this to the 8.9/9.3 milestone Aug 21, 2023
@github-actions
Copy link

Thank you for contributing to the Leapp project!

Please note that every PR needs to comply with the Leapp 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. If you need a different version of leapp from PR#42, use /packit test oamg/leapp#42

To launch regression testing public members of oamg organization can leave the following comment:

  • /rerun to schedule basic regression tests using this pr build and latest upstream leapp build as artifacts
  • /rerun 42 to schedule basic regression tests using this pr build and leapp*PR42* as artifacts
  • /rerun-sst to schedule sst tests using this pr build and latest upstream leapp build as artifacts
  • /rerun-sst 42 to schedule sst tests using this pr build and leapp*PR42* as artifacts

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 requested a review from a team August 21, 2023 15:01
@pirat89 pirat89 force-pushed the skip-grubupdate-s390x branch 2 times, most recently from 04e38cb to 631df1e Compare August 21, 2023 15:09
As GRUB2 is not present on IBM Z, related commands cannot be used
on this architecture as they just fail (as the executors are not
present). In this particular case, logs contain a confusing traceback
msg, which is not harmful, but it's not nice niether. Added check
for s390x architecture.

Note that similar problem could possibly appear on baremetal POWER machines,
where petitboot is used. After the fix of the leapp run functions
from the stdlib, catch also OSError exception. In such a case, print
info the grub2-core is not present with the hint that's most likely
it should not be even called on the particular machine and and the
actor execution too.

Suppress deprecated warnings in unit tests for get_grub_device() tests.
@pirat89 pirat89 changed the title updategrubcore: Skip on IBM Z to omit confusing report updategrubcore: Skip on IBM Z and non-grub2 systems to omit confusing report Aug 21, 2023
@pirat89 pirat89 changed the title updategrubcore: Skip on IBM Z and non-grub2 systems to omit confusing report updategrubcore: Skip on IBM Z systems and cover non-grub2 systems in general Aug 21, 2023
@Rezney Rezney merged commit 30f358a into oamg:master Aug 22, 2023
12 of 15 checks passed
@pirat89 pirat89 added the changelog-checked The merger/reviewer checked the changelog draft document and updated it when relevant label Aug 22, 2023
pirat89 added a commit to pirat89/leapp-repository that referenced this pull request Aug 23, 2023
## Packaging
- Requires leapp-framework 5.0

## Upgrade handling
### Fixes
- Add el8toel9 actor to handle directory -> symlink with ruby IRB. (oamg#1076)
- Do not try to update GRUB core on IBM Z systems (oamg#1117)
- Fix failing upgrades with devtmpfs file systems specified in FSTAB (oamg#1090)
- Fix the calculation of the required free space on each partitions/volume for the upgrade transactions (oamg#1097)
- Fix the generation of the report about hybrid images (oamg#1064)
- Handle correctly the installed certificates to allow upgrades with custom repositories using HTTPs with enabled SSL verification (oamg#1106)
- Minor improvements and fixes of various reports (oamg#1066, oamg#1067, oamg#1085)
- Update error messages about leapp data files to inform user how to obtain valid data files (oamg#1121)
- Update links in various reports (oamg#1062, oamg#1086)
- Update the repomap data to cover changed repoids in RHUI Azure (oamg#1087)
- [IPU 7 -> 8] Fix false positive report about invalid symlinks on RHEL 7 (oamg#1052)
- [IPU 8 -> 9] Inhibit the upgrade when unsupported x86-64 microarchitecture is detected (oamg#1059)

### Enhancements
- Include updated leapp data files in the RPM (oamg#1046, oamg#1092, oamg#1119)
- Update the set of supported upgrade paths (oamg#1077):
  - RHEL with SAP HANA 7.9 -> 8.6, 8.8 (default: 8.6)
  - RHEL with SAP HANA 8.8 -> 9.2
- Introduce new upgrade paths:
  - RHEL 7.9 -> 8.9 (default)
  - RHEL 8.9 -> 9.3
- Correctly update grub2 when /boot resides on multiple devices aggregated in RAID (oamg#1093, oamg#1115)
- Enable upgrades for machines using RHUI on AlibabaCloud (oamg#1088)
- Introduce possibility to add kernel drivers to initramfs (oamg#1081)
- Redesign handling of information about kernel (booted and target) in preparation for new changes in RHEL 9 (oamg#1107)
- Redesign source system overlay to use disk images backed by sparse files to optimize disk space consumption (oamg#1097, oamg#1103)
- Requires leapp-framework 5.0 (oamg#1061, oamg#1116)
- Use new leapp CLI API which provides better report summary output (oamg#1061, oamg#1116)
- [IPU 8 -> 9] Detect and report use of deprecated Xorg drivers (oamg#1078)
- [IPU 8 -> 9] Introduce IPU for systems with FIPS enabled (oamg#1053)

## Additional changes interesting for devels
- Deprecated `GrubInfo.orig_device_name` field in the `GrubInfo` model (replaced by `GrubInfo.orig_devices`) (oamg#1093)
- Deprecated `InstalledTargetKernelVersion` model (replaced by `InstalledTargetKernelInfo`) (oamg#1107)
- Deprecated `leapp.libraries.common.config.version.is_rhel_realtime` (check the type in msg `KernelInfo`, field `type`) (oamg#1107)
- Deprecated `leapp.libraries.common.grub.get_grub_device()` (replaced by `leapp.libraries.common.grub.get_grub_devices()`) (oamg#1093)
- Introduced new devel envar LEAPP_DEVEL_KEEP_DISK_IMGS=1 to skip the removal of the created disk images for OVL. That's sometimes handy for the debugging. (oamg#1097)
@pirat89 pirat89 mentioned this pull request Aug 23, 2023
Rezney pushed a commit that referenced this pull request Aug 23, 2023
## Packaging
- Requires leapp-framework 5.0

## Upgrade handling
### Fixes
- Add el8toel9 actor to handle directory -> symlink with ruby IRB. (#1076)
- Do not try to update GRUB core on IBM Z systems (#1117)
- Fix failing upgrades with devtmpfs file systems specified in FSTAB (#1090)
- Fix the calculation of the required free space on each partitions/volume for the upgrade transactions (#1097)
- Fix the generation of the report about hybrid images (#1064)
- Handle correctly the installed certificates to allow upgrades with custom repositories using HTTPs with enabled SSL verification (#1106)
- Minor improvements and fixes of various reports (#1066, #1067, #1085)
- Update error messages about leapp data files to inform user how to obtain valid data files (#1121)
- Update links in various reports (#1062, #1086)
- Update the repomap data to cover changed repoids in RHUI Azure (#1087)
- [IPU 7 -> 8] Fix false positive report about invalid symlinks on RHEL 7 (#1052)
- [IPU 8 -> 9] Inhibit the upgrade when unsupported x86-64 microarchitecture is detected (#1059)

### Enhancements
- Include updated leapp data files in the RPM (#1046, #1092, #1119)
- Update the set of supported upgrade paths (#1077):
  - RHEL with SAP HANA 7.9 -> 8.6, 8.8 (default: 8.6)
  - RHEL with SAP HANA 8.8 -> 9.2
- Introduce new upgrade paths:
  - RHEL 7.9 -> 8.9 (default)
  - RHEL 8.9 -> 9.3
- Correctly update grub2 when /boot resides on multiple devices aggregated in RAID (#1093, #1115)
- Enable upgrades for machines using RHUI on AlibabaCloud (#1088)
- Introduce possibility to add kernel drivers to initramfs (#1081)
- Redesign handling of information about kernel (booted and target) in preparation for new changes in RHEL 9 (#1107)
- Redesign source system overlay to use disk images backed by sparse files to optimize disk space consumption (#1097, #1103)
- Requires leapp-framework 5.0 (#1061, #1116)
- Use new leapp CLI API which provides better report summary output (#1061, #1116)
- [IPU 8 -> 9] Detect and report use of deprecated Xorg drivers (#1078)
- [IPU 8 -> 9] Introduce IPU for systems with FIPS enabled (#1053)

## Additional changes interesting for devels
- Deprecated `GrubInfo.orig_device_name` field in the `GrubInfo` model (replaced by `GrubInfo.orig_devices`) (#1093)
- Deprecated `InstalledTargetKernelVersion` model (replaced by `InstalledTargetKernelInfo`) (#1107)
- Deprecated `leapp.libraries.common.config.version.is_rhel_realtime` (check the type in msg `KernelInfo`, field `type`) (#1107)
- Deprecated `leapp.libraries.common.grub.get_grub_device()` (replaced by `leapp.libraries.common.grub.get_grub_devices()`) (#1093)
- Introduced new devel envar LEAPP_DEVEL_KEEP_DISK_IMGS=1 to skip the removal of the created disk images for OVL. That's sometimes handy for the debugging. (#1097)
@pirat89 pirat89 deleted the skip-grubupdate-s390x branch February 19, 2024 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working changelog-checked The merger/reviewer checked the changelog draft document and updated it when relevant
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants