containers / podman

Podman: A tool for managing OCI containers and pods.
https://podman.io
Apache License 2.0
23.86k stars 2.42k forks source link

ERRO[0057] unable to write pod event: "write unixgram @00017->/run/systemd/journal/socket: sendmsg: no such file or directory" #4325

Closed chenjianxin closed 4 years ago

chenjianxin commented 5 years ago

OS: WSL 2 ubuntu

podman run --rm --volume="$PWD:/srv/jekyll" -p 127.0.0.1:4000:4000 -it jekyll/jekyll:pages jekyll serve

Trying to pull docker.io/jekyll/jekyll:pages... Getting image source signatures Copying blob 278f4c997324 done Copying blob c69cba5b7867 done Copying blob 9d48c3bd43c5 done Copying blob 9ce9598067e7 done Copying blob 867dd521f6d0 done Copying blob 49e3e26660b5 done Copying config a572804619 done Writing manifest to image destination Storing signatures

ERRO[0057] unable to write pod event: "write unixgram @00017->/run/systemd/journal/socket: sendmsg: no such file or directory" ERRO[0059] unable to write pod event: "write unixgram @00017->/run/systemd/journal/socket: sendmsg: no such file or directory" Error: slirp4netns failed

mheon commented 5 years ago

You are seeing two separate issues here.

The write unixgram errors are attempts to write to the systemd journal, which doesn't seem to be present on WSL images.

The slirp4netns issue was the fatal issue.

rhatdan commented 5 years ago

That is a pretty poor error message on slirp4netns. Is this just the package is missing or it failed and did not give us a decent message. @AkihiroSuda FYI

rhatdan commented 5 years ago

Should the messages be logrus.Warning if the systemd is not running, the only issue here is that if the user looked for events he would not see them correct?

rhatdan commented 5 years ago

@chenjianxin Could you try the same command and see if it works if you do --net=host Which should eliminate slirp4netns, I believe.

AkihiroSuda commented 5 years ago

@rhatdan slirp4netns should be printing some errors, but it seems podman ignores that

rhatdan commented 5 years ago

https://github.com/containers/libpod/pull/4338 should help get those messages.

chenjianxin commented 5 years ago

4338 should help get those messages.

podman run -d --name mysql-server --net=host -e MYSQL_ROOT_PASSWORD=secret mysql:latest

ERRO[0001] unable to write volume event: "write unixgram @00029->/run/systemd/journal/socket: sendmsg: no such file or directory" ERRO[0001] unable to write pod event: "write unixgram @00029->/run/systemd/journal/socket: sendmsg: no such file or directory" Error: container_linux.go:346: starting container process caused "process_linux.go:297: applying cgroup configuration for process caused \"mountpoint for cgroup not found\"": OCI runtime error

sudo podman network create -d bridge my-network ERRO[0000] unable to write system event: "write unixgram @0000d->/run/systemd/journal/socket: sendmsg: no such file or directory" /etc/cni/net.d/my-network.conflist

rhatdan commented 5 years ago

What is /etc/cni/net.d/my-network.conflist and why is the container trying to use it?

github-actions[bot] commented 4 years ago

This issue had no activity for 30 days. In the absence of activity or the "do-not-close" label, the issue will be automatically closed within 7 days.

vrothberg commented 4 years ago

What is /etc/cni/net.d/my-network.conflist and why is the container trying to use it?

@chenjianxin, are you still seeing the issue?

rdcoe commented 4 years ago

Should this issue remain closed? Still seeing it:

$ cat /etc/debian_version buster/sid $ uname -a Linux BEASTIE 4.19.84-microsoft-standard #1 SMP Wed Nov 13 11:44:37 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

$ podman run --net=host -it fedora bash ERRO[0000] unable to write pod event: "write unixgram @0000d->/run/systemd/journal/socket: sendmsg: no such file or directory" ERRO[0000] unable to write pod event: "write unixgram @0000d->/run/systemd/journal/socket: sendmsg: no such file or directory" ERRO[0000] unable to write pod event: "write unixgram @0000d->/run/systemd/journal/socket: sendmsg: no such file or directory" ERRO[0000] unable to write pod event: "write unixgram @0000d->/run/systemd/journal/socket: sendmsg: no such file or directory" # exit ERRO[0330] unable to write pod event: "write unixgram @0000d->/run/systemd/journal/socket: sendmsg: no such file or directory" ERRO[0331] unable to close namespace: "close /proc/119/ns/user: bad file descriptor"

vrothberg commented 4 years ago

Thanks for jumping in @rdcoe! Maybe you can answer @rhatdan 's question:

What is /etc/cni/net.d/my-network.conflist and why is the container trying to use it?

vrothberg commented 4 years ago

Actually, your output looks different. Can you do a podman info? There seems to be no systemd in WSL2. Does a podman --cgroup-manager=cgroupfs run ... work?

rdcoe commented 4 years ago

$ podman --cgroup-manager=cgroupfs run --net=host -it fedora bash ERRO[0000] unable to write pod event: "write unixgram @0001b->/run/systemd/journal/socket: sendmsg: no such file or directory" ERRO[0000] unable to write pod event: "write unixgram @0001b->/run/systemd/journal/socket: sendmsg: no such file or directory" ERRO[0000] unable to write pod event: "write unixgram @0001b->/run/systemd/journal/socket: sendmsg: no such file or directory" ERRO[0000] unable to write pod event: "write unixgram @0001b->/run/systemd/journal/socket: sendmsg: no such file or directory"

rhatdan commented 4 years ago

How about --events-backend=file

The default for windows should be set to file not to journal

rdcoe commented 4 years ago

--events-backend=file fixed it. Thanks!

