Bug 1969978
| Summary: | leapp fails while copying /etc/pki with broken relative symlinks | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Christophe Besson <cbesson> |
| Component: | leapp-repository | Assignee: | Leapp Notifications Bot <leapp-notifications-bot> |
| Status: | NEW --- | QA Contact: | upgrades-and-conversions |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | 7.9 | CC: | fkrska, kkinge |
| Target Milestone: | rc | Keywords: | Reproducer |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | Type: | Bug | |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1818088 | ||
Description of problem: During the leapp upgrade, customer reported the following issue: Traceback (most recent call last): File "/usr/lib64/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/usr/lib64/python2.7/multiprocessing/process.py", line 114, in run self._target(*self._args, **self._kwargs) File "/usr/lib/python2.7/site-packages/leapp/repository/actor_definition.py", line 72, in _do_run actor_instance.run(*args, **kwargs) File "/usr/lib/python2.7/site-packages/leapp/actors/__init__.py", line 335, in run self.process(*args) File "/usr/lib/python2.7/site-packages/leapp/utils/deprecation.py", line 42, in process_wrapper return target_item(*args, **kwargs) File "/usr/share/leapp-repository/repositories/system_upgrade/el7toel8/actors/targetuserspacecreator/actor.py", line 43, in process userspacegen.perform() File "/usr/share/leapp-repository/repositories/system_upgrade/el7toel8/actors/targetuserspacecreator/libraries/userspacegen.py", line 478, in perform _create_target_userspace(context, indata.packages, target_repoids) File "/usr/share/leapp-repository/repositories/system_upgrade/el7toel8/actors/targetuserspacecreator/libraries/userspacegen.py", line 457, in _create_target_userspace _prep_repository_access(context, constants.TARGET_USERSPACE) File "/usr/share/leapp-repository/repositories/system_upgrade/el7toel8/actors/targetuserspacecreator/libraries/userspacegen.py", line 144, in _prep_repository_access context.copytree_from('/etc/pki', os.path.join(target_userspace, 'etc', 'pki')) File "/usr/share/leapp-repository/repositories/system_upgrade/el7toel8/libraries/mounting.py", line 198, in copytree_from shutil.copytree(self.full_path(src), dst) File "/usr/lib64/python2.7/shutil.py", line 208, in copytree raise Error, errors Error: [('/var/lib/leapp/scratch/mounts/root_/system_overlay/etc/pki/tls/certs/57dcc1cc.0', '/var/lib/leapp/el8userspace/etc/pki/tls/certs/57dcc1cc.0', "[Errno 2] No such file or directory: '/var/lib/leapp/scratch/mounts/root_/system_overlay/etc/pki/tls/certs/57dcc1cc.0'"), ('/var/lib/leapp/scratch/mounts/root_/system_overlay/etc/pki/pulp/content/e097f848.r0', '/var/lib/leapp/el8userspace/etc/pki/pulp/content/e097f848.r0', "[Errno 2] No such file or directory: '/var/lib/leapp/scratch/mounts/root_/system_overlay/etc/pki/pulp/content/e097f848.r0'"), ('/var/lib/leapp/scratch/mounts/root_/system_overlay/etc/pki/pulp/content/pulp-global-repo.ca', '/var/lib/leapp/el8userspace/etc/pki/pulp/content/pulp-global-repo.ca', "[Errno 2] No such file or directory: '/var/lib/leapp/scratch/mounts/root_/system_overlay/etc/pki/pulp/content/pulp-global-repo.ca'")] As per the `ls -lR /etc/pki` output, the following relative symlinks are broken: /etc/pki/pulp/content: total 0 lrwxrwxrwx. 1 root root 36 May 29 2018 e097f848.r0 -> /var/lib/candlepin/candlepin-crl.crl lrwxrwxrwx. 1 root root 20 May 29 2018 pulp-global-repo.ca -> /etc/pki/pulp/ca.crt /etc/pki/tls/certs: total 48 lrwxrwxrwx. 1 root root 29 May 15 2017 57dcc1cc.0 -> subscriptionrhsmredhatcom.pem Version-Release number of selected component (if applicable): leapp-repository-0.14.0-4.el7_9 How reproducible: 100% Steps to Reproduce: # mkdir -p /etc/pki/pulp/content # cd /etc/pki/pulp/content # ln -s ../ca.crt pulp-global-repo.ca # ls /etc/pki/pulp/ca.crt ls: cannot access /etc/pki/pulp/ca.crt: No such file or directory # leapp upgrade Actual results: Python traceback above Expected results: No traceback, content of /etc/pki copied into the "target userspace", possibly a check similar to the workaround I suggested (see below). Additional info: * I'm unable to reproduce this issue with an absolute symlink like this one: "e097f848.r0 -> /var/lib/candlepin/candlepin-crl.crl" (where the latter doesn't exist) => In this case, the upgrade is inhibited with "Upgrade requires links in root directory to be relative" * Suggested workaround (awaiting for the feedback) # find /etc/{pki,rhsm} -type l ! -exec test -e {} \; -print | xargs rm -fv