Description of problem: The rootfs of 4.2 ISO is having a dangling symlink on the "/etc/redhat-access-insights/machine-id" file. === mount usr/share/redhat-virtualization-host/image/redhat-virtualization-host-4.2-20181026.0.el7_6.squashfs.img squashfs mount squashfs/LiveOS/rootfs.img rootfs ls -l rootfs/etc/redhat-access-insights/machine-id lrwxrwxrwx. 1 root root 31 Oct 26 12:15 rootfs/etc/redhat-access-insights/machine-id -> /etc/insights-client/machine-id ls -l rootfs/etc/insights-client/machine-id ls: cannot access 'rootfs/etc/insights-client/machine-id': No such file or directory === From 7.5, redhat-access-insights is being deprecated and has been replaced with insights-client. Refer https://access.redhat.com/articles/3405441. So the 4.2 ISO will be having insights-client and 4.1 is having redhat-access-insights. The 4.1 is not having this symlink because it's having redhat-access-insights package. === ls -l /etc/redhat-access-insights/machine-id -rw-r--r--. 1 root root 36 Dec 7 2017 /etc/redhat-access-insights/machine-id === Now when we do the upgrade, the imgbased will try to copy the /etc/redhat-access-insights/machine-id from 4.1 to 4.2 and it will fail with the error below since destination file is a dangling symlink. ==== 2018-11-14 06:56:45,467 [DEBUG] (migrate_etc) Calling binary: (['mount', u'/dev/rhvh/rhvh-4.1-0.20170417.0+1', u'/tmp/mnt.uinB1'],) {} 2018-11-14 06:56:45,310 [DEBUG] (migrate_etc) Calling binary: (['mount', u'/dev/rhvh/rhvh-4.2.7.3-0.20181026.0+1', u'/tmp/mnt.avsbD'],) {} 2018-11-14 06:57:12,730 [DEBUG] (migrate_etc) Calling: (['cp', '-a', '-r', u'/tmp/mnt.uinB1///etc/redhat-access-insights/machine-id', u'/tmp/mnt.avsbD///etc/redhat-access-insights/machine-id'],) {'close_fds': True, 'stderr': -2} 2018-11-14 06:57:12,734 [DEBUG] (migrate_etc) Exception! cp: not writing through dangling symlink '/tmp/mnt.avsbD///etc/redhat-access-insights/machine-id' === Version-Release number of selected component (if applicable): imgbased-1.0.29 How reproducible: 100% Steps to Reproduce: 1. In a 4.1 RHV-H, register to insights using command "redhat-access-insights --register". This will generate file "/etc/redhat-access-insights/machine-id" file. 2. Change the date of machine-id file. touch -d 20171207 /etc/redhat-access-insights/machine-id This is required to reproduce the issue or else rsync will correct the symlink when it does copying from 4.1 layer to 4.2 layer as we do rsync with --update and the destination machine-id will be having an older timestamp compared to the file in source 4.1 layer. I set the same date as customer machine-id. 3. Do the update. It will fail with the error below. === 2018-11-14 06:57:13,722 [DEBUG] (MainThread) Traceback (most recent call last): File "/tmp/tmp.lwoc2tT3YW/usr/lib/python2.7/site-packages/imgbased/utils.py", line 1521, in thread_group_handler t.join_with_exceptions() File "/tmp/tmp.lwoc2tT3YW/usr/lib/python2.7/site-packages/imgbased/utils.py", line 1513, in join_with_exceptions raise exc[1] CalledProcessError: Command '['cp', '-a', '-r', u'/tmp/mnt.uinB1///etc/redhat-access-insights/machine-id', u'/tmp/mnt.avsbD///etc/redhat-access-insights/machine-id']' returned non-zero exit status 1 2018-11-14 06:57:13,722 [ERROR] (MainThread) Failed to migrate etc Traceback (most recent call last): File "/tmp/tmp.lwoc2tT3YW/usr/lib/python2.7/site-packages/imgbased/plugins/osupdater.py", line 130, in on_new_layer thread_group_handler(threads) File "/tmp/tmp.lwoc2tT3YW/usr/lib/python2.7/site-packages/imgbased/utils.py", line 1524, in thread_group_handler sys.exit(1) SystemExit: 1 === Actual results: RHV-H upgrade from 4.1 to 4.2 is failing with error "not writing through dangling symlink" if the server is registered to insight Expected results: Upgrade should work. Additional info:
Ok, I didn't read this correctly, we could just ship the image without the dangling symlinks, and rerun the post and posttrans scripts for insights-client on update
QE can reproduce this issue. Test version: Build 1: rhvh-4.1-0.20170417.0 Build 2: rhvh-4.2.7.3-0.20181026.0 Test steps: 1. Install rhvh-4.1-0.20170417.0 2. Check redhat-access-insights rpm installed on rhvh 3. Register rhvh to RHSM 4. Register rhvh to insights # redhat-access-insights --register 5. Change the date of machine-id file touch -d 20171207 /etc/redhat-access-insights/machine-id 6. Upgrade rhvh to rhvh-4.2.7.3-0.20181026.0 Actual results: After step 6, upgrade failed. Expected results: After step 6, upgrade should be successful.
(In reply to Yuval Turgeman from comment #3) > Ok, I didn't read this correctly, we could just ship the image without the > dangling symlinks, and rerun the post and posttrans scripts for > insights-client on update I didn't have much knowledge about insights-client. I think ISO without symlinks would be fine. Also, note that it's not only "machine-id" and there are other dangling links as well. ls -laR rootfs/etc/redhat-access-insights/ rootfs/etc/redhat-access-insights/: total 16 drwxr-xr-x. 2 root root 4096 Oct 26 12:15 . drwxr-xr-x. 129 root root 12288 Oct 26 12:16 .. lrwxrwxrwx. 1 root root 32 Oct 26 12:15 .lastupload -> /etc/insights-client/.lastupload lrwxrwxrwx. 1 root root 31 Oct 26 12:15 machine-id -> /etc/insights-client/machine-id lrwxrwxrwx. 1 root root 41 Oct 26 12:15 redhat-access-insights.conf -> /etc/insights-client/insights-client.conf lrwxrwxrwx. 1 root root 41 Oct 26 12:15 redhat-access-insights.cron -> /etc/insights-client/insights-client.cron lrwxrwxrwx. 1 root root 32 Oct 26 12:15 .registered -> /etc/insights-client/.registered lrwxrwxrwx. 1 root root 34 Oct 26 12:15 .unregistered -> /etc/insights-client/.unregistered
This bug is fixed in redhat-virtualization-host-4.2-20181128.0 Test version: # imgbase layout rhvh-4.1-0.20180425.0 +- rhvh-4.1-0.20180425.0+1 rhvh-4.2.8.0-0.20181127.0 +- rhvh-4.2.8.0-0.20181127.0+1 Test steps: Same as comment 4 Test results: After step6, upgrade successful I will verify this bug once the status move to ON_QA
According to comment 6, move to VERIFIED
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:0116