Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
DescriptionChristophe Besson
2023-06-14 14:00:46 UTC
Description of problem:
A customer having an OS that has likely migrated from RHEL 6 in the past encountered an error while trying to symlink /etc/rhsm-host inside the container.
The real error happened before, systemd-nspawn returning an exit code which is *supposedly* the one of the command that is executed inside the container, unless it fails itself, which is apparently impossible to distinguish:
$ grep mknod 0100-leapp-debug.tgz/var/log/leapp/leapp-preupgrade.log
2023-06-13 20:44:17.600 DEBUG PID: 26010 leapp.workflow.TargetTransactionFactsCollection.target_userspace_creator: mknod(/var/lib/leapp/scratch/mounts/root_/system_overlay/dev/null) failed: File exists
This messages comes from systemd-219/src/nspawn/nspawn.c, mknod()'ing this device descriptor is required to setup the console:
1370 static int copy_devnodes(const char *dest) {
1371
1372 static const char devnodes[] =
1373 "null\0"
1374 "zero\0"
:
1389 NULSTR_FOREACH(d, devnodes) {
:
1393 from = strappend("/dev/", d);
1394 to = strjoin(dest, "/dev/", d, NULL);
:
1415 if (mknod(to, st.st_mode, st.st_rdev) < 0)
1416 return log_error_errno(errno, "mknod(%s) failed: %m", to);
:
:
3595 int main(int argc, char *argv[]) {
:
3980 if (copy_devnodes(arg_directory) < 0)
3981 _exit(EXIT_FAILURE);
Fstab entries:
$ grep -v -e ^# -e xfs etc/fstab
devtmpfs /dev devtmpfs rw,seclabel,nosuid,size=3992740k,nr_inodes=998185,mode=755 0 0
tmpfs /run tmpfs rw,seclabel,nosuid,nodev,mode=755 0 0
sysfs /sys sysfs rw,seclabel,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
devpts /dev/pts devpts rw,seclabel,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /dev/shm tmpfs rw,seclabel,nosuid,nodev,noexec 0 0
tmpfs /sys/fs/cgroup tmpfs ro,seclabel,nosuid,nodev,noexec,mode=755 0 0
/dev is bind-mounted into the container:
2023-06-13 20:44:17.273 DEBUG PID: 26010 leapp.workflow.TargetTransactionFactsCollection.target_userspace_creator: External command has started: ['mount', '-o', 'bind', '/var/lib/leapp/sc
ratch/mounts/root_dev/root_dev', u'/var/lib/leapp/scratch/mounts/root_/system_overlay/dev']
2023-06-13 20:44:17.285 DEBUG PID: 26010 leapp.workflow.TargetTransactionFactsCollection.target_userspace_creator: External command has finished: ['mount', '-o', 'bind', '/var/lib/leapp/s
cratch/mounts/root_dev/root_dev', u'/var/lib/leapp/scratch/mounts/root_/system_overlay/dev']
causing the issue raised by systemd-nspawn:
95629 12:05:04.022718 mknod("/var/lib/leapp/scratch/mounts/root_/system_overlay/dev/null", S_IFCHR|0666, makedev(1, 3)) = -1 EEXIST (File exists) <0.000030>
Version-Release number of selected component (if applicable):
leapp-upgrade-el7toel8-0.18.0-1.el7_9.noarch
How reproducible:
Always
Steps to Reproduce:
1. Add a devtmpfs entry in fstab
devtmpfs /dev devtmpfs rw,seclabel,nosuid,size=3992740k,nr_inodes=998185,mode=755 0 0
2. leapp preupgrade
Actual results:
Risk Factor: high
Title: Cannot set the container mode for the subscription-manager.
Summary:
Key: 06583cd4c6f9e1629a9c1937643c3897618f33ef
Expected results:
An inhibitor
Additional info:
* should apply to RHEL 8>9 too
* a way to distinguish the systemd-nspawn's return code would help...
Comment 3Christophe Besson
2023-06-15 09:41:54 UTC
Created a PR for this, and tested on my RHEL 7.9 VM.
diff --git a/repos/system_upgrade/common/libraries/overlaygen.py b/repos/system_upgrade/common/libraries/overlaygen.py
index b544f88..c61e23d 100644
--- a/repos/system_upgrade/common/libraries/overlaygen.py
+++ b/repos/system_upgrade/common/libraries/overlaygen.py
@@ -7,7 +7,7 @@ from leapp.exceptions import StopActorExecutionError
from leapp.libraries.common import mounting, utils
from leapp.libraries.stdlib import api, CalledProcessError, run
-OVERLAY_DO_NOT_MOUNT = ('tmpfs', 'devpts', 'sysfs', 'proc', 'cramfs', 'sysv', 'vfat')
+OVERLAY_DO_NOT_MOUNT = ('tmpfs', 'devtmpfs', 'devpts', 'sysfs', 'proc', 'cramfs', 'sysv', 'vfat')
MountPoints = namedtuple('MountPoints', ['fs_file', 'fs_vfstype'])
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 (leapp and leapp-repository bug fix and enhancement update), 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-2023:7230
Description of problem: A customer having an OS that has likely migrated from RHEL 6 in the past encountered an error while trying to symlink /etc/rhsm-host inside the container. The real error happened before, systemd-nspawn returning an exit code which is *supposedly* the one of the command that is executed inside the container, unless it fails itself, which is apparently impossible to distinguish: $ grep mknod 0100-leapp-debug.tgz/var/log/leapp/leapp-preupgrade.log 2023-06-13 20:44:17.600 DEBUG PID: 26010 leapp.workflow.TargetTransactionFactsCollection.target_userspace_creator: mknod(/var/lib/leapp/scratch/mounts/root_/system_overlay/dev/null) failed: File exists This messages comes from systemd-219/src/nspawn/nspawn.c, mknod()'ing this device descriptor is required to setup the console: 1370 static int copy_devnodes(const char *dest) { 1371 1372 static const char devnodes[] = 1373 "null\0" 1374 "zero\0" : 1389 NULSTR_FOREACH(d, devnodes) { : 1393 from = strappend("/dev/", d); 1394 to = strjoin(dest, "/dev/", d, NULL); : 1415 if (mknod(to, st.st_mode, st.st_rdev) < 0) 1416 return log_error_errno(errno, "mknod(%s) failed: %m", to); : : 3595 int main(int argc, char *argv[]) { : 3980 if (copy_devnodes(arg_directory) < 0) 3981 _exit(EXIT_FAILURE); Fstab entries: $ grep -v -e ^# -e xfs etc/fstab devtmpfs /dev devtmpfs rw,seclabel,nosuid,size=3992740k,nr_inodes=998185,mode=755 0 0 tmpfs /run tmpfs rw,seclabel,nosuid,nodev,mode=755 0 0 sysfs /sys sysfs rw,seclabel,nosuid,nodev,noexec,relatime 0 0 proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0 devpts /dev/pts devpts rw,seclabel,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0 tmpfs /dev/shm tmpfs rw,seclabel,nosuid,nodev,noexec 0 0 tmpfs /sys/fs/cgroup tmpfs ro,seclabel,nosuid,nodev,noexec,mode=755 0 0 /dev is bind-mounted into the container: 2023-06-13 20:44:17.273 DEBUG PID: 26010 leapp.workflow.TargetTransactionFactsCollection.target_userspace_creator: External command has started: ['mount', '-o', 'bind', '/var/lib/leapp/sc ratch/mounts/root_dev/root_dev', u'/var/lib/leapp/scratch/mounts/root_/system_overlay/dev'] 2023-06-13 20:44:17.285 DEBUG PID: 26010 leapp.workflow.TargetTransactionFactsCollection.target_userspace_creator: External command has finished: ['mount', '-o', 'bind', '/var/lib/leapp/s cratch/mounts/root_dev/root_dev', u'/var/lib/leapp/scratch/mounts/root_/system_overlay/dev'] causing the issue raised by systemd-nspawn: 95629 12:05:04.022718 mknod("/var/lib/leapp/scratch/mounts/root_/system_overlay/dev/null", S_IFCHR|0666, makedev(1, 3)) = -1 EEXIST (File exists) <0.000030> Version-Release number of selected component (if applicable): leapp-upgrade-el7toel8-0.18.0-1.el7_9.noarch How reproducible: Always Steps to Reproduce: 1. Add a devtmpfs entry in fstab devtmpfs /dev devtmpfs rw,seclabel,nosuid,size=3992740k,nr_inodes=998185,mode=755 0 0 2. leapp preupgrade Actual results: Risk Factor: high Title: Cannot set the container mode for the subscription-manager. Summary: Key: 06583cd4c6f9e1629a9c1937643c3897618f33ef Expected results: An inhibitor Additional info: * should apply to RHEL 8>9 too * a way to distinguish the systemd-nspawn's return code would help...