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

URL string which contains virtualhost doesn't connect to rabbitmq #584

Open
CrazyUmka opened this issue Sep 27, 2023 · 1 comment
Open

Comments

@CrazyUmka
Copy link

Minimal steps to reproduce:

  1. docker compose up
version: "3.8"
services:
  rabbitmq:
    image: rabbitmq:3.12-management
    environment:
      RABBITMQ_DEFAULT_USER: debug
      RABBITMQ_DEFAULT_PASS: debug
      RABBITMQ_DEFAULT_VHOST: /debug
    ports:
      - 15672:15672
      - 5672:5672
  1. Try to execute script below
>>> import asyncio
>>> import aio_pika
>>> loop = asyncio.get_event_loop()
>>> loop.run_until_complete(aio_pika.connect("amqp://debug:[email protected]:5672/debug"))
Traceback (most recent call last):
  File "/Users/peach/.pyenv/versions/3.10.9/lib/python3.10/site-packages/aiormq/connection.py", line 521, in connect
    await self.close(e)
  File "/Users/peach/.pyenv/versions/3.10.9/lib/python3.10/site-packages/aiormq/base.py", line 131, in __closer
    await self._cancel_tasks(exc)
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/peach/.pyenv/versions/3.10.9/lib/python3.10/site-packages/aiormq/abc.py", line 44, in __inner
    return await self.task
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/peach/.pyenv/versions/3.10.9/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/Users/peach/.pyenv/versions/3.10.9/lib/python3.10/site-packages/aio_pika/connection.py", line 388, in connect
    await connection.connect(timeout=timeout)
  File "/Users/peach/.pyenv/versions/3.10.9/lib/python3.10/site-packages/aio_pika/connection.py", line 118, in connect
    self.transport = await UnderlayConnection.connect(
  File "/Users/peach/.pyenv/versions/3.10.9/lib/python3.10/site-packages/aio_pika/abc.py", line 666, in connect
    connection = await cls.make_connection(
  File "/Users/peach/.pyenv/versions/3.10.9/lib/python3.10/site-packages/aio_pika/abc.py", line 654, in make_connection
    connection: aiormq.abc.AbstractConnection = await asyncio.wait_for(
  File "/Users/peach/.pyenv/versions/3.10.9/lib/python3.10/asyncio/tasks.py", line 408, in wait_for
    return await fut
  File "/Users/peach/.pyenv/versions/3.10.9/lib/python3.10/site-packages/aiormq/connection.py", line 918, in connect
    await connection.connect(client_properties or {})
  File "/Users/peach/.pyenv/versions/3.10.9/lib/python3.10/site-packages/aiormq/base.py", line 164, in wrap
    return await self.create_task(func(self, *args, **kwargs))
  File "/Users/peach/.pyenv/versions/3.10.9/lib/python3.10/site-packages/aiormq/abc.py", line 46, in __inner
    raise self._exception from e
  File "/Users/peach/.pyenv/versions/3.10.9/lib/python3.10/asyncio/tasks.py", line 650, in _wrap_awaitable
    return (yield from awaitable.__await__())
  File "/Users/peach/.pyenv/versions/3.10.9/lib/python3.10/site-packages/aiormq/abc.py", line 46, in __inner
    raise self._exception from e
  File "/Users/peach/.pyenv/versions/3.10.9/lib/python3.10/site-packages/aiormq/connection.py", line 511, in connect
    frame = await self._rpc(
  File "/Users/peach/.pyenv/versions/3.10.9/lib/python3.10/site-packages/aiormq/connection.py", line 429, in _rpc
    raise AMQPInternalError(
pamqp.exceptions.AMQPInternalError: ("one of ['Connection.OpenOk']", <Connection.Close object at 0x1017d1800>)
@mosquito
Copy link
Owner

Pass //debug in the URl

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

2 participants