Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1142105 - systemd-nspawn: Container failed with error code 251
Summary: systemd-nspawn: Container failed with error code 251
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-09-16 07:46 UTC by Jan Synacek
Modified: 2016-05-02 11:50 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-06-30 01:09:06 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1171737 0 unspecified CLOSED mock --orphanskills does not work with systemd-nspawn 2022-05-16 11:32:56 UTC

Internal Links: 1171737

Description Jan Synacek 2014-09-16 07:46:13 UTC
Description of problem:
After terminating a container started by systemd-nspawn, it can't be started again. The container didn't boot properly, it got stuck when booting. Rebooting a computer helps.


Version-Release number of selected component (if applicable):
systemd-208-21.fc20.x86_64
kernel-3.16.2-200.fc20.x86_64


Steps to Reproduce:
1. yum -y --releasever=rawhide --nogpg --installroot=/srv/rawhide --disablerepo='*' --enablerepo=fedora install systemd passwd yum fedora-release vim-minimal
2. systemd-nspawn -j -bD /srv/rawhide
3. machinectl terminate rawhide
4. repeat step 2


Actual results:
$ sudo systemd-nspawn -j -bD /srv/rawhide
Spawning namespace container on /srv/rawhide (console is /dev/pts/4).
Init process in the container running as PID 5859.
Failed to register machine: Input/output error
Container failed with error code 251.


Expected results:
The container is started as expected.


Additional info:
The bug is not present on my rawhide machine with systemd-216-5.fc22.x86_64 and kernel-3.17.0-0.rc4.git1.1.fc22.x86_64.
I've found a similar upstream bugreport (https://bugs.freedesktop.org/show_bug.cgi?id=68370), but the workaround doesn't apply for me, because I don't see any sys/fs/cgroup/systemd/system.slice/machine-rawhide.scope/ directory on my system.

Comment 1 Jan Synacek 2014-09-16 07:52:00 UTC
More additional information:
Terminating a container that booted up properly with machinectl results in the same error. Killing the systemd-nspawn process directly with kill -9 works, the container can be started again.

Comment 2 Jóhann B. Guðmundsson 2014-09-16 16:47:28 UTC
Looks like duplicate of 988877

Comment 3 Tomas Smetana 2014-11-13 11:17:40 UTC
Hi. I run into this too with systemd-208-26.fc20.x86_64.

[root@zaphod centos-6]# systemd-nspawn --bind=/home -b
Spawning namespace container on /home/containers/centos-6 (console is /dev/pts/2).
Init process in the container running as PID 11409.
Failed to register machine: Input/output error
Container failed with error code 251.

It's happened after I had killed the machine with 'machinectl terminate centos-6'. I still can see these files/directories on my machine even though the container is not running:

/sys/fs/cgroup/systemd/machine.slice/machine-centos\x2d6.scope/
/run/systemd/system/machine-centos\x2d6.scope
/run/systemd/system/machine-centos\x2d6.scope.d/

It seems like the cgroup and scope units were not properly cleaned up.

Comment 4 Jan Synacek 2014-11-20 12:06:39 UTC
Additional information from the journal:

systemd[1]: machine-rawhide.scope stopping timed out. Killing.
systemd[1]: machine-rawhide.scope still around after SIGKILL. Ignoring.

Not fixed by upstream commit 21b2ce39d4038cd6176394836fdcfb7fba63f424 (service: use the right timeout for stop processes we fork).

Comment 5 Zbigniew Jędrzejewski-Szmek 2014-11-24 01:16:48 UTC
As a work around one can specify a new name with -M.

Comment 6 Jan Synacek 2014-11-24 08:25:18 UTC
One more observation:

Deleting the leftover files does *not* solve the problem.

Comment 7 Jan Synacek 2014-12-02 09:30:04 UTC
After debugging this, it appears to be the same problem as described in http://lists.freedesktop.org/archives/systemd-devel/2014-November/025700.html (follow-up in http://lists.freedesktop.org/archives/systemd-devel/2014-December/025778.html).

The problem is "fixed" by backporting http://cgit.freedesktop.org/systemd/systemd/commit/?id=1baccdda2e954214e0c5463d6ed8f06009b33c41. However, after the fix, the terminal that was used to spawn the container (using -b) gets stalled and the systemd-nspawn process has to be killed by a SIGKILL. I think that the "fix" is the lesser of two evils, so I'll probably backport it.

Zbyszek, any objections?

Comment 8 Fedora End Of Life 2015-05-29 12:53:33 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 9 Fedora End Of Life 2015-06-30 01:09:06 UTC
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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