Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

stage1 issue when running as a systemd unit #3955

Open
andor44 opened this issue Aug 30, 2018 · 6 comments
Open

stage1 issue when running as a systemd unit #3955

andor44 opened this issue Aug 30, 2018 · 6 comments

Comments

@andor44
Copy link

andor44 commented Aug 30, 2018

Environment

rkt Version: 1.29.0
appc Version: 0.8.9
Go Version: go1.9.2
Go OS/Arch: linux/amd64
Features: -TPM +SDJOURNAL
--
Linux 4.15.0-1018-gcp x86_64
--
NAME="Ubuntu"
VERSION="18.04.1 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.1 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
--
systemd 237
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid

This is the default Ubuntu 18.04.1 image on GCE.

What did you do?
Created a systemd service unit that looks like this:

[Unit]
Description=foo
Requires=network-online.target
After=network-online.target

[Service]
Slice=machine.slice
KillMode=mixed
Restart=always
RestartSec=10
MemoryHigh=95%
ExecStart=/usr/bin/rkt run \
  --insecure-options=image \
 <some mount and volume options> \
 <some port options> \
 docker://image

ExecStopPost=/usr/bin/rkt gc --mark-only

[Install]
WantedBy=multi-user.target

What did you expect to see?
The pod starting and running correctly.

What did you see instead?

Aug 30 11:27:22 systemd-udevd[2670]: Could not generate persistent MAC address for veth16e7868e: No such file or directory
Aug 30 11:27:22 rkt[2628]: stage1: cannot get environment: error calling sd_pid_get_owner_uid: no data available
Aug 30 11:27:22 systemd[1]: foo.service: Main process exited, code=exited, status=254/n/a

Note:
I wrote the systemd unit file according to https://coreos.com/rkt/docs/latest/using-rkt-with-systemd.html
After some discussion on IRC it seems to be related to #3750 and perhaps #3390, except my rkt and systemd versions include the fixes merged for those.
Trying the same ExecStart from a shell results in a fully functional pod.

@andor44
Copy link
Author

andor44 commented Aug 30, 2018

systemd-run --slice=machine.slice rkt run... has the same result as with a regular unit, i.e. it fails.

@andor44
Copy link
Author

andor44 commented Aug 31, 2018

Installing 1.30.0-1 from the releases page .deb fixes the issue. I am able to start pods with that release.

@lucab
Copy link
Member

lucab commented Aug 31, 2018

@andor44 how did you get the 1.29.0 binary? Package from Ubuntu repo, package from our release page, just the binary from our release page or did you compile it yourself?

@andor44
Copy link
Author

andor44 commented Aug 31, 2018

@lucab package from the Ubuntu repo.
Repro steps:

  1. Create GCE instance with ubuntu-1804-bionic-v20180823 (Latest image in ubuntu-1804-lts family as of now)
  2. Log in
  3. apt update && apt install rkt
  4. systemd-run --slice=machine.slice rkt run docker://nginx
  5. Wait a few seconds, then journalctl -e to observe the error message from my initial message.

As I mentioned in my comment from earlier today the 1.30 .deb package from your release page on the very same OS works as expected. Perhaps the 1.29 stage1 in the ubuntu package doesn't include the fixes for some reason?

@lucab
Copy link
Member

lucab commented Aug 31, 2018

Indeed, from buildlog it looks like it has been built with go-systemd v14 which do not coreos/go-systemd#237.

@andor44
Copy link
Author

andor44 commented Aug 31, 2018

Where does this leave me? If I understand correctly that means I'd have to wait until 18.10 (or really, the next LTS) when Ubuntu can bump their go-systemd version, or Ubuntu devs would have to backport the patch on go-systemd v14 themselves, right?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants