Skip to content

Breaks with requests 2.33.0: 404 Client Error: Not Found for url: http+docker://localhost/v1.51/containers/create #3392

Description

@zamlz

I recently upgraded to the latest requests version since there was a known vulnerability in the one I was using.

    'docker==7.1.0',
    'requests==2.33.0',  # was originally 2.32.5 and that worked fine

Here is a snippet of the error message I'm seeing.

'404 Client Error: Not Found for url: http+docker://localhost/v1.51/containers/create'

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 😢

Activity

  1. zamlz commented on Mar 25, 2026

    @zamlz
    Author

    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.

  2. zamlz commented on Mar 25, 2026

    @zamlz
    Author

    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-py and AWS CodeBuild that isn't requests specific i think.

  3. Iriome-Santana commented on Sep 12, 2026

    @Iriome-Santana

    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() pulls v1.51 directly from your daemon's /version endpoint (it's not docker-py's hardcoded default, which is 1.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_HOST set 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 version report inside the CodeBuild image (client + server API versions)?
    • Are HTTP_PROXY/HTTPS_PROXY/NO_PROXY set in that environment?
    • Can you check if the issue persists with requests==2.33.1 specifically, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions