apocas / docker-modem

Docker Remote API network stack driver.
Apache License 2.0
234 stars 112 forks source link

Docker image pulls fail on Windows due to bad Content-Type/Length #90

Closed rssk closed 5 years ago

rssk commented 6 years ago

Problem

This is the same as the issue here, on a pull the docker daemon responds to with an error: context cancelled. The issues seems to be a couple of things:

Here is an example failing request options, changing the type to text/plain or removing the Content-length fixes the issue.

 { path: '/images/create?fromImage=coinstac%2Fcoinstac-base&tag=',
   method: 'POST',
   headers: { 'Content-Type': 'application/json', 'Content-Length': 38 },
   key: undefined,
   cert: undefined,
   ca: undefined,
   socketPath: '//./pipe/docker_engine' }
apocas commented 6 years ago

Humm indeed strange.

When I have time I will build a Windows env to debug this one.

bompi88 commented 6 years ago

@apocas did you get time to look into this issue?

apocas commented 6 years ago

I'm able to run the image pull test on Windows. https://github.com/apocas/dockerode/blob/master/test/docker.js#L184

Using Windows 10 and latest Docker version.

apocas commented 5 years ago

Will close this one for now. Will reopen if more info is provided.

hvaara commented 5 years ago

Thanks for taking the time to look at this, and I fully understand closing this after more than a year of feedback.

We were seeing this and were able to reproduce it consistently. Since then we've implemented a workaround to mitigate the issue. We only saw this on Windows machines. Not on Mac and Linux. The image pull fails multiple times, until it eventually succeeds. How many retries is necessary is not consistent. Some times it's 1, some times it's 20, but usually between 5 to 15 retries is needed.

I'll see if I can find some time to investigate. If I do I'll report my findings here.