Closed gaocegege closed 2 years ago
And, when the docker client fails to create, there may be two errors in the err group. Then the program will hang.
The buildkitd solve goroutine hangs because of canceled context. I'm not sure why it happens.
DEBU[2022-04-22T09:59:53+08:00] rule `base` is invoked, os=ubuntu, language=python3
DEBU[2022-04-22T09:59:53+08:00] Loading image to docker host
DEBU[2022-04-22T09:59:53+08:00] serving grpc connection
DEBU[2022-04-22T09:59:53+08:00] &{resolve docker.io/library/python:3.8 sha256:5123ba160cbbb112c338edc4652315c45ab865a9f928793d65318490e19b2893 0 0 2022-04-22 01:59:53.513009245 +0000 UTC 2022-04-22 01:5
9:53.513008595 +0000 UTC <nil>}
DEBU[2022-04-22T09:59:56+08:00] &{resolve docker.io/library/python:3.8 sha256:5123ba160cbbb112c338edc4652315c45ab865a9f928793d65318490e19b2893 0 0 2022-04-22 01:59:56.359769311 +0000 UTC 2022-04-22 01:5
9:53.513008595 +0000 UTC 2022-04-22 01:59:56.359768781 +0000 UTC}
DEBU[2022-04-22T09:59:56+08:00] &{exporting layers sha256:69a2560eef4d3ece902c3b5149d142e9bd132f25db0bc9e35b94201534c415d2 0 0 2022-04-22 01:59:56.361689169 +0000 UTC 2022-04-22 01:59:56.361688769 +0000
UTC <nil>}
DEBU[2022-04-22T09:59:56+08:00] &{exporting layers sha256:69a2560eef4d3ece902c3b5149d142e9bd132f25db0bc9e35b94201534c415d2 0 0 2022-04-22 01:59:56.362180578 +0000 UTC 2022-04-22 01:59:56.361688769 +0000
UTC 2022-04-22 01:59:56.362180208 +0000 UTC}
DEBU[2022-04-22T09:59:56+08:00] &{exporting manifest sha256:41b2664edd4123c1495dcb3099a7f0d35fc55f516ef49c4b583039e97bc28064 sha256:69a2560eef4d3ece902c3b5149d142e9bd132f25db0bc9e35b94201534c415d2 0 0 2
022-04-22 01:59:56.362338968 +0000 UTC 2022-04-22 01:59:56.362338098 +0000 UTC <nil>}
DEBU[2022-04-22T09:59:56+08:00] &{exporting manifest sha256:41b2664edd4123c1495dcb3099a7f0d35fc55f516ef49c4b583039e97bc28064 sha256:69a2560eef4d3ece902c3b5149d142e9bd132f25db0bc9e35b94201534c415d2 0 0 2
022-04-22 01:59:56.368871499 +0000 UTC 2022-04-22 01:59:56.362338098 +0000 UTC 2022-04-22 01:59:56.368870939 +0000 UTC}
DEBU[2022-04-22T09:59:56+08:00] &{exporting config sha256:aa2c12f50f398dd63de640cbc28011c821767f1f67a35e26d79ca9fdcebfd121 sha256:69a2560eef4d3ece902c3b5149d142e9bd132f25db0bc9e35b94201534c415d2 0 0 202
2-04-22 01:59:56.368881129 +0000 UTC 2022-04-22 01:59:56.368880749 +0000 UTC <nil>}
DEBU[2022-04-22T09:59:56+08:00] &{exporting config sha256:aa2c12f50f398dd63de640cbc28011c821767f1f67a35e26d79ca9fdcebfd121 sha256:69a2560eef4d3ece902c3b5149d142e9bd132f25db0bc9e35b94201534c415d2 0 0 202
2-04-22 01:59:56.375795609 +0000 UTC 2022-04-22 01:59:56.368880749 +0000 UTC 2022-04-22 01:59:56.375795159 +0000 UTC}
DEBU[2022-04-22T09:59:56+08:00] &{sending tarball sha256:69a2560eef4d3ece902c3b5149d142e9bd132f25db0bc9e35b94201534c415d2 0 0 2022-04-22 01:59:56.376475518 +0000 UTC 2022-04-22 01:59:56.376475008 +0000
UTC <nil>}
ERRO[2022-04-22T09:59:56+08:00] failed to load docker image: Error response from daemon: client version 1.42 is too new. Maximum supported API version is 1.41
DEBU[2022-04-22T09:59:56+08:00] cancelling the error group
DEBU[2022-04-22T09:59:56+08:00] stopping session
2022/04/22 09:59:56 http2: server connection error from localhost: connection error: PROTOCOL_ERROR
# Hang here
buildkit log
DEBU[2022-04-22T09:56:44+08:00] session started
DEBU[2022-04-22T09:56:44+08:00] resolving host=docker.mirrors.sjtug.sjtu.edu.cn
DEBU[2022-04-22T09:56:44+08:00] do request host=docker.mirrors.sjtug.sjtu.edu.cn request.header.accept="application/vnd.docker.distribution.manifest.v2+json, applicatio
n/vnd.docker.distribution.manifest.list.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.oci.image.index.v1+json, */*" request.header.user-agent=buildkit/0.0.0+unknown request.method=
HEAD url="https://docker.mirrors.sjtug.sjtu.edu.cn/v2/library/python/manifests/3.8?ns=docker.io"
DEBU[2022-04-22T09:56:45+08:00] fetch response received host=docker.mirrors.sjtug.sjtu.edu.cn response.header.content-length=1862 response.header.content-type=application/vnd.docker
.distribution.manifest.list.v2+json response.header.date="Fri, 22 Apr 2022 01:56:45 GMT" response.header.docker-content-digest="sha256:419fa742372dedf26f09a1ff15751c178d9069e7add37c7d943821d5d77c083c" re
sponse.header.docker-distribution-api-version=registry/2.0 response.header.etag="\"sha256:419fa742372dedf26f09a1ff15751c178d9069e7add37c7d943821d5d77c083c\"" response.header.server=Caddy response.header.
x-sjtug-mirror-id=zhiyuan response.status="200 OK" url="https://docker.mirrors.sjtug.sjtu.edu.cn/v2/library/python/manifests/3.8?ns=docker.io"
DEBU[2022-04-22T09:56:45+08:00] resolved desc.digest="sha256:419fa742372dedf26f09a1ff15751c178d9069e7add37c7d943821d5d77c083c" host=docker.mirrors.sjtug.sjtu.edu.cn
DEBU[2022-04-22T09:56:45+08:00] fetch digest="sha256:419fa742372dedf26f09a1ff15751c178d9069e7add37c7d943821d5d77c083c" mediatype=application/vnd.docker.distributio
n.manifest.list.v2+json size=1862
DEBU[2022-04-22T09:56:45+08:00] fetch digest="sha256:1b5da60b78075e88141b5d61bbb29e0d312c1029f9932628e1ccad35ac852956" mediatype=application/vnd.docker.distributio
n.manifest.v2+json size=2218
DEBU[2022-04-22T09:56:45+08:00] fetch digest="sha256:63c8db7db03982b75dddec6c6650f78376ab31cc196473bca77976f14e9cb8a4" mediatype=application/vnd.docker.container.i
mage.v1+json size=8560
DEBU[2022-04-22T09:56:45+08:00] load cache for docker-image://docker.io/library/python:3.8 with exb43yk9k4khc3rdbhzlg60ev::syckcmd3d6aw8d44ot23xn1w1
DEBU[2022-04-22T09:56:45+08:00] session finished: <nil>
ERRO[2022-04-22T09:56:45+08:00] /moby.buildkit.v1.Control/Solve returned error: rpc error: code = Canceled desc = context canceled
DEBU[2022-04-22T09:56:46+08:00] remove content key="sha256:41b2664edd4123c1495dcb3099a7f0d35fc55f516ef49c4b583039e97bc28064"
DEBU[2022-04-22T09:56:46+08:00] remove content key="sha256:aa2c12f50f398dd63de640cbc28011c821767f1f67a35e26d79ca9fdcebfd121"
DEBU[2022-04-22T09:56:46+08:00] schedule content cleanup
DEBU[2022-04-22T09:56:46+08:00] removed content digest="sha256:41b2664edd4123c1495dcb3099a7f0d35fc55f516ef49c4b583039e97bc28064"
DEBU[2022-04-22T09:56:46+08:00] removed content digest="sha256:aa2c12f50f398dd63de640cbc28011c821767f1f67a35e26d79ca9fdcebfd121"
DEBU[2022-04-22T09:56:46+08:00] content garbage collected d="496.779µs"
Description
We need to init a docker client to load the image into the docker host. But we may got the error here
We should suggest setting the envvar DOCKER_API_VERSION to avoid the issue when encountering this.
export DOCKER_API_VERSION=1.41