Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[20.10] Regression: detection of experimental --stream is incorrect #41647

Closed
thaJeztah opened this issue Nov 6, 2020 · 1 comment · Fixed by #41648
Closed

[20.10] Regression: detection of experimental --stream is incorrect #41647

thaJeztah opened this issue Nov 6, 2020 · 1 comment · Fixed by #41648
Labels
area/builder kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. status/needs-attention Calls for a collective discussion during a review session version/20.10
Milestone

Comments

@thaJeztah
Copy link
Member

relates to #39983
relates to docker-archive/docker-ce#660 (comment)
relates to docker/cli#2809

Looks like the report we received about the daemon producing an error about the experimental --stream option no longer being supported is not fixed yet (the fix in the CLI docker/cli#2809 is not sufficient, as older CLI's will fail)

I accidentally discovered how to reproduce:

Daemon (built from v20.10.0-beta1 tag) started without --experimental:

docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock docker:18.09 sh

echo "FROM scratch" | docker build -

Sending build context to Docker daemon  2.048kB
Step 1/1 : FROM scratch
 --->
No image was generated. Is your Dockerfile empty?

Daemon:

DEBU[2020-11-06T17:10:57.689685060Z] Calling POST /v1.39/build?buildargs={}&cachefrom=[]&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels={}&memory=0&memswap=0&networkmode=default&pull=1&q=1&rm=1&shmsize=0&target=&ulimits=null&version=1

Daemon, started with --experimental

docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock docker:18.09 sh

echo "FROM scratch" | docker build -
Sending build context to Docker daemon  2.048kB
Error response from daemon: experimental session with v1 builder is no longer supported, use builder version v2 (BuildKit) instead

Daemon:

DEBU[2020-11-06T17:06:11.433017409Z] Calling POST /v1.39/build?buildargs={}&cachefrom=[]&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels={}&memory=0&memswap=0&networkmode=default&pull=1&q=1&rm=1&session=btn05f8k6kkk2110fs3djyork&shmsize=0&target=&ulimits=null&version=1
DEBU[2020-11-06T17:06:11.434237792Z] Calling POST /session
INFO[2020-11-06T17:06:11.434395940Z] parsed scheme: ""                             module=grpc
INFO[2020-11-06T17:06:11.434453021Z] scheme "" not registered, fallback to default scheme  module=grpc
INFO[2020-11-06T17:06:11.434470626Z] ccResolverWrapper: sending update to cc: {[{  <nil> 0 <nil>}] <nil> <nil>}  module=grpc
INFO[2020-11-06T17:06:11.434477816Z] ClientConn switching balancer to "pick_first"  module=grpc
DEBU[2020-11-06T17:06:11.486615969Z] FIXME: Got an API for which error does not match any expected type!!!: experimental session with v1 builder is no longer supported, use builder version v2 (BuildKit) instead

(removed stack dump)

ERRO[2020-11-06T17:06:11.486694465Z] Handler for POST /v1.39/build returned error: experimental session with v1 builder is no longer supported, use builder version v2 (BuildKit) instead
DEBU[2020-11-06T17:06:11.486818111Z] FIXME: Got an API for which error does not match any expected type!!!: experimental session with v1 builder is no longer supported, use builder version v2 (BuildKit) instead

(removed stack dump)

WARN[2020-11-06T17:06:11.489208009Z] grpc: addrConn.createTransport failed to connect to {  <nil> 0 <nil>}. Err :connection error: desc = "transport: Error while dialing only one connection allowed". Reconnecting...  module=grpc

⚠️ Notice that the CLI sends session=btn05f8k6kkk2110fs3djyork, even without it having the --stream option set, so for some reason, it looks for the daemon to be experimental, and in that case, sends a session-id

Trying with explicit --stream:

echo "FROM scratch" | docker build --stream -
failed to open Dockerfile: open Dockerfile: no such file or directory

echo "FROM scratch" | docker build --stream=true -
failed to open Dockerfile: open Dockerfile: no such file or directory

That looks like another bug, but working around that by using a Dockerfile instead of stdin;

echo "FROM scratch" > Dockerfile

docker build --stream .
Error response from daemon: experimental session with v1 builder is no longer supported, use builder version v2 (BuildKit) instead
# without --stream
Calling POST /v1.39/build?buildargs={}&cachefrom=[]&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels={}&memory=0&memswap=0&networkmode=default&pull=1&q=1&rm=1&session=btn05f8k6kkk2110fs3djyork&shmsize=0&target=&ulimits=null&version=1

# With --stream
Calling POST /v1.39/build?buildargs={}&cachefrom=[]&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels={}&memory=0&memswap=0&networkmode=default&remote=client-session&rm=1&session=361whphfmy9h8g4u5kd2zjayi&shmsize=0&target=&ulimits=null&version=1

⚠️ So, with --stream, the remote=client-session is set: perhaps set should produce an error for that parameter instead?

@thaJeztah thaJeztah added kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. status/needs-attention Calls for a collective discussion during a review session area/builder version/20.10 labels Nov 6, 2020
@thaJeztah thaJeztah added this to the 20.10.0 milestone Nov 6, 2020
@thaJeztah
Copy link
Member Author

(I used the 18.09 cli when reproducing, to make sure it's not a recent regression in the CLI code)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/builder kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. status/needs-attention Calls for a collective discussion during a review session version/20.10
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant