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.
Bug 1298234 - systemd-nspawn container fails to boot for the first time when --link-journal=try-guest is used
Summary: systemd-nspawn container fails to boot for the first time when --link-journal...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: systemd-maint
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-01-13 15:04 UTC by Frantisek Sumsal
Modified: 2020-12-15 07:39 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-12-15 07:39:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Frantisek Sumsal 2016-01-13 15:04:38 UTC
Description of problem:
First nspawn container boot fails when --link-journal=try-guest is specified as an argument of systemd-nspawn (which is used in systemd-nspawn@.service file).

Version-Release number of selected component (if applicable):
systemd-219-19.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. # mkdir -p /var/lib/machines/testvm
2. # yum -y --installroot="/var/lib/machines/testvm" groupinstall "Minimal install"
3. # systemd-nspawn --link-journal=try-guest -bM testvm

Actual results:
# systemd-nspawn --link-journal=try-guest -bM testvm
Spawning container testvm on /var/lib/machines/testvm.
Press ^] three times within 1s to kill container.
Container testvm failed with error code 1.

Expected results:
Container should boot successfully.

Additional info:
Same process works on Fedora 23:

# mkdir -p /var/lib/machines/testvm
# dnf -y --installroot="/var/lib/machines/testvm" --releasever 23 groupinstall "Minimal install"
<...>
# systemd-nspawn --link-journal=try-guest -bM testvm
Spawning container testvm on /var/lib/machines/testvm.
Press ^] three times within 1s to kill container.
systemd 222 running in system mode. (+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT
 +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
Detected virtualization systemd-nspawn.
Detected architecture x86-64.

Welcome to Fedora 23 (Twenty Three)!
<...>

Comment 2 M. Scherer 2016-04-21 20:46:46 UTC
So I can reproduce this one, and I can also say this is fixed in Fedora 23.

I suspect this work on the first time due to 8054d749c4ad69503b5b2735864f8e72a1b73e62

Comment 3 M. Scherer 2016-04-21 23:10:01 UTC
So I did took a closer look, because it did bother me a lot, but gdb seems to interfere with systemd nspawn, as my error point to "open_console", and I think that's because i run in gdb. I tried with gdbserver, but also didn't got far.

Comment 4 M. Scherer 2016-04-22 09:51:20 UTC
So the problem likely come from /etc/machine-id failing to be created in the container. 

After using strace properly, i see that it fail with "failed to parse machine-id".


This was likely fixed by e01ff70a77e78.

Comment 5 M. Scherer 2016-04-22 10:29:13 UTC
Ok so the fix/workaround is to run  systemd-machine-id-setup --root, or systemd-firstboot --root.

Comment 6 Michal Sekletar 2016-04-22 12:43:07 UTC
We call systemd-machine-id-setup from systemd %post during rpm installation. Hence /etc/machine-id should be present in the container after yum has finished installing packages.

Comment 7 M. Scherer 2016-04-22 13:04:00 UTC
yeah, but it is silently ignoring all errors. 

systemd-machine-id-setup >/dev/null 2>&1 || :


I just tried again on a centos 7, and the machine-id file is empty.

Comment 8 Michal Sekletar 2016-04-22 14:25:46 UTC
I've backported 8054d749c4ad69503b5b2735864f8e72a1b73e62. Feel free to grab test packages.

http://people.redhat.com/~msekleta/bz1298234/

Comment 11 RHEL Program Management 2020-12-15 07:39:34 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.


Note You need to log in before you can comment on or make changes to this bug.