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

Latest stable (2.5.0.1) breaks the chunking handling in case of an error #5059

Closed
1 of 2 tasks
bsideup opened this issue Nov 11, 2020 · 5 comments
Closed
1 of 2 tasks

Comments

@bsideup
Copy link

bsideup commented Nov 11, 2020

  • I have tried with the latest version of my channel (Stable or Edge)
  • I have uploaded Diagnostics

Expected behavior

HTTP error response is sent correctly

Actual behavior

transfer closed with outstanding read data remaining

Information

Steps to reproduce the behavior

$ curl -v --unix-socket /var/run/docker.sock http://localhost/containers/abcd/json
*   Trying /var/run/docker.sock...
* Connected to localhost (docker.sock) port 80 (#0)
> GET /containers/abcd/json HTTP/1.1
> Host: localhost
> User-Agent: curl/7.64.1
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Api-Version: 1.40
< Content-Type: application/json
< Date: Wed, 11 Nov 2020 13:51:38 GMT
< Docker-Experimental: false
< Ostype: linux
< Server: Docker/19.03.13 (linux)
< Transfer-Encoding: chunked
<
* transfer closed with outstanding read data remaining
* Closing connection 0
curl: (18) transfer closed with outstanding read data remaining

(note that it inspects a non-existing container assuming that there is no container with abcd as an id)

@gesellix
Copy link

Duplicate? #5058 :)

@glebiller
Copy link

This will probably break a lot of different tools.
I noticed that using https://github.com/test-kitchen/kitchen-dokken/ which is not working anymore after upgrade.

Endpoint /containers/{id}/json is failing to return any body, however /containers/{id}/top is correctly returning a JSON body.

@thaJeztah
Copy link
Member

This looks to be an issue with the API proxy used in docker desktop.

Here's performing the request using /var/run/docker.sock (which is the proxied API on Docker Desktop);

$ docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock alpine sh -c 'apk add --no-cache --quiet curl && curl -v --unix-socket /var/run/docker.sock http://localhost/containers/abcd/json'

*   Trying /var/run/docker.sock:0...
* Connected to localhost (/run/host-services/docker.proxy.sock) port 80 (#0)
> GET /containers/abcd/json HTTP/1.1
> Host: localhost
> User-Agent: curl/7.69.1
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 404 Not Found
< Api-Version: 1.41
< Content-Type: application/json
< Date: Thu, 12 Nov 2020 12:01:48 GMT
< Docker-Experimental: true
< Ostype: linux
< Server: Docker/20.10.0-beta1 (linux)
< Transfer-Encoding: chunked
<
* transfer closed with outstanding read data remaining
* Closing connection 0
curl: (18) transfer closed with outstanding read data remaining

And here's the same, but this time mounting /var/run/docker.sock.raw (which is the "raw", "non-proxied" API socket, so directly connecting to the docker daemon);

$ docker run -it --rm -v /var/run/docker.sock.raw:/var/run/docker.sock.raw alpine sh -c 'apk add --no-cache --quiet curl && curl -v --unix-socket /var/run/docker.sock.raw http://localhost/containers/abcd/json'

*   Trying /var/run/docker.sock.raw:0...
* Connected to localhost (/var/run/docker.sock) port 80 (#0)
> GET /containers/abcd/json HTTP/1.1
> Host: localhost
> User-Agent: curl/7.69.1
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 404 Not Found
< Api-Version: 1.41
< Content-Type: application/json
< Docker-Experimental: true
< Ostype: linux
< Server: Docker/20.10.0-beta1 (linux)
< Date: Thu, 12 Nov 2020 12:03:53 GMT
< Content-Length: 38
<
{"message":"No such container: abcd"}
* Connection #0 to host localhost left intact

@stephen-turner
Copy link
Contributor

Thanks for the report. I'm going to close this as a dupe of #5025. Please follow that ticket for updates.

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Dec 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants