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

push to insecure registry (panic: runtime error: index out of range [0] with length 0) #2542

Closed
cmdjulian opened this issue Jan 3, 2022 · 1 comment · Fixed by #2650
Closed
Labels

Comments

@cmdjulian
Copy link
Contributor

cmdjulian commented Jan 3, 2022

I would like to use rootless buildkit in a Kubernetes Job and trying to use the provided rootless template from the examples folder.
Build works greate, but pushing fails with:

#10 ERROR: failed to do request: Head "https://registry-svc:5000/v2/foo/blobs/sha256:0443cbc5100eb115b6787f6233e4b00a731a6609c62a07a509bdb43083e61f55": http: server gave HTTP response to HTTPS client
------
 > importing cache manifest from registry-svc:5000/foo:latest:
------
------
 > exporting to image:
------
error: failed to solve: failed to do request: Head "https://registry-svc:5000/v2/foo/blobs/sha256:0443cbc5100eb115b6787f6233e4b00a731a6609c62a07a509bdb43083e61f55": http: server gave HTTP response to HTTPS client

I then stumbled upon #2044 and used the mentioned approach mounting a buildkit.toml file. My .toml file looks like this:

debug = false
[worker.containerd]
  namespace = "buildkit"
[registry."registry-svc:5000"]
  http = true
  insecure = true

It is mounted under /home/user/.config/buildkit/buildkit.toml.

However this results in the following error:

could not connect to unix:///run/user/1000/buildkit/buildkitd.sock after 10 trials
========== log ==========
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
main.main()
	/src/cmd/buildkitd/main.go:167 +0x13cc
[rootlesskit:child ] error: command [buildkitd --oci-worker-no-process-sandbox --addr=unix:///run/user/1000/buildkit/buildkitd.sock] exited: exit status 2
[rootlesskit:parent] error: child exited: exit status 2
sh: can't kill pid 9: No such process

Any idea what I might do wrong?

@cmdjulian cmdjulian changed the title Insecure push to registry push to insecure registry Jan 3, 2022
@AkihiroSuda AkihiroSuda changed the title push to insecure registry push to insecure registry (panic: runtime error: index out of range [0] with length 0) Jan 4, 2022
@tonistiigi
Copy link
Member

return cfg, nil
seems like the likely issue. You get some error when loading the config(maybe EPERM) and we don't seem to handle it properly.

@AkihiroSuda Any idea what the PathError check was about https://github.com/moby/buildkit/pull/896/files#diff-fb243a9185f7d24f7bfdf25097d6128f1b29b1a304bfc13d360667f8358551f6R299 ? Somewhat confused about the intent in here.

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

Successfully merging a pull request may close this issue.

3 participants