Breaks with requests 2.33.0: 404 Client Error: Not Found for url: http+docker://localhost/v1.51/containers/create #3392
Description
Activity
Okay the plot thickens. I did not test reverting my changes. But it looks like reverting it showed me that things were still failing in the exact same way. I'm baffled as this means something in AWS CodeBuild's environment caused this change. I wonder what it could be. I would appreciate any help to debug this. I know this isn't docker-py related, but I would like to get as much info as possible to report to AWS about this regression.
It appears that this is the case with also versions of request
<2.32.0.I'm inclined to believe something different is happening with
docker-pyand AWS CodeBuild that isn't requests specific i think.Thanks for the report! I spent some time trying to reproduce this in isolation (comparing requests 2.32.5 vs 2.33.1 against a bare unix-socket HTTP server, with and without HTTP_PROXY/HTTPS_PROXY set, and under concurrent load with small connection pools) and couldn't trigger the 404 in any of those scenarios — the UnixHTTPAdapter code path behaves identically across both requests versions in my tests.
One thing that stands out:
_retrieve_server_version()pullsv1.51directly from your daemon's/versionendpoint (it's not docker-py's hardcoded default, which is1.45). That means your daemon does support v1.51 — so it's surprising that the very next call to that same version returns 404 rather than the version negotiation itself failing.A few details that would help narrow this down:
- Is
DOCKER_HOSTset to a unix socket or a tcp:// address in your CodeBuild environment? - Does the failure happen on the first API call after client creation, or only after some other calls have already succeeded?
- Is this build running tests concurrently (parallel workers), or single-threaded?
- What does
docker versionreport inside the CodeBuild image (client + server API versions)? - Are
HTTP_PROXY/HTTPS_PROXY/NO_PROXYset in that environment? - Can you check if the issue persists with
requests==2.33.1specifically, or if only 2.33.0 triggers it (2.33.0 had a couple of follow-up point releases)?
Happy to keep digging once I know a bit more about the environment — right now I can't reproduce it locally or in an isolated harness, so I don't want to guess at a fix.
- Is
I recently upgraded to the latest requests version since there was a known vulnerability in the one I was using.
Here is a snippet of the error message I'm seeing.
What's particularly weird is that locally I cannot reproduce this issue. I am only able to create reproduce this in AWS CodeBuild. Not sure what's up there. The only change from the working execution to this one is the version bump 😢