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

read from the init process error #1203

Open
calvin2021y opened this issue May 1, 2023 · 13 comments
Open

read from the init process error #1203

calvin2021y opened this issue May 1, 2023 · 13 comments

Comments

@calvin2021y
Copy link

try run:

/usr/bin/crun --cgroup-manager=cgroupfs --root=/vm/root run --pid-file=/vm/run/test.pid --preserve-fds=3 test

work for 1.7.2, after 1.8.0, there is a error #1201 just fixed few day ago.

with 1.8.4, and patch 1201, I get this new error: "read from the init process error". downgrade to 1.7.2 work fine.

more details check #1198

@calvin2021y
Copy link
Author

calvin2021y commented May 1, 2023

test

curl -L https://github.com/containers/crun/releases/download/1.7.2/crun-1.7.2-linux-amd64 -o /usr/bin/crun 
curl -L https://github.com/containers/crun/releases/download/1.7.2/crun-1.7.2-linux-amd64-disable-systemd -o /usr/bin/crun 

both work

@giuseppe
Copy link
Member

giuseppe commented May 2, 2023

how are you passing the 3rd file descriptor when you specify --preserve-fds=3?

@calvin2021y
Copy link
Author

calvin2021y commented May 3, 2023

the caller response for create a pair fd and pass it into crun.

all 3 fd is create by parent process.

the container init process will find it and use it as listen fd.

@giuseppe
Copy link
Member

giuseppe commented May 8, 2023

I am not able to reproduce locally using your config.json file

@calvin2021y
Copy link
Author

calvin2021y commented May 10, 2023

The crun run as rootless user id 1001, with cgroup create for that user.

@giuseppe
Copy link
Member

does it work if you don't specify --preserve-fds=3?

@calvin2021y
Copy link
Author

calvin2021y commented May 16, 2023

Thanks for the tips.

today I dos the test with master branch, it work with --preserve-fds=3.

crun version 1.8.4.0.0.0.31-1af4-dirty
commit: 1af41edc92cdff644fd49f261222c842adc586b0

@calvin2021y
Copy link
Author

calvin2021y commented May 16, 2023

after upgrade from 1.7.2 into 1.8.4.0.0.0.31-1af4-dirty commit 1af41ed. I can boot the container. but podman inside podman not work anymore.

with 1.7.2 I can start a child podman without problem, the master crun give me this error(inside the container with crun 1.7.2):

 ⠿ Container test  Starting                                                                                                                                 0.0s 
Error response from daemon: crun: writing file `/sys/fs/cgroup/libpod_parent/libpod-28ca17c7efe66a30fd7175a9429879faace549296c6cb22c1ad89276af1db769/cgroup.procs`: No such file or directory: OCI runtime attempted to invoke a command that was not found

@calvin2021y
Copy link
Author

calvin2021y commented May 16, 2023

ls -alFh /sys/fs//sys/fs/cgroup/libpod_parent/libpod-28ca17c7efe66a30fd7175a9429879faace549296c6cb22c1ad89276af1db769/cgroup.procs
-rw-r--r--    1 root     root           0 May 16 20:38 /sys/fs/cgroup/libpod_parent/libpod-28ca17c7efe66a30fd7175a9429879faace549296c6cb22c1ad89276af1db769/cgroup.procs

@giuseppe
Copy link
Member

can you provide the commands you've used to create the outer container as well as the inner one?

@calvin2021y
Copy link
Author

with patch https://patch-diff.githubusercontent.com/raw/containers/crun/pull/1216.diff not fix the problem.

the outer side is use https://gist.github.com/calvin2021y/4e684c87cf08c29da7d217a87e262ebe and /usr/bin/crun --cgroup-manager=cgroupfs --root=/vm/root run --pid-file=/vm/run/test.pid --preserve-fds=3 test.

the inside I use docker-compose with podman-static , create a symbol link to docker.

ENV DOCKER_HOST=unix:///run/podman/podman.sock docker-compose up -d

also podman --log-level info system service --time=0

@calvin2021y
Copy link
Author

the new crun master with patch give the same error like 1.7.2.

podman --log-level info system service --time=0 process give this error:

@ - - [16/May/2023:21:03:26 +0800] "GET /v1.41/containers/json?all=1&filters=%7B%22label%22%3A%7B%22com.docker.compose.oneoff%3DFalse%22%3Atrue%2C%22com.docker.compose.project%3Ds3%22%3Atrue%7D%7D HTTP/1.1" 200 1581 "" "Docker-Client/unknown-version (linux)"
INFO[0175] Request Failed(Internal Server Error): crun: writing file `/sys/fs/cgroup/libpod_parent/libpod-c47297f06ab31c2f9fd38ee4e7f661451047e1b0b9cac94d47beede24fee6d63/cgroup.procs`: No such file or directory: OCI runtime attempted to invoke a command that was not found 
@ - - [16/May/2023:21:03:26 +0800] "POST /v1.41/containers/c47297f06ab31c2f9fd38ee4e7f661451047e1b0b9cac94d47beede24fee6d63/start HTTP/1.1" 500 324 "" "Docker-Client/unknown-version (linux)"

@calvin2021y
Copy link
Author

calvin2021y commented May 16, 2023

here I try debug around the problem, try without --preserve-fds=3 and change the init command into:

 "args": [
      "podman", "--log-level", "info","system","service","--time=0"
    ]

some how I get the problem back:

sudo -u web -H /usr/bin/crun --cgroup-manager=cgroupfs --root=/ghost/.run run --pid-file=/ghost/.run/.pinp.pid pinp
2023-05-16T15:37:24.440046Z: read from the init process

change the crun into 1.7.2, I can start with sudo -u web -H /usr/bin/crun --cgroup-manager=cgroupfs --root=/ghost/.run run --pid-file=/ghost/.run/.pinp.pid pinp

from the 1.7.2 shell, I can see the uid map is work.

crun --rootless=/ghost/.run exec -t --cwd=/root pinp cat /proc/self/uid_map
         0       1001          1
         1     100000      65536
crun --rootless=/ghost/.run exec -t --cwd=/root pinp id
uid=0(root) gid=0(root)

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

2 participants