buildx icon indicating copy to clipboard operation
buildx copied to clipboard

buildx failed with: ERROR: failed to solve: invalid user index: -1

Open inductor opened this issue 3 years ago • 3 comments

Hello,

I'm using buildx on GHA and I get the following error. I've never seen this but does anyone know what's causing this?

ref. https://github.com/mastodon/mastodon/actions/runs/3470550179/jobs/5798997043

inductor avatar Nov 15 '22 13:11 inductor

This seems related to https://github.com/moby/buildkit/issues/2987.

I think it should work if replaced with the numerical UID - but as mentioned in the replies there, it's not supported to use --chown with names and --link together based on how --link works.

Your error message is definitely quite horrible though, I think it should be possible to improve.

jedevc avatar Nov 15 '22 13:11 jedevc

I ran into the same error, and didn't see this issue when I searched for some reason :sweat_smile:

I've shared full logs if helpful as I know linking to CI run logs becomes an invalid link eventually. ~~I am able to use --chown with --link together with just BuildKit, but noticed it's failing with buildx and the docker-container driver.~~

UPDATE: This was a misunderstanding on my part. I didn't realize Docker Engine 20.10.22 from Dec 2022 still used BuildKit 0.8.4 from Apr 2021

I think it should work if replaced with the numerical UID

Numeric ID values do work :+1:

it's not supported to use --chown with names and --link together based on how --link works.

It'd be helpful if docs could highlight that.

There is no mention of them being incompatible, just about knowledge of prior layer state (which at the time was a tad vague for me to realize that affected lookup of /etc/passwd from a base image as well. I thought it only meant about target destination to copy to).


I've roughly documented two workarounds if it's helpful to anyone :)

polarathene avatar Jan 19 '23 07:01 polarathene

If anyone wonders: This issue is still around. It seems that my default settings use the legacy builder for Docker Compose which is fine to use both --link and --chown but not the CI pipeline i use, which forces buildx.