Can this be made the default through config, along with the other relevant flags?

rhatdan commented 4 years ago

We are working on containers.conf right now, to allow different distros and users to modify the defaults.

https://github.com/containers/common

rdcoe commented 4 years ago

Cool. So should this issue be closed now?

rhatdan commented 4 years ago

@rdcoe Is everything else working on WSL Now?

rdcoe commented 4 years ago

Too new to podman to know if "everything" is working but this particular issue is solved.

mheon commented 4 years ago

No need to wait for containers/common, events_logger = "file" in libpod.conf should set things properly

rdcoe commented 4 years ago

Even better. That config also fixed the error I was seeing on exiting the container:

before the config change:

$ podman --cgroup-manager=cgroupfs --events-backend=file run --net=host -it fedora bash [root@BEASTIE /]# exit ERRO[0988] unable to close namespace: "close /proc/119/ns/user: bad file descriptor"

after setting the libpod.conf to use a file instead of journald

$ podman run --net=host -it fedora bash [root@BEASTIE /]# exit $

mathieu-benoit commented 4 years ago

Hi there, I'm very new with podman and I'm trying to get it working with WSL1 but I still have the error with the command below:

$ podman --cgroup-manager=cgroupfs --events-backend=file run --net=host -it fedora bash
Error: container_linux.go:346: starting container process caused "process_linux.go:319: getting the final child's pid from pipe caused \"EOF\"": OCI runtime error

Are you able to have this command working? I see otherwise that "setting the libpod.conf to use a file instead of journald" seems to work for you @rdcoe and @mheon but sorry for a dummy question, but how to do that? For my understanding is it going to be fixed with podman version 1.6.4? Thanks! NB: I'm currently with podman version 1.6.2 (currently available here) | Ubuntu 18.04 on WSL1.

rhatdan commented 4 years ago

My understanding is podman did not work well on WSL1 because of the way the kernel was configured. Is there a chance you can try with WSL2?

mathieu-benoit commented 4 years ago

Thanks @rhatdan, I just converted my WSL1 into WSL2 and indeed this command below works on WSL2: podman --cgroup-manager=cgroupfs --events-backend=file run --net=host -it fedora bash. Thanks!

PavelSosin-320 commented 4 years ago

@rhatdan Hi I'm working on WSL! I get this message! This is the known gap - WSL doesn't support systemd because it uses MS proprietary init. On the other hand, Ubuntu 20.04 from Microsoft store does support systemd as I can see in its startup message. So I think it is possible for all distros but not documented. Ubuntu 20.04 is the only distro in which systemd is the root process.

mheon commented 4 years ago

The net=host bit is concerning to me and should be looked into - I'd hope that we'd be able to get standard networking running, given WSL2's support for Docker (and presumably Libnetwork).

The remaining two (--cgroup-manager=cgroupfs and --events=backend=file) are not a big deal - they're the usual defaults when systemd is not available, and will be safe even the systemd does use systemd for PID1. We may want to investigate improving our defaults here - if systemd is not available we should automatically be selecting the safe option.

PavelSosin-320 commented 4 years ago

There is additional complexity in the Podman networking: Pod creation. I'm building Pod which consists of 2 images: podman pod create --name theiaTest -p 3000:3000 podman run -dt --pod theiaTest -it -P -v "$(pwd):/home/project:cached" --name=theia theiaide/theia podman run -dt --pod theiaTest --name=ngInx and the main issue is Error: error starting some containers: internal libpod error due to les-legacy tables present, use iptables-legacy to see them iptables v1.8.4 (nf_tables): CHAIN_ADD failed (No such file or directory): chain PREROUTING ERRO[0000] Error while adding pod to CNI network "podman": unable to create chain CNI-HOSTPORT-SETMARK: running [/usr/sbin/iptables -t nat -S --wait]: exit status 4: # Warning: iptables-legacy tables present, use iptables-legacy to see them iptables v1.8.4 (nf_tables): CHAIN_ADD failed (No such file or directory): chain PREROUTING CentOS8 has got nft. I removed (renamed) iptables configuration to designate that iptables are not directly manageable. It will be nice if libpod will check firewall capability and simply warn/skip firewall management if Podman runs inside VM container. P.S. In my VM I see both eth0 and cni-podman0. eth0 is the interface to the host's network and it is known only after VM starts. WSL generates /etc/hosts file for docker which contains Host machine DNS names. All services running in WSL VM must listen 0.0.0.0.0 , i.e. both localhost and eth0.

PavelSosin-320 commented 4 years ago

Ubuntu 20.04 from Microsoft store has Podman from the Kubic project ??????

georgettica commented 3 years ago

Just to raise the issue. Still on wsl2 there is a need for the flags

I am running Debian inside my win10.

podman run --events-backend=file --net=host --rm -it python bash
xbb commented 3 years ago

For WSL2 as suggested before from @mheon you can use events_logger = "file" in the configuration file, no need to add the --events-backend arg every time.

In my case I added ~/.config/containers/containers.conf (or you can edit /etc/containers/containers.conf) with this content:

[engine]
events_logger = "file"
georgettica commented 3 years ago

Is that also mentioned in the docs Somewhere?

It would be a shame if this just issue is not easily found and people have trouble with podman

PavelSosin-320 commented 3 years ago

I upgraded my WSL Ubuntu 20.04 to 20.10 Groovy, Installed genie with all its pre-requisites to have systemd and now it is not an issue at all. Anyway, life with systemd and jornald is better than without.

rhatdan commented 3 years ago

Awesome news.

abdennour commented 3 years ago

good to have WSL2! but i had a lot of issues with it.

@xbb 's solution worked with me. But i had to run with sudo.