moby / moby/buildkit

Panic during build

Open
#3,085 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/bug
Dominant language
Go
Stars
10.3k
Forks
1.5k
Avg merge
1d 23h
Merged PRs (30d)
48

Description

Context: a docker compose build on a fresh checkout of a project. Some images were pulling, presumably something timed out when authenticating?

Hoping you can see what's happened from the line numbers maybe

 => => transferring context: 2B                                                                                                                                        0.0s
panic: send on closed channelrunner runtime_base  1/11] FROM public.ecr.aws/lambda/provided                                                                            0.0s
 => [[REDACTED]-mysql internal] load metadata for [REDACTED]/mysql:develop                                               1.7s
goroutine 466 [running]:tification-api-mock internal] load metadata for docker.io/wiremock/wiremock:2.31.0                                                             1.2s
github.com/docker/buildx/util/progress.(*Printer).Write(0x140001e7701?, 0x10142659c?)                                                                                  0.0s
 => [autgithub.com/docker/buildx@v0.8.2/util/progress/printer.go:41 +0x2c                                                                                              0.0s
github.com/docker/buildx/build.Build.func3(0x1014d8ee3?)da-layer-cache:pull token for [REDACTED]                                                      0.0s
 => [autgithub.com/docker/buildx@v0.8.2/build/build.go:681 +0x34 => [[REDACTED]-mysql internal] load .dockerignore                                                                                                          0.0s

github.com/moby/buildkit/util/progress/progresswriter.Wrap({0x140006e6770, 0x6d}, 0x1400000ca38, 0x140001e7920)
        github.com/moby/buildkit@v0.10.1-0.20220403220257-10e6f94bf90d/util/progress/progresswriter/progress.go: => => transferring context: 2B                                                                                                                                        0.0s
24 +0x1c8
github.com/moby/buildkit/session/auth/authprovider.(*authProvider).Fetch => [[REDACTED]_lambda-runner internal] load metadata for public.ecr.aws/lambda/provided:latest                                                                  0.0s
(0x14000240990, {0x1019a35c8, 0x1400045eae0}, 0x140002bfbc0)
        github.com/moby/buildkit@v0.10.1-0.20220403220257-10e6f94bf90d/session/auth/authprovider/authprovider.go:88 +0x364
github.com/moby/buildkit/session/auth._Auth_FetchToken_Handler.func1({0x1019a35c8, 0x1400045eae0}, {0x101951b40?, 0x140002bfbc0})
        github.com/moby/buildkit@v0.10.1-0.20220403220257-10e6f94bf90d/session/auth/auth.pb.go:954 +0x78
github.com/moby/buildkit/util/grpcerrors.UnaryServerInterceptor({0x1019a35c8?, 0x1400045eae0?}, {0x101951b40?, 0x140002bfbc0?}, 0x14000746ad8?, 0x101170b08?)
        github.com/moby/buildkit@v0.10.1-0.20220403220257-10e6f94bf90d/util/grpcerrors/intercept.go:14 +0x38
github.com/moby/buildkit/session/auth._Auth_FetchToken_Handler({0x1018d66c0?, 0x14000240990}, {0x1019a35c8, 0x1400045eae0}, 0x140002bfb60, 0x10198f0e0)
        github.com/moby/buildkit@v0.10.1-0.20220403220257-10e6f94bf90d/session/auth/auth.pb.go:956 +0x13c
google.golang.org/grpc.(*Server).processUnaryRPC(0x140001d8000, {0x1019a88f8, 0x1400072fcb0}, 0x140000d9e60, 0x14000343620, 0x10218d718, 0x0)
        google.golang.org/grpc@v1.45.0/server.go:1282 +0xb3c
google.golang.org/grpc.(*Server).handleStream(0x140001d8000, {0x1019a88f8, 0x1400072fcb0}, 0x140000d9e60, 0x0)
        google.golang.org/grpc@v1.45.0/server.go:1619 +0x840
google.golang.org/grpc.(*Server).serveStreams.func1.2()
        google.golang.org/grpc@v1.45.0/server.go:921 +0x88
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/grpc@v1.45.0/server.go:919 +0x298
make: *** [test] Error 2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the stack frames in util/progress/printer.go, build/build.go, and session/auth/authprovider.go, then reproduce the fresh-checkout docker compose build described in the report. Check how authentication and progress output interact when image metadata requests time out; done means the build no longer panics during that failure path.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose, go
Domain
build-system, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.