Open Ebaneck opened 1 week ago
Does it work with the default cache server?
Does it work with the default cache server?
Hello @LouisHaftmann Yes, I can confirm it works.
The docker builder in your workflow for some reason does a GET request instead of POST. Looking at the source code of https://github.com/moby/buildkit, I noticed that it actually does a POST request (https://github.com/moby/buildkit/blob/f7bda278b7e2d1de3d8e3f69c51f967fccf6f55b/vendor/github.com/tonistiigi/go-actions-cache/cache.go#L244). So this either is a bug in our http method matching or the docker/build-push-action
action is not using the default moby/buildkit.
For now you could try updating docker/build-push-action
. Maybe that fixes the problem.
I tried both v3, v4 and v6 of docker/build-push-action
and still no luck.
Seems related: https://github.com/moby/buildkit/issues/4961
A bit more logs if this helps:
time="2024-07-03T10:08:39Z" level=debug msg="load cache http://cache-server:3000/<random-token>/_apis/artifactcache/cache?keys=buildkit-blob-1-sha256%3A0d4c623e273569ef3d9b7f89142096b564f2557d3e909413fa233bbe23f3aeca&version=693bb7016429d80366022f036f84856888c9f13e00145f5f6f4dce303a38d6f2"
time="2024-07-03T10:08:39Z" level=debug msg="save cache req http://cache-server:3000/<random-token>/_apis/artifactcache/caches body={\"key\":\"buildkit-blob-1-sha256:0d4c623e273569ef3d9b7f89142096b564f2557d3e909413fa233bbe23f3aeca\",\"version\":\"693bb7016429d80366022f036f84856888c9f13e00145f5f6f4dce303a38d6f2\"}"
time="2024-07-03T10:08:39Z" level=error msg="/moby.buildkit.v1.Control/Solve returned error: rpc error: code = Unknown desc = error writing layer blob: Method get is not allowed on this route."
error writing layer blob: Method get is not allowed on this route.
7 v0.13.2 buildkitd --debug --allow-insecure-entitlement=network.host
github.com/tonistiigi/go-actions-cache.checkResponse
/src/vendor/github.com/tonistiigi/go-actions-cache/cache.go:617
github.com/tonistiigi/go-actions-cache.(*Cache).doWithRetries
/src/vendor/github.com/tonistiigi/go-actions-cache/cache.go:453
github.com/tonistiigi/go-actions-cache.(*Cache).reserve
/src/vendor/github.com/tonistiigi/go-actions-cache/cache.go:246
github.com/tonistiigi/go-actions-cache.(*Cache).Save
/src/vendor/github.com/tonistiigi/go-actions-cache/cache.go:320
github.com/moby/buildkit/cache/remotecache/gha.(*exporter).Finalize
/src/cache/remotecache/gha/gha.go:174
github.com/moby/buildkit/solver/llbsolver.runCacheExporters.func1.1
/src/solver/llbsolver/solver.go:663
github.com/moby/buildkit/solver/llbsolver.inBuilderContext.func1
/src/solver/llbsolver/solver.go:996
github.com/moby/buildkit/solver.(*Job).InContext
/src/solver/jobs.go:683
github.com/moby/buildkit/solver/llbsolver.inBuilderContext
/src/solver/llbsolver/solver.go:992
github.com/moby/buildkit/solver/llbsolver.runCacheExporters.func1
/src/solver/llbsolver/solver.go:644
golang.org/x/sync/errgroup.(*Group).Go.func1
/src/vendor/golang.org/x/sync/errgroup/errgroup.go:75
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1650
7 v0.13.2 buildkitd --debug --allow-insecure-entitlement=network.host
github.com/tonistiigi/go-actions-cache.(*Cache).reserve
/src/vendor/github.com/tonistiigi/go-actions-cache/cache.go:248
github.com/tonistiigi/go-actions-cache.(*Cache).Save
/src/vendor/github.com/tonistiigi/go-actions-cache/cache.go:320
github.com/moby/buildkit/cache/remotecache/gha.(*exporter).Finalize
/src/cache/remotecache/gha/gha.go:174
github.com/moby/buildkit/solver/llbsolver.runCacheExporters.func1.1
/src/solver/llbsolver/solver.go:663
github.com/moby/buildkit/solver/llbsolver.inBuilderContext.func1
/src/solver/llbsolver/solver.go:996
github.com/moby/buildkit/solver.(*Job).InContext
/src/solver/jobs.go:683
github.com/moby/buildkit/solver/llbsolver.inBuilderContext
/src/solver/llbsolver/solver.go:992
github.com/moby/buildkit/solver/llbsolver.runCacheExporters.func1
/src/solver/llbsolver/solver.go:644
golang.org/x/sync/errgroup.(*Group).Go.func1
/src/vendor/golang.org/x/sync/errgroup/errgroup.go:75
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1650
7 v0.13.2 buildkitd --debug --allow-insecure-entitlement=network.host
github.com/moby/buildkit/cache/remotecache/gha.(*exporter).Finalize
/src/cache/remotecache/gha/gha.go:176
github.com/moby/buildkit/solver/llbsolver.runCacheExporters.func1.1
/src/solver/llbsolver/solver.go:663
github.com/moby/buildkit/solver/llbsolver.inBuilderContext.func1
/src/solver/llbsolver/solver.go:996
github.com/moby/buildkit/solver.(*Job).InContext
/src/solver/jobs.go:683
github.com/moby/buildkit/solver/llbsolver.inBuilderContext
/src/solver/llbsolver/solver.go:992
github.com/moby/buildkit/solver/llbsolver.runCacheExporters.func1
/src/solver/llbsolver/solver.go:644
golang.org/x/sync/errgroup.(*Group).Go.func1
/src/vendor/golang.org/x/sync/errgroup/errgroup.go:75
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1650
7 v0.13.2 buildkitd --debug --allow-insecure-entitlement=network.host
main.unaryInterceptor.func1
/src/cmd/buildkitd/main.go:711
main.main.func3.ChainUnaryServer.func2.1.1
/src/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25
main.main.func3.ChainUnaryServer.func2
/src/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:34
github.com/moby/buildkit/api/services/control._Control_Solve_Handler
/src/api/services/control/control.pb.go:2466
google.golang.org/grpc.(*Server).processUnaryRPC
/src/vendor/google.golang.org/grpc/server.go:1343
google.golang.org/grpc.(*Server).handleStream
/src/vendor/google.golang.org/grpc/server.go:1737
google.golang.org/grpc.(*Server).serveStreams.func1.1
/src/vendor/google.golang.org/grpc/server.go:986
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1650
i'll look into it
Current setup:
Cache server logs:
Actions logs: