Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aiohttp 3.10 appears not to work with aiodocker #889

Open
Julian opened this issue Aug 4, 2024 · 0 comments
Open

aiohttp 3.10 appears not to work with aiodocker #889

Julian opened this issue Aug 4, 2024 · 0 comments

Comments

@Julian
Copy link

Julian commented Aug 4, 2024

Long story short

aiohttp==3.10.0 (released mid-July) appears to break aiodocker entirely here.

Any use of the library produces an exception complaining about the use of unix://localhost, which I see aiodocker uses as a dummy URI.

  • Expected behaviour: No error / same behavior as with aiohttp 3.9
  • Actual behaviour: The following exception:
Traceback (most recent call last):
  File "<string>", line 10, in <module>
  File "/opt/homebrew/Cellar/[email protected]/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "<string>", line 8, in main
  File "/Users/julian/Desktop/venv/lib/python3.12/site-packages/aiodocker/docker.py", line 190, in version
    data = await self._query_json("version")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/julian/Desktop/venv/lib/python3.12/site-packages/aiodocker/docker.py", line 319, in _query_json
    async with self._query(
  File "/opt/homebrew/Cellar/[email protected]/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/julian/Desktop/venv/lib/python3.12/site-packages/aiodocker/docker.py", line 231, in _query
    yield await self._do_query(
          ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/julian/Desktop/venv/lib/python3.12/site-packages/aiodocker/docker.py", line 257, in _do_query
    await self._check_version()
  File "/Users/julian/Desktop/venv/lib/python3.12/site-packages/aiodocker/docker.py", line 209, in _check_version
    ver = await self._query_json("version", versioned_api=False)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/julian/Desktop/venv/lib/python3.12/site-packages/aiodocker/docker.py", line 319, in _query_json
    async with self._query(
  File "/opt/homebrew/Cellar/[email protected]/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/julian/Desktop/venv/lib/python3.12/site-packages/aiodocker/docker.py", line 231, in _query
    yield await self._do_query(
          ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/julian/Desktop/venv/lib/python3.12/site-packages/aiodocker/docker.py", line 267, in _do_query
    response = await self.session.request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/julian/Desktop/venv/lib/python3.12/site-packages/aiohttp/client.py", line 510, in _request
    raise NonHttpUrlClientError(url)
aiohttp.client_exceptions.NonHttpUrlClientError: unix://localhost/version

How to reproduce

Run e.g.:

rm -rf venv && uv venv venv && uv pip install --python venv/bin/python aiodocker 'aiohttp>=3.10' && venv/bin/python -c '                                                                                                                                                   julian@Airmimport asyncio

from aiodocker import Docker

async def main():
    async with Docker() as docker:
        print(await docker.version())

asyncio.run(main())

Your environment

macOS with a remote docker host set to:

⊙  echo $DOCKER_HOST                                                                                                                                                                                                                                                          julian@Airm ●
unix:///Users/julian/Library/Application Support/containers/podman/machine/qemu/podman.sock

c.f. #833, though that seems no longer accurate (I was using 3.9 here myself for awhile so I think 3.9 seemed fine?) -- more relevant seems to be #885 where it seems aiohttp 3.10 breaks aiodocker's own suite.

I haven't looked into what the fix looks like (one would hope it's tiny?) but perhaps if it isn't completely trivial, simply pinning away from 3.10 is a temporary solution.

Julian added a commit to bowtie-json-schema/bowtie that referenced this issue Aug 4, 2024
It appears to break aiodocker entirely.

See aio-libs/aiodocker#889.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant