Skip to content

unix:// client URL fails #3303

Closed
Closed
@AstraLuma

Description

@AstraLuma

Doing #3146 (comment) , and I'm now getting errors like:

  File "/home/astraluma/code/unholy/unholy/docker.py", line 48, in get_client
    return docker.DockerClient(
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/astraluma/.local/pipx/venvs/unholy/lib/python3.12/site-packages/docker/client.py", line 45, in __init__
    self.api = APIClient(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/astraluma/.local/pipx/venvs/unholy/lib/python3.12/site-packages/docker/api/client.py", line 197, in __init__
    self._version = self._retrieve_server_version()
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/astraluma/.local/pipx/venvs/unholy/lib/python3.12/site-packages/docker/api/client.py", line 221, in _retrieve_server_version
    raise DockerException(
docker.errors.DockerException: Error while fetching server API version: Not supported URL scheme http+docker

The initial root looks like:

if base_url.startswith('http+unix://'):

where it looks for http+unix:// but not unix://.

But if I munge the URL to be http+unix:// instead, I get:

Traceback (most recent call last):
  File "/home/astraluma/.local/pipx/venvs/unholy/lib/python3.12/site-packages/requests/adapters.py", line 633, in send
    conn = self.get_connection_with_tls_context(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/astraluma/.local/pipx/venvs/unholy/lib/python3.12/site-packages/requests/adapters.py", line 489, in get_connection_with_tls_context
    conn = self.poolmanager.connection_from_host(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/astraluma/.local/pipx/venvs/unholy/lib/python3.12/site-packages/urllib3/poolmanager.py", line 303, in connection_from_host
    return self.connection_from_context(request_context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/astraluma/.local/pipx/venvs/unholy/lib/python3.12/site-packages/urllib3/poolmanager.py", line 325, in connection_from_context
    raise URLSchemeUnknown(scheme)
urllib3.exceptions.URLSchemeUnknown: Not supported URL scheme http+docker

Note that the Docker CLI is fine with unix://.

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