Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mkdir() "/var/run/openresty/nginx-client-body" failed #124

Open
carlheymann opened this issue Oct 4, 2019 · 4 comments
Open

mkdir() "/var/run/openresty/nginx-client-body" failed #124

carlheymann opened this issue Oct 4, 2019 · 4 comments

Comments

@carlheymann
Copy link

carlheymann commented Oct 4, 2019

To reproduce:

$ docker pull openresty/openresty:1.15.8.2-2-centos
$ docker run --rm openresty/openresty:1.15.8.2-2-centos
2019/10/04 08:24:02 [emerg] 1#1: mkdir() "/var/run/openresty/nginx-client-body" failed (2: No such file or directory)
nginx: [emerg] mkdir() "/var/run/openresty/nginx-client-body" failed (2: No such file or directory)

Is this a regression? I can work around it by adding my own dockerfile and creating the directory in there. This issue is not present in openresty/openresty:1.15.8.1-4-centos.

@neomantra
Copy link
Member

Yes, this is a regression -- thanks for reporting -- bad release management on my part.

I am fixing this now with a VOLUME stanza and doing a new release. Should be through Travis later today.

@karllhughes
Copy link

I pulled down the latest centos (openresty/openresty:centos) and got this error today. Rolling back to openresty/openresty:1.15.8.1-4-centos fixed it.

Is it possible this regression is back?

@neomantra
Copy link
Member

Hmmmm... I'm trying this and it is OK?

docker pull openresty/openresty:1.17.8.2-0-centos
docker run --rm openresty/openresty:1.17.8.2-0-centos

@asviel
Copy link

asviel commented Oct 10, 2024

@neomantra
Issue still presented when I use ctr (and containerd) to run container.

# ctr run --net-host --rm docker.io/openresty/openresty:jammy nginx
2024/10/10 07:42:40 [emerg] 1#1: mkdir() "/var/run/openresty/nginx-client-body" failed (2: No such file or directory)
nginx: [emerg] mkdir() "/var/run/openresty/nginx-client-body" failed (2: No such file or directory)

When you run this way, the /run directory is empty. I haven't figured out why yet, I think containerd is wiping it out.

# ctr run --net-host --rm docker.io/openresty/openresty:jammy nginx ls -lA /var/run
lrwxrwxrwx 1 root root 4 Jun 27 14:20 /var/run -> /run
# ctr run --net-host --rm docker.io/openresty/openresty:jammy nginx ls -lA /var/run/
total 0
# ctr run --net-host --rm docker.io/openresty/openresty:jammy nginx ls -lA /run/
total 0

UPD:
With nerdctl /run not empty, so it's not about containerd, it's about ctr:

# nerdctl run --net host -it --rm openresty/openresty:jammy bash -c 'ls -lA /var/run'
lrwxrwxrwx 1 root root 4 Jun 27 14:20 /var/run -> /run
# nerdctl run --net host -it --rm openresty/openresty:jammy bash -c 'ls -lA /var/run/'
total 16
drwxrwxrwt 2 root root 4096 Jun 27 14:20 lock
drwxr-xr-x 2 root root 4096 Jun 27 14:20 mount
drwxr-xr-x 2 root root 4096 Jul 22 13:28 openresty
drwxr-xr-x 2 root root 4096 Jun 27 14:24 systemd
# nerdctl run --net host -it --rm openresty/openresty:jammy bash -c 'ls -lA /run/'
total 16
drwxrwxrwt 2 root root 4096 Jun 27 14:20 lock
drwxr-xr-x 2 root root 4096 Jun 27 14:20 mount
drwxr-xr-x 2 root root 4096 Jul 22 13:28 openresty
drwxr-xr-x 2 root root 4096 Jun 27 14:24 systemd

UPD:
Okay, ctr mounts /run as tmpfs by default:

# ctr c create --net-host --rm docker.io/openresty/openresty:jammy nginx
# ctr c info nginx
{
    "ID": "nginx",
    "Labels": {
        "io.containerd.image.config.stop-signal": "SIGQUIT",
        "maintainer": "Evan Wies \[email protected]\u003e",
        ...
    },
    "Image": "docker.io/openresty/openresty:jammy",
    "Runtime": {
        "Name": "io.containerd.runc.v2",
        "Options": {
            "type_url": "containerd.runc.v1.Options"
        }
    },
    "Spec": {
        ...
        "mounts": [
            ...
            {
                "destination": "/run",
                "type": "tmpfs",
                "source": "tmpfs",
                "options": [
                    "nosuid",
                    "strictatime",
                    "mode=755",
                    "size=65536k"
                ]
            },
            ...
        ],
    }
}

UPD
containerd/containerd#1340

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

No branches or pull requests

4 participants