You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running a build command where the cache-from and cache-to point to different locations in the same S3 bucket and the cache-from location contains a complete match causes build to fail with a SIGSEGV.
I've included what I believe is the relevant information below. Please let me know if you need anything else.
Command used
Below is the command used, with the env and project names changed
The cache-to location in the bucket contains some of the layers but no manifest file. My guess would be that the connection to the bucket closes after the cache is read but before the cache can finish being written.
Here's the buildkit logs
##[debug]Exec.getExecOutput: docker logs buildx_buildkit_builder-4ad53ab7-9202-4911-a131-36db5f768a150
/usr/bin/docker logs buildx_buildkit_builder-4ad53ab7-9202-4911-a131-36db5f768a150
time="2024-12-10T11:06:39Z" level=info msg="auto snapshotter: using overlayfs"
time="2024-12-10T11:06:39Z" level=warning msg="using host network as the default"
time="2024-12-10T11:06:39Z" level=info msg="found worker \"9u1if5c61ym0e9e4vi5yaafwp\", labels=map[org.mobyproject.buildkit.worker.executor:oci org.mobyproject.buildkit.worker.hostname:323be59ce4fc org.mobyproject.buildkit.worker.network:host org.mobyproject.buildkit.worker.oci.process-mode:sandbox org.mobyproject.buildkit.worker.selinux.enabled:false org.mobyproject.buildkit.worker.snapshotter:overlayfs], platforms=[linux/amd64 linux/amd64/v2 linux/amd64/v3 linux/386]"
time="2024-12-10T11:06:39Z" level=warning msg="skipping containerd worker, as \"/run/containerd/containerd.sock\" does not exist"
time="2024-12-10T11:06:39Z" level=info msg="found 1 workers, default=\"9u1if5c61ym0e9e4vi5yaafwp\""
time="2024-12-10T11:06:39Z" level=warning msg="currently, only the default worker can be used."
time="2024-12-10T11:06:39Z" level=info msg="running server on /run/buildkit/buildkitd.sock"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x132332b]
goroutine 22972 [running]:
github.com/moby/buildkit/cache/remotecache/s3.(*readerAtCloser).ReadAt(0xc003523dc0, {0xc003d14000, 0x8000, 0x8000}, 0xc000)
/src/cache/remotecache/s3/readerat.go:52 +0x1cb
io.(*SectionReader).ReadAt(0x45834?, {0xc003d14000?, 0xc001958408?, 0xc003dc9800?}, 0x0?)
/usr/local/go/src/io/io.go:555 +0x93
io.(*SectionReader).Read(0xc003569320, {0xc003d14000?, 0xc003d14000?, 0x8000?})
/usr/local/go/src/io/io.go:516 +0x4f
github.com/aws/smithy-go/transport/http/internal/io.(*safeReadCloser).Read(0x477dc9?, {0xc003d14000?, 0xc003dc9938?, 0xc003dc9928?})
/src/vendor/github.com/aws/smithy-go/transport/http/internal/io/safe.go:59 +0x117
io.(*LimitedReader).Read(0xc003804f48, {0xc003d14000?, 0x8000?, 0x8000?})
/usr/local/go/src/io/io.go:479 +0x43
io.copyBuffer({0x7f12a5f9ae90, 0xc002d81508}, {0x1ed3220, 0xc003804f48}, {0x0, 0x0, 0x0})
/usr/local/go/src/io/io.go:429 +0x191
io.Copy(...)
/usr/local/go/src/io/io.go:388
net/http.persistConnWriter.ReadFrom({0x2be4920?}, {0x1ed3220?, 0xc003804f48?})
/usr/local/go/src/net/http/transport.go:1899 +0x5b
bufio.(*Writer).ReadFrom(0xc0036fcec0, {0x1ed3220, 0xc003804f48})
/usr/local/go/src/bufio/bufio.go:794 +0x17c
io.copyBuffer({0x1ed3520, 0xc0036fcec0}, {0x1ed3220, 0xc003804f48}, {0xc003cc6000, 0x8000, 0x8000})
/usr/local/go/src/io/io.go:415 +0x151
io.CopyBuffer({0x1ed3520?, 0xc0036fcec0?}, {0x1ed3220?, 0xc003804f48?}, {0xc003cc6000?, 0x1992460?, 0xc000b32e08?})
/usr/local/go/src/io/io.go:402 +0x36
net/http.(*transferWriter).doBodyCopy(0xc00357efa0, {0x1ed3520, 0xc0036fcec0}, {0x1ed3220, 0xc003804f48})
/usr/local/go/src/net/http/transfer.go:416 +0xe5
net/http.(*transferWriter).writeBody(0xc00357efa0, {0x1ed3520, 0xc0036fcec0})
/usr/local/go/src/net/http/transfer.go:371 +0x366
net/http.(*Request).write(0xc003811a40, {0x1ed3520, 0xc0036fcec0}, 0x0, 0x0, 0x0)
/usr/local/go/src/net/http/request.go:771 +0xaed
net/http.(*persistConn).writeLoop(0xc002e38fc0)
/usr/local/go/src/net/http/transport.go:2522 +0x174
created by net/http.(*Transport).dialConn in goroutine 23010
/usr/local/go/src/net/http/transport.go:1875 +0x15a5
time="2024-12-10T11:09:17Z" level=info msg="auto snapshotter: using overlayfs"
time="2024-12-10T11:09:17Z" level=warning msg="using host network as the default"
time="2024-12-10T11:09:17Z" level=info msg="found worker \"9u1if5c61ym0e9e4vi5yaafwp\", labels=map[org.mobyproject.buildkit.worker.executor:oci org.mobyproject.buildkit.worker.hostname:323be59ce4fc org.mobyproject.buildkit.worker.network:host org.mobyproject.buildkit.worker.oci.process-mode:sandbox org.mobyproject.buildkit.worker.selinux.enabled:false org.mobyproject.buildkit.worker.snapshotter:overlayfs], platforms=[linux/amd64 linux/amd64/v2 linux/amd64/v3 linux/386]"
time="2024-12-10T11:09:17Z" level=warning msg="skipping containerd worker, as \"/run/containerd/containerd.sock\" does not exist"
time="2024-12-10T11:09:17Z" level=info msg="found 1 workers, default=\"9u1if5c61ym0e9e4vi5yaafwp\""
time="2024-12-10T11:09:17Z" level=warning msg="currently, only the default worker can be used."
time="2024-12-10T11:09:17Z" level=info msg="running server on /run/buildkit/buildkitd.sock"
::endgroup::
Running a build command where the cache-from and cache-to point to different locations in the same S3 bucket and the cache-from location contains a complete match causes build to fail with a SIGSEGV.
I've included what I believe is the relevant information below. Please let me know if you need anything else.
Command used
Below is the command used, with the env and project names changed
/usr/bin/docker buildx build --build-arg AGENT_VERSION=7.56.2 --cache-from type=s3,blobs_prefix=cache/docker/env-a/project-a/,manifests_prefix=cache/docker/env-a/project-a/,region=eu-west-2,bucket=gha-cache --cache-to type=s3,blobs_prefix=cache/docker/env-b/project-a/,manifests_prefix=cache/docker/env-b/project-a/,region=eu-west-2,bucket=gha-cache,mode=max --file dockerfiles/project-a/Dockerfile --iidfile /tmp/docker-build-push-SVUVoD/iidfile --tag 123456789.dkr.ecr.eu-west-2.amazonaws.com/services/project-a:7.56.2 --load --metadata-file /tmp/docker-build-push-SVUVoD/metadata-file .
My actual build uses two cache-from directives, one for env-a and one for env-b. This is just a minimum reproduction.
Environment
The build happens in Github Actions ubuntu-latest.
Buildkit version is v0.18.1.
Here is the debug output from the docker/setup-buildx-action@v3 action.
Logs
The error is
and it gets emitted from
The cache-to location in the bucket contains some of the layers but no manifest file. My guess would be that the connection to the bucket closes after the cache is read but before the cache can finish being written.
Here's the buildkit logs
Here's the relevant parts from the build process
The text was updated successfully, but these errors were encountered: