-
Notifications
You must be signed in to change notification settings - Fork 136
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
Overshadowing mount points in /etc/fstab #1009
Conversation
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.
To launch regression testing public members of oamg organization can leave the following comment:
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 consider rerunning the CI by commenting leapp-ci build (might require several comments). If the problem persists, contact leapp-infra. |
4392771
to
cc869ac
Compare
/rerun |
Copr build succeeded: https://copr.fedorainfracloud.org/coprs/build/5240036 |
Testing Farm request for RHEL-8.6-rhui/5240036 regression testing has been created. |
Testing Farm request for RHEL-7.9-ZStream/5240036 regression testing has been created. |
Testing Farm request for RHEL-7.9-ZStream/5240036 regression testing has been created. |
repos/system_upgrade/common/actors/checkfstabmountorder/libraries/checkfstabmountorder.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/common/actors/checkfstabmountorder/libraries/checkfstabmountorder.py
Outdated
Show resolved
Hide resolved
cc869ac
to
08518bb
Compare
08518bb
to
76deb29
Compare
Added a fixup commit with slight refactoring, which simplifies the actor a bit. |
/rerun |
Copr build succeeded: https://copr.fedorainfracloud.org/coprs/build/5256565 |
Testing Farm request for RHEL-7.9-rhui/5256565 regression testing has been created. |
Testing Farm request for RHEL-8.6-rhui/5256565 regression testing has been created. |
Testing Farm request for RHEL-8.6.0-Nightly/5256565 regression testing has been created. |
Testing Farm request for RHEL-8.7.0-Nightly/5256565 regression testing has been created. |
Testing Farm request for RHEL-7.9-ZStream/5256565 regression testing has been created. |
Testing Farm request for RHEL-7.9-ZStream/5256565 regression testing has been created. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the unit test! Some open questions / comments inline.
repos/system_upgrade/common/actors/checkfstabmountorder/libraries/checkfstabmountorder.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/common/actors/checkfstabmountorder/libraries/checkfstabmountorder.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/common/actors/checkfstabmountorder/libraries/checkfstabmountorder.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/common/actors/checkfstabmountorder/libraries/checkfstabmountorder.py
Show resolved
Hide resolved
repos/system_upgrade/common/actors/checkfstabmountorder/libraries/checkfstabmountorder.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/common/actors/checkfstabmountorder/libraries/checkfstabmountorder.py
Show resolved
Hide resolved
repos/system_upgrade/common/actors/checkfstabmountorder/libraries/checkfstabmountorder.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/common/actors/checkfstabmountorder/libraries/checkfstabmountorder.py
Outdated
Show resolved
Hide resolved
repos/system_upgrade/common/actors/checkfstabmountorder/libraries/checkfstabmountorder.py
Outdated
Show resolved
Hide resolved
f759678
to
3ef0335
Compare
@pirat89 @fernflower I addressed the issues. |
Copr build succeeded: https://copr.fedorainfracloud.org/coprs/build/5309533 |
Testing Farm request for RHEL-8.6-rhui/5309533 regression testing has been created. |
Testing Farm request for RHEL-7.9-rhui/5309533 regression testing has been created. |
Testing Farm request for RHEL-8.6.0-Nightly/5309533 regression testing has been created. |
Testing Farm request for RHEL-8.7.0-Nightly/5309533 regression testing has been created. |
Testing Farm request for RHEL-7.9-ZStream/5309533 regression testing has been created. |
Testing Farm request for RHEL-7.9-ZStream/5309533 regression testing has been created. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All my comments resolved, thanks!
/packit build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PeterMocary Following report is confusing:
Risk Factor: high (inhibitor)
Title: Detected incorrect order of entries or duplicate entries in /etc/fstab, preventing a successful in-place upgrade.
Summary: Leapp detected incorrect /etc/fstab format that causes overshadowing of mount points.
Detected order of overshadowing mount points:
/boot,
Remediation: [hint] To prevent the overshadowing:
Reorder the detected overshadowing entries.
Possible order of all mount points without overshadowing:
, none, /boot
Key: fb07b688331fe65635aec13c2a1cb4e86ca6f4dc
Another confusing report is:
Risk Factor: high (inhibitor)
Title: Detected incorrect order of entries or duplicate entries in /etc/fstab, preventing a successful in-place upgrade.
Summary: Leapp detected incorrect /etc/fstab format that causes overshadowing of mount points.
Detected order of overshadowing mount points:
/boot/efi/foo, /boot/efi, /boot
Remediation: [hint] To prevent the overshadowing:
Reorder the detected overshadowing entries.
Possible order of all mount points without overshadowing:
, none, /boot, /boot/efi, /boot/efi/foo
Key: fb07b688331fe65635aec13c2a1cb4e86ca6f4dc
To reproduce the first one, just switch order of lines with /
and /boot
mountpoints. Here is my sys configuration used for the second report:
root@localhost ~]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Tue Jan 25 12:00:08 2022
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
/dev/mapper/rhel-root / xfs defaults 0 0
/dev/something /boot/efi/foo ext4 defaults 0 0
/dev/something /boot/efi ext4 defaults 0 0
UUID=72847225-0df9-419e-8aed-95f385628f02 /boot xfs defaults 0 0
/dev/mapper/rhel-swap none swap defaults 0 0
[root@localhost ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 252:0 0 20G 0 disk
├─vda1 252:1 0 1G 0 part /boot
└─vda2 252:2 0 19G 0 part
├─rhel-root 253:0 0 17G 0 lvm /
└─rhel-swap 253:1 0 2G 0 lvm [SWAP]
Suggested changes:
- The
rstrip
should be skipped in case of/
(rootfs). - The
none
output is represented by swap that is not mounted anowhere. in case the mountpoint is not an absolute path, it should be ignored. - The intendation is not visible and it's kind of hard to read it. Especially in case of the possible order it's problem. I suggest to use "semi-standardized" way that uses
FMT_LIST_SEPARATOR
like inchecksystemdbrokensymlinks
actor. So the report gets better readability. E.g. something like:
Risk Factor: high (inhibitor)
Title: Detected incorrect order of entries or duplicate entries in /etc/fstab, preventing a successful in-place upgrade.
Summary: Leapp detected incorrect /etc/fstab format that causes overshadowing of mount points.
Detected order of overshadowing mount points:
- /boot/efi/foo
- /boot/efi
- /boot
Remediation: [hint] To prevent the overshadowing:
Reorder the detected overshadowing entries.
Possible order of all mount points without overshadowing:
- /
- /boot
- /boot/efi
- /boot/efi/foo
Key: fb07b688331fe65635aec13c2a1cb4e86ca6f4dc
or you could do simple something like this in case you want to have everything just on one line (but keep in mind that some systems have even tens partitions):
Detected order of overshadowing mount points: /boot/efi/foo, /boot/efi, /boot
in this case even the one line seems good.
- It's visible the hint is not friendly even with the suggestion above. Currently two hints could be possibly produced and it not so helpful to see something like
Remediation: [hint] To prevent the overshadowing:
Remove detected duplicates by using unique mount points.
Reorder the detected overshadowing entries.
Possible order of all mount points without overshadowing:
- /
- /boot
- /boot/efi
- /boot/efi/foo
the output seems mixed in this case. What about doing this?
Remediation: [hint] Remove detected duplicates by using unique mount points. Reorder the detected overshadowing entries. Possible order of all mount points without overshadowing:
- /
- /boot
- /boot/efi
- /boot/efi/foo
in case no duplicates are present, it would look just like this:
Remediation: [hint] Reorder the detected overshadowing entries. Possible order of all mount points without overshadowing:
- /
- /boot
- /boot/efi
- /boot/efi/foo
both seems to me more readable to be honest. Also you could do something like:
Remediation: [hint] To prevent the overshadowing:
* Remove detected duplicates by using unique mount points.
* Reorder the detected overshadowing entries. Possible order of all mount points without overshadowing:
- /
- /boot
- /boot/efi
- /boot/efi/foo
Also think about the presentation of reports in web UI (cockpit, foreman/satellite), where the readability could be also different. So e.g. the last suggestion, with multiple indentations, could be possibly displayed ignoring leading whitespaces / indentation (not 100% sure about that). So the last one is possibly not so safe for the use.
…o prevent overshadowing
336a021
to
623c11e
Compare
Added new fixup commit addressing found issues @pirat89. Thanks for such in depth description! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good to me know! Great job!
Risk Factor: high (inhibitor)
Title: Detected incorrect order of entries or duplicate entries in /etc/fstab, preventing a successful in-place upgrade.
Summary: Leapp detected incorrect /etc/fstab format that causes overshadowing of mount points.
Detected order of overshadowing mount points: /boot/efi/foo, /boot/efi, /boot, /
Remediation: [hint] To prevent the overshadowing: Reorder the detected overshadowing entries. Possible order of all mount points without overshadowing:
- /
- /boot
- /boot/efi
- /boot/efi/foo
Key: fb07b688331fe65635aec13c2a1cb4e86ca6f4dc
/rerun |
Copr build succeeded: https://copr.fedorainfracloud.org/coprs/build/5537791 |
Testing Farm request for RHEL-7.9-rhui/5537791 regression testing has been created. |
Testing Farm request for RHEL-8.6-rhui/5537791 regression testing has been created. |
Testing Farm request for RHEL-8.6.0-Nightly/5537791 regression testing has been created. |
Testing Farm request for RHEL-8.7.0-Nightly/5537791 regression testing has been created. |
Testing Farm request for RHEL-7.9-ZStream/5537791 regression testing has been created. |
Testing Farm request for RHEL-7.9-ZStream/5537791 regression testing has been created. |
## Packaging - Requires cpio (oamg#979) - Requires python3-gobject-base, NetworkManager-libnm (oamg#969) - Bump leapp-repository-dependencies to 9 (oamg#969, oamg#979) ## Upgrade handling ### Fixes - Add leapp RHUI packages to an allowlist to drop confusing reports (oamg#995) - Check only mounted XFS partitions (oamg#1027) - Detect the kernel-core RPM instead of kernel to prevent an error during post-upgrade phases (oamg#1024) - Disable the amazon-id DNF plugin on AWS during the upgrade stage to omit error messages during the upgrade process caused by missing network connection (oamg#990) - Do not create new *pyc files when running leapp after the DNF upgrade transaction (oamg#1017) - Enable upgrades on s390x when /boot is part of rootfs (oamg#991) - Extend the allow list of RHUI clients by azure-sap-apps to omit confusing report (oamg#974) - Filter out PES events unrelated for the used upgrade path and handle overlapping events (oamg#1008) - Fix scan of ceph volumes on systems without ceph-osd (oamg#1011) - Fix scan of ceph volumes when ceph-osd container is not found (oamg#986) - Fix systemd symlinks that become incorrect during the IPU (oamg#972) - Fix the check of memory (RAM) limits (oamg#984) - Fix the upgrade of IBM Z machines configured with ZFCP (oamg#983) - Ignore external accounts in /etc/passwd (oamg#958) - Inhibit the upgrade when entries in /etc/fstab cause overshadowing during the upgrade (oamg#1009) - Prevent leapp failures caused by re-run of leapp in the upgrade initramfs after previous failure, which causes additional confusing error message hiding original bugs (oamg#996) - Prevent the upgrade with RHSM when a baseos and an appstream target repositories are not discovered (oamg#1001) - RHUI(Azure) handle correctly various SAP images (oamg#1037) - Rework the network configuration handling and parse the configuration data properly (oamg#969) - Set RHSM release for non-ga and non-beta channels (oamg#1033) - Use the "grub" library to find the GRUB device (oamg#989) - [IPU 7 -> 8] Detect corrupted grubenv file (oamg#1012) - [IPU 7 -> 8] Ensure that rsyncd stays enabled if it is enabled prior the upgrade(oamg#1043) - [IPU 7 -> 8] Ensure that satellite metapackages are installed after the upgrade (oamg#994) - [IPU 7 -> 8] Ensure the device_cio_free service stays enabled on s390x after the upgrade (oamg#977) - [IPU 7 -> 8] Fixed checks for RHEL SAP IPU 7.9 -> 8.6 (oamg#978) - [IPU 7 -> 8] Fixed migration of ntp to chrony when the ntp service is masked (oamg#966) - [IPU 7 -> 8] Prevent the traceback during migration of sendmail configuration files when the package is not installed (oamg#1041) - [IPU 7 -> 8] Satellite: reindex all related databases to fix issues due to new locales in RHEL 8 (oamg#1007, oamg#1018) - [IPU 7 -> 8] Use the correct domain name in SSSD reports (oamg#1040) - [IPU 8 -> 9] Added checks for RHEL SAP IPU 8.6 -> 9.0 (oamg#978) - [IPU 8 -> 9] CheckVDO: Ask user for the confirmation only on failures and undetermined devices (oamg#961) - [IPU 8 -> 9] Fix the kernel detection during initramfs creation for new kernel on RHEL 9.2+ (oamg#1048) - [IPU 8 -> 9] Fix the upgrade on Azure using RHUI for SAP Apps images (oamg#975) - [IPU 8 -> 9] Handle correctly firewalld version 0.8 (oamg#963) ### Enhancements - Set new upgrade paths (oamg#988): -- RHEL 7.9 -> 8.8, 8.6 (default: 8.8) -- RHEL 8.6 -> 9.0 -- RHEL 8.8 -> 9.2 - Check that used leapp data are valid and compatible with the installed leapp-repository (oamg#1003) - Detect a proxy configuration in YUM/DNF and adjust an error msg on issues caused by the configuration (oamg#914) - Detect and report systemd symlinks that are broken before the upgrade (oamg#972) - Drop obsoleted upgrade paths (oamg#1047) - Improve remediation instructions for packages in unknown repositories (oamg#1010) - Improve the error message to guide users when discovered more space is needed (oamg#956) - Introduce --nogpgcheck option to skip checking of RPM signatures (oamg#910) - Introduced an option to use an ISO file as a target RHEL version content source (oamg#979) - Introduced possibility to specify what systemd services should be enabled/disabled on the upgraded system (oamg#964) - Map the target repositories also based on the installed content (oamg#967) - Provide common information about systemd services (oamg#959) - Register subscribed systems automatically to Red Hat Insights unless --no-insights-register is used (oamg#1000) - Remove obsoleted GPG keys provided by RH after the upgrade to prevent errors (oamg#1022) - Run upgrade process with checking RPM signatures by default (oamg#910, oamg#993, oamg#1025) - Save breadcrumbs results as RHSM facts (oamg#1002) - Small improvements in various reports (oamg#1038, oamg#1039, oamg#1032) - [IPU 8 -> 9] Detect CIFS also when upgrading from RHEL8 to RHEL9 (PR1035) - [IPU 8 -> 9] Detect RoCE on IBM Z machines and check the configuration is safe for the upgrade (oamg#1030) - [IPU 8 -> 9] Enable upgrades of RHEL 8 for SAP HANA to RHEL 9 on ppc64le (oamg#1042) - [IPU 8 -> 9] Improve the handling of blocklisted certificates (oamg#992) ## Additional changes interesting for devels - Started work on bringing up networking inside the upgrade initramfs - currently available for testing and development purposes when LEAPP_DEVEL_INITRAM_NETWORK is set (oamg#960) - Add leapp debug tools to the upgrade initramfs - dracut upgrade module (oamg#997) - Enable disabling of DNF plugins in the dnfplugin library (oamg#990)
## Packaging - Requires cpio (#979) - Requires python3-gobject-base, NetworkManager-libnm (#969) - Bump leapp-repository-dependencies to 9 (#969, #979) ## Upgrade handling ### Fixes - Add leapp RHUI packages to an allowlist to drop confusing reports (#995) - Check only mounted XFS partitions (#1027) - Detect the kernel-core RPM instead of kernel to prevent an error during post-upgrade phases (#1024) - Disable the amazon-id DNF plugin on AWS during the upgrade stage to omit error messages during the upgrade process caused by missing network connection (#990) - Do not create new *pyc files when running leapp after the DNF upgrade transaction (#1017) - Enable upgrades on s390x when /boot is part of rootfs (#991) - Extend the allow list of RHUI clients by azure-sap-apps to omit confusing report (#974) - Filter out PES events unrelated for the used upgrade path and handle overlapping events (#1008) - Fix scan of ceph volumes on systems without ceph-osd (#1011) - Fix scan of ceph volumes when ceph-osd container is not found (#986) - Fix systemd symlinks that become incorrect during the IPU (#972) - Fix the check of memory (RAM) limits (#984) - Fix the upgrade of IBM Z machines configured with ZFCP (#983) - Ignore external accounts in /etc/passwd (#958) - Inhibit the upgrade when entries in /etc/fstab cause overshadowing during the upgrade (#1009) - Prevent leapp failures caused by re-run of leapp in the upgrade initramfs after previous failure, which causes additional confusing error message hiding original bugs (#996) - Prevent the upgrade with RHSM when a baseos and an appstream target repositories are not discovered (#1001) - RHUI(Azure) handle correctly various SAP images (#1037) - Rework the network configuration handling and parse the configuration data properly (#969) - Set RHSM release for non-ga and non-beta channels (#1033) - Use the "grub" library to find the GRUB device (#989) - [IPU 7 -> 8] Detect corrupted grubenv file (#1012) - [IPU 7 -> 8] Ensure that rsyncd stays enabled if it is enabled prior the upgrade(#1043) - [IPU 7 -> 8] Ensure that satellite metapackages are installed after the upgrade (#994) - [IPU 7 -> 8] Ensure the device_cio_free service stays enabled on s390x after the upgrade (#977) - [IPU 7 -> 8] Fixed checks for RHEL SAP IPU 7.9 -> 8.6 (#978) - [IPU 7 -> 8] Fixed migration of ntp to chrony when the ntp service is masked (#966) - [IPU 7 -> 8] Prevent the traceback during migration of sendmail configuration files when the package is not installed (#1041) - [IPU 7 -> 8] Satellite: reindex all related databases to fix issues due to new locales in RHEL 8 (#1007, #1018) - [IPU 7 -> 8] Use the correct domain name in SSSD reports (#1040) - [IPU 8 -> 9] Added checks for RHEL SAP IPU 8.6 -> 9.0 (#978) - [IPU 8 -> 9] CheckVDO: Ask user for the confirmation only on failures and undetermined devices (#961) - [IPU 8 -> 9] Fix the kernel detection during initramfs creation for new kernel on RHEL 9.2+ (#1048) - [IPU 8 -> 9] Fix the upgrade on Azure using RHUI for SAP Apps images (#975) - [IPU 8 -> 9] Handle correctly firewalld version 0.8 (#963) ### Enhancements - Set new upgrade paths (#988): -- RHEL 7.9 -> 8.8, 8.6 (default: 8.8) -- RHEL 8.6 -> 9.0 -- RHEL 8.8 -> 9.2 - Check that used leapp data are valid and compatible with the installed leapp-repository (#1003) - Detect a proxy configuration in YUM/DNF and adjust an error msg on issues caused by the configuration (#914) - Detect and report systemd symlinks that are broken before the upgrade (#972) - Drop obsoleted upgrade paths (#1047) - Improve remediation instructions for packages in unknown repositories (#1010) - Improve the error message to guide users when discovered more space is needed (#956) - Introduce --nogpgcheck option to skip checking of RPM signatures (#910) - Introduced an option to use an ISO file as a target RHEL version content source (#979) - Introduced possibility to specify what systemd services should be enabled/disabled on the upgraded system (#964) - Map the target repositories also based on the installed content (#967) - Provide common information about systemd services (#959) - Register subscribed systems automatically to Red Hat Insights unless --no-insights-register is used (#1000) - Remove obsoleted GPG keys provided by RH after the upgrade to prevent errors (#1022) - Run upgrade process with checking RPM signatures by default (#910, #993, #1025) - Save breadcrumbs results as RHSM facts (#1002) - Small improvements in various reports (#1038, #1039, #1032) - [IPU 8 -> 9] Detect CIFS also when upgrading from RHEL8 to RHEL9 (PR1035) - [IPU 8 -> 9] Detect RoCE on IBM Z machines and check the configuration is safe for the upgrade (#1030) - [IPU 8 -> 9] Enable upgrades of RHEL 8 for SAP HANA to RHEL 9 on ppc64le (#1042) - [IPU 8 -> 9] Improve the handling of blocklisted certificates (#992) ## Additional changes interesting for devels - Started work on bringing up networking inside the upgrade initramfs - currently available for testing and development purposes when LEAPP_DEVEL_INITRAM_NETWORK is set (#960) - Add leapp debug tools to the upgrade initramfs - dracut upgrade module (#997) - Enable disabling of DNF plugins in the dnfplugin library (#990)
Checks the order of entries in /etc/fstab based on their mount point and inhibits upgrade if overshadowing is detected.
Jira ref.: OAMG#5090
Bugzilla: BZ#1972238