Page MenuHomeDevCentral

docker.errors.DockerException: Error while fetching server API version: Not supported URL scheme http+docker
Open, Needs TriagePublic

Description

There is apparently an issue with docker-py and requests for the URL scheme http+docker:

docker-002
$ docker --version
Docker version 27.0.2, build 912c1dd

$ salt-call --versions
Salt Version:
          Salt: 3006.9
[…]
     docker-py: 5.0.3
[…]

$ deploy-container openfire
[…]
[ERROR   ] An exception occurred in this state: Traceback (most recent call last):
  File "/opt/saltstack/salt/lib/python3.10/site-packages/requests/adapters.py", line 633, in send
    conn = self.get_connection_with_tls_context(
  File "/opt/saltstack/salt/lib/python3.10/site-packages/requests/adapters.py", line 489, in get_connection_with_tls_context
    conn = self.poolmanager.connection_from_host(
  File "/opt/saltstack/salt/lib/python3.10/site-packages/urllib3/poolmanager.py", line 246, in connection_from_host
    return self.connection_from_context(request_context)
  File "/opt/saltstack/salt/lib/python3.10/site-packages/urllib3/poolmanager.py", line 258, in connection_from_context
    raise URLSchemeUnknown(scheme)
urllib3.exceptions.URLSchemeUnknown: Not supported URL scheme http+docker
[…]

Requests is installed at version 2.32.3. If downgraded to 2.31.0, that would fix the issue.

If we want to fix that at docker-py level, we can also apply this patch: https://github.com/docker/docker-py/pull/3257/files

Event Timeline

If we want to fix that at docker-py level, we can also apply this patch: https://github.com/docker/docker-py/pull/3257/files

Tested manually the https://github.com/docker/docker-py/pull/3257/files commit, works like a charm.