AlmaLinux / leapp-data

ELevate related data
https://almalinux.org/elevate/
Apache License 2.0
11 stars 21 forks source link

Conversion fails if there are misleading links in /etc/leapp/repos.d #98

Open SandakovMM opened 1 week ago

SandakovMM commented 1 week ago

Hello. I encountered an issue while converting one of the instances. When I initiated leapp preupgrade, it failed with the following error:

2024-09-04 19:06:28,395 - INFO - ============================================================
2024-09-04 19:06:28,395 - INFO - 2024-09-04 19:06:26.563154 [ERROR] Actor: dnf_transaction_check
2024-09-04 19:06:28,395 - INFO - Message: Failed to execute script to apply transaction workaround yum config fix. Message: Command ['systemd-nspawn', '-register=no', 'quiet', '-D', u'/var/lib/leapp/scratch/mounts/root_/system_overlay', 'setenv=LEAPP_OVL_SIZE=4096', 'setenv=LEAPP_UPGRADE_PATH_TARGET_RELEASE=8.9', 'setenv=LEAPP_NO_RHSM=0', 'setenv=LEAPP_EXPERIMENTAL=0', 'setenv=LEAPP_UPGRADE_PATH_FLAVOUR=default', 'setenv=LEAPP_COMMON_TOOLS=:/etc/leapp/repos.d/system_upgrade;66d7e0d7/common/tools:/etc/leapp/repos.d/system_upgrade;66d7e0d7/el7toel8/tools', 'setenv=LEAPP_COMMON_FILES=:/etc/leapp/repos.d/system_upgrade;66d7e0d7/common/files:/etc/leapp/repos.d/system_upgrade;66d7e0d7/el7toel8/files', 'setenv=LEAPP_IPU_IN_PROGRESS=7to8', 'setenv=LEAPP_UNSUPPORTED=0', 'setenv=LEAPP_EXECUTION_ID=b5a24ee8-ba5b-46b2-bf0e-0dd6e78cdbe9', '-setenv=LEAPP_HOSTNAME=newvps.skyevents.biz', '/bin/bash', '-c', u'/etc/leapp/repos.d/system_upgrade;66d7e0d7/el7toel8/tools/handleyumconfig'] failed with exit code 127.
2024-09-04 19:06:28,395 - INFO - ============================================================
2024-09-04 19:06:28,395 - INFO - END OF ERRORS
2024-09-04 19:06:28,395 - INFO - ============================================================
2024-09-04 19:06:28,395 - INFO - Debug output written to /var/log/leapp/leapp-preupgrade.log
2024-09-04 19:06:28,395 - INFO - ============================================================
2024-09-04 19:06:28,395 - INFO - REPORT OVERVIEW
2024-09-04 19:06:28,396 - INFO - ============================================================
2024-09-04 19:06:28,396 - INFO - Following errors occurred and the upgrade cannot continue:
2024-09-04 19:06:28,396 - INFO - 1. Actor: dnf_transaction_check
2024-09-04 19:06:28,396 - INFO - Message: Failed to execute script to apply transaction workaround yum config fix. Message: Command ['systemd-nspawn', '-register=no', 'quiet', '-D', u'/var/lib/leapp/scratch/mounts/root_/system_overlay', 'setenv=LEAPP_OVL_SIZE=4096', 'setenv=LEAPP_UPGRADE_PATH_TARGET_RELEASE=8.9', 'setenv=LEAPP_NO_RHSM=0', 'setenv=LEAPP_EXPERIMENTAL=0', 'setenv=LEAPP_UPGRADE_PATH_FLAVOUR=default', 'setenv=LEAPP_COMMON_TOOLS=:/etc/leapp/repos.d/system_upgrade;66d7e0d7/common/tools:/etc/leapp/repos.d/system_upgrade;66d7e0d7/el7toel8/tools', 'setenv=LEAPP_COMMON_FILES=:/etc/leapp/repos.d/system_upgrade;66d7e0d7/common/files:/etc/leapp/repos.d/system_upgrade;66d7e0d7/el7toel8/files', 'setenv=LEAPP_IPU_IN_PROGRESS=7to8', 'setenv=LEAPP_UNSUPPORTED=0', 'setenv=LEAPP_EXECUTION_ID=b5a24ee8-ba5b-46b2-bf0e-0dd6e78cdbe9', '-setenv=LEAPP_HOSTNAME=newvps.skyevents.biz', '/bin/bash', '-c', u'/etc/leapp/repos.d/system_upgrade;66d7e0d7/el7toel8/tools/handleyumconfig'] failed with exit code 127.
2024-09-04 19:06:28,396 - INFO - HIGH and MEDIUM severity reports:

After a brief investigation, I noticed that leapp uses /etc/leapp/repos.d/system_upgrade;66d7e0d7/ instead of /etc/leapp/repos.d/system_upgrade. I removed the link and reinstalled leapp packages, and now both leapp preupgrade and leapp upgrade work fine.

I am not sure why /etc/leapp/repos.d/system_upgrade;66d7e0d7 was created initially. Unfortunately, all traces seem to be lost. However, it might be worthwhile to ensure the dnf workaround works for such paths. Also, if you have any ideas to prevent the creation of such links, I would be grateful to hear them.