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

[v0.10.0-rc2 regression] rootless: buildkitd: failed to dial "/run/containerd/containerd.sock": connection error: desc = "transport: error while dialing: dial unix /run/containerd/containerd.sock: connect: permission denied" #2965

Closed
AkihiroSuda opened this issue Jul 16, 2022 · 8 comments

Comments

@AkihiroSuda
Copy link
Member

v0.10.0-rc1 and older:

$ rootlesskit ./bin/buildkitd 
INFO[2022-07-16T22:16:43+09:00] auto snapshotter: using overlayfs            
INFO[2022-07-16T22:16:43+09:00] found worker "wytloo7jcwd808vhkf76xsl05", labels=map[org.mobyproject.buildkit.worker.executor:oci org.mobyproject.buildkit.worker.hostname:suda-ws01 org.mobyproject.buildkit.worker.snapshotter:overlayfs], platforms=[linux/amd64 linux/amd64/v2 linux/amd64/v3 linux/amd64/v4 linux/386] 
WARN[2022-07-16T22:16:43+09:00] rootless mode is not supported for containerd workers. disabling containerd worker. 
INFO[2022-07-16T22:16:43+09:00] found 1 workers, default="wytloo7jcwd808vhkf76xsl05" 
WARN[2022-07-16T22:16:43+09:00] currently, only the default worker can be used. 
INFO[2022-07-16T22:16:43+09:00] running server on /run/user/1001/buildkit/buildkitd.sock
(Works as expected)

v0.10.0-rc2 and newer:

$ rootlesskit ./bin/buildkitd 
INFO[2022-07-16T22:17:43+09:00] auto snapshotter: using overlayfs            
INFO[2022-07-16T22:17:43+09:00] found worker "wytloo7jcwd808vhkf76xsl05", labels=map[org.mobyproject.buildkit.worker.executor:oci org.mobyproject.buildkit.worker.hostname:suda-ws01 org.mobyproject.buildkit.worker.snapshotter:overlayfs], platforms=[linux/amd64 linux/amd64/v2 linux/amd64/v3 linux/amd64/v4 linux/386] 
buildkitd: failed to dial "/run/containerd/containerd.sock": connection error: desc = "transport: error while dialing: dial unix /run/containerd/containerd.sock: connect: permission denied"
failed to connect client to "/run/containerd/containerd.sock" . make sure containerd is running
github.com/moby/buildkit/worker/containerd.NewWorkerOpt
        /src/worker/containerd/containerd.go:33
main.containerdWorkerInitializer
        /src/cmd/buildkitd/main_containerd_worker.go:262
main.newWorkerController
        /src/cmd/buildkitd/main.go:686
main.newController
        /src/cmd/buildkitd/main.go:630
main.main.func3
        /src/cmd/buildkitd/main.go:263
github.com/urfave/cli.HandleAction
        /src/vendor/github.com/urfave/cli/app.go:526
github.com/urfave/cli.(*App).Run
        /src/vendor/github.com/urfave/cli/app.go:288
main.main
        /src/cmd/buildkitd/main.go:313
runtime.main
        /usr/local/go/src/runtime/proc.go:255
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1581
[rootlesskit:child ] error: command [./bin/buildkitd] exited: exit status 1
[rootlesskit:parent] error: child exited: exit status 1

Thanks to a user who reported in the slack

@AkihiroSuda
Copy link
Member Author

cc @ktock

@AkihiroSuda
Copy link
Member Author

Workaround

rootlesskit buildkitd --containerd-worker=false --oci-worker=true

@tonistiigi
Copy link
Member

What change introduced this?

@AkihiroSuda
Copy link
Member Author

@tonistiigi
Copy link
Member

So that change does not work and containerd worker does not work with rootless?

@AkihiroSuda
Copy link
Member Author

The containerd worker does work, but only when the buildkitd and the containerd are executed in the same user/mount/network namespaces.
This behavior is expected, but it shouldn't error out when the buildkitd is being executed in its own namespaces and lacks access to containerds.cok

@ktock
Copy link
Collaborator

ktock commented Jul 19, 2022

LGTM for the workaround. I'll submit a patch to fix this issue.

@ktock
Copy link
Collaborator

ktock commented Jul 23, 2022

Fixed in #2968

@ktock ktock closed this as completed Jul 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants