moby / buildkit

concurrent, cache-efficient, and Dockerfile-agnostic builder toolkit
https://github.com/moby/moby/issues/34227
Apache License 2.0
8.17k stars 1.16k forks source link

buildkit issue build command #1222

Open rajibmitra opened 5 years ago

rajibmitra commented 5 years ago

Hi,

I am trying to execute the below command :

buildctl build --local dockerfile=. --frontend=dockerfile.v0

And I am getting this below error :

[+] Building 0.0s (0/0)
error: failed to get status: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: error while dialing: dial unix /run/buildkit/buildkitd.sock: connect: no such file or directory"

Let me know how can I fix this issue, thanks.

AkihiroSuda commented 5 years ago

buildkitd daemon running?

rajibmitra commented 5 years ago

yes its running.

AkihiroSuda commented 5 years ago

Daemon log?

bokysan commented 4 years ago

I'm also running into this issue quite often.

Build in buildctl would complete and fail near the end:

656 #24 556.3 Installing initially failed dependencies…
657 #24 DONE 561.9s
658 #25 [requirements 6/7] COPY files/ipfshttpclient.patch /tmp/ipfshttpclient.p...
659 #25 DONE 2.9s
660 #26 [requirements 7/7] RUN     cd /app/.venv/lib/pyth...
661 #26 0.136 patching file ipfshttpclient/multipart.py
662 #26 DONE 0.2s
663 error: failed to receive status: rpc error: code = Unavailable desc = transport is closing

Buildkit daemon does have one error in the log (although this has happened more than once):

time="2020-01-22T13:03:38Z" level=error msg="
/moby.buildkit.v1.Control/Solve returned error: rpc error: code = Canceled desc = grpc: the client connection is closing
failed to copy
github.com/containerd/containerd/content.Copy
    /src/vendor/github.com/containerd/containerd/content/helpers.go:148
github.com/containerd/containerd/remotes.fetch
    /src/vendor/github.com/containerd/containerd/remotes/handlers.go:133
github.com/containerd/containerd/remotes.FetchHandler.func1
    /src/vendor/github.com/containerd/containerd/remotes/handlers.go:95
github.com/moby/buildkit/util/contentutil.Copy
    /src/util/contentutil/copy.go:16
github.com/moby/buildkit/cache/remotecache.export
    /src/cache/remotecache/export.go:95
github.com/moby/buildkit/cache/remotecache.(*contentCacheExporter).Finalize
    /src/cache/remotecache/export.go:65
github.com/moby/buildkit/solver/llbsolver.(*Solver).Solve.func3
    /src/solver/llbsolver/solver.go:219
github.com/moby/buildkit/solver/llbsolver.inVertexContext
    /src/solver/llbsolver/solver.go:334
github.com/moby/buildkit/solver/llbsolver.(*Solver).Solve
    /src/solver/llbsolver/solver.go:206
github.com/moby/buildkit/control.(*Controller).Solve
    /src/control/control.go:276
github.com/moby/buildkit/api/services/control._Control_Solve_Handler.func1
    /src/api/services/control/control.pb.go:1364
github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1
    /src/vendor/github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc/server.go:57
main.unaryInterceptor.func1
    /src/cmd/buildkitd/main.go:529
github.com/moby/buildkit/api/services/control._Control_Solve_Handler
    /src/api/services/control/control.pb.go:1366
google.golang.org/grpc.(*Server).processUnaryRPC
    /src/vendor/google.golang.org/grpc/server.go:995
google.golang.org/grpc.(*Server).handleStream
    /src/vendor/google.golang.org/grpc/server.go:1275
google.golang.org/grpc.(*Server).serveStreams.func1.1
    /src/vendor/google.golang.org/grpc/server.go:710
runtime.goexit
    /usr/local/go/src/runtime/asm_amd64.s:1337
error writing layer blob
github.com/moby/buildkit/cache/remotecache.export
    /src/cache/remotecache/export.go:96
github.com/moby/buildkit/cache/remotecache.(*contentCacheExporter).Finalize
    /src/cache/remotecache/export.go:65
github.com/moby/buildkit/solver/llbsolver.(*Solver).Solve.func3
    /src/solver/llbsolver/solver.go:219
github.com/moby/buildkit/solver/llbsolver.inVertexContext
    /src/solver/llbsolver/solver.go:334
github.com/moby/buildkit/solver/llbsolver.(*Solver).Solve
    /src/solver/llbsolver/solver.go:206
github.com/moby/buildkit/control.(*Controller).Solve
    /src/control/control.go:276
github.com/moby/buildkit/api/services/control._Control_Solve_Handler.func1
    /src/api/services/control/control.pb.go:1364
github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1
    /src/vendor/github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc/server.go:57
main.unaryInterceptor.func1
    /src/cmd/buildkitd/main.go:529
github.com/moby/buildkit/api/services/control._Control_Solve_Handler
    /src/api/services/control/control.pb.go:1366
google.golang.org/grpc.(*Server).processUnaryRPC
    /src/vendor/google.golang.org/grpc/server.go:995
google.golang.org/grpc.(*Server).handleStream
    /src/vendor/google.golang.org/grpc/server.go:1275
google.golang.org/grpc.(*Server).serveStreams.func1.1
    /src/vendor/google.golang.org/grpc/server.go:710
runtime.goexit
    /usr/local/go/src/runtime/asm_amd64.s:1337"

buildkitd (master) is deployed in Kubernetes + Calico and buildctl is executed from another pod:

          image: moby/buildkit:master
          args:
            - --oci-worker-rootless
            - --oci-worker-no-process-sandbox
            - --allow-insecure-entitlement
            - network.host
            - --addr
            - unix:///run/user/1000/buildkit/buildkitd.sock
            - --addr
            - tcp://0.0.0.0:1234
vitaliy-guliy commented 4 years ago

@bokysan are you lucky with the build? I have the same error when trying to run the buildctl, which is in moby/buildkit:rootless docker image.

Used kubernetes running in local minikube.

It looks like the buildkit cannot create a directory with a file in /run/user/1000/. I just wonder, will help creating this directory by hands and getting it the writing permissions or not..

Screenshot from 2020-04-29 11-44-57

bokysan commented 4 years ago

Nope, issue still happens from time to time. :(

AkihiroSuda commented 4 years ago

It seems multiple issues with different error logs are mixed up in this ticket.

Please open new issues with full repro steps