makeplane / plane

πŸ”₯ πŸ”₯ πŸ”₯ Open Source JIRA, Linear, Monday, and Asana Alternative. Plane helps you track your issues, epics, and product roadmaps in the simplest way possible.
http://plane.so
GNU Affero General Public License v3.0
29.79k stars 1.65k forks source link

[bug]: Cannot connect to amqp://guest:**@127.0.0.1:5672/: Connection refused. #5776

Open tomerh2001 opened 1 week ago

tomerh2001 commented 1 week ago

Is there an existing issue for this?

Current behavior

❗❗ IMPORTANT: When upgrading to v0.23, make sure you are using the latest version of Docker Compose. If you are on a custom Docker setup, you'll need to install RabbitMQ and provide the necessary env variables in app-env.

What are the env variables that I need to define? I can't find a connection_url like env variable that specifies how to access rabbitMQ...

Steps to reproduce

What I added is this: compose.yml:

  plane-mq:
    image: rabbitmq:3-management-alpine
    container_name: ${SLUG}-mq
    environment:
      RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER}
      RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD}
      RABBITMQ_DEFAULT_VHOST: ${RABBITMQ_VHOST}
    volumes:
      - ${SERVICES_DATASET}/${SLUG}-rabbitmq:/var/lib/rabbitmq
    restart: unless-stopped
    logging:
      driver: json-file
      options:
        max-size: 10m
        max-file: 3

.env:

# RABBITMQ SETTINGS
RABBITMQ_HOST="plane-mq"
RABBITMQ_PORT="5672"
RABBITMQ_USER="plane"
RABBITMQ_PASSWORD="plane"
RABBITMQ_VHOST="plane"

But it doesn't work, what am I missing?

Environment

Production

Browser

None

Variant

Self-hosted

Version

0.23

pablohashescobar commented 1 week ago

@tomerh2001 please add AMQP_URL as your connection url to api, worker and beat services.

tomerh2001 commented 1 week ago

@tomerh2001 please add AMQP_URL as your connection url to api, worker and beat services.

Hey, sorry but I don't want breaking changes so I hard coded ver 22 for now and I really don't want to deal with it rn.

Maybe someone else can chime in here?

P.S. you should really use semantic versioning to signal breaking changes...

broncha commented 2 days ago

@pablohashescobar adding AMQP_URL does not work for me! the api service always throws exception

Waiting for database...
Database available!
No migrations Pending. Starting processes ...
Instance already registered
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/kombu/utils/functional.py", line 32, in __call__
    return self.__value__
           ^^^^^^^^^^^^^^
AttributeError: 'ChannelPromise' object has no attribute '__value__'. Did you mean: '__call__'?

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/kombu/connection.py", line 472, in _reraise_as_library_errors
    yield
  File "/usr/local/lib/python3.12/site-packages/kombu/connection.py", line 459, in _ensure_connection
    return retry_over_time(
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kombu/utils/functional.py", line 318, in retry_over_time
    return fun(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kombu/connection.py", line 934, in _connection_factory
    self._connection = self._establish_connection()
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kombu/connection.py", line 860, in _establish_connection
    conn = self.transport.establish_connection()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kombu/transport/pyamqp.py", line 203, in establish_connection
    conn.connect()
  File "/usr/local/lib/python3.12/site-packages/amqp/connection.py", line 324, in connect
    self.transport.connect()
  File "/usr/local/lib/python3.12/site-packages/amqp/transport.py", line 129, in connect
    self._connect(self.host, self.port, self.connect_timeout)
  File "/usr/local/lib/python3.12/site-packages/amqp/transport.py", line 172, in _connect
    entries = socket.getaddrinfo(
              ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/socket.py", line 976, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno -3] Try again

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

Traceback (most recent call last):
  File "/code/manage.py", line 17, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.12/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.12/site-packages/django/core/management/base.py", line 412, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.12/site-packages/django/core/management/base.py", line 458, in execute
    output = self.handle(*args, **options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/code/plane/license/management/commands/register_instance.py", line 78, in handle
    instance_traces.delay()
  File "/usr/local/lib/python3.12/site-packages/celery/app/task.py", line 444, in delay
    return self.apply_async(args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/celery/app/task.py", line 594, in apply_async
    return app.send_task(
           ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/celery/app/base.py", line 801, in send_task
    amqp.send_task_message(P, name, message, **options)
  File "/usr/local/lib/python3.12/site-packages/celery/app/amqp.py", line 518, in send_task_message
    ret = producer.publish(
          ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kombu/messaging.py", line 186, in publish
    return _publish(
           ^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kombu/connection.py", line 556, in _ensured
    return fun(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kombu/messaging.py", line 195, in _publish
    channel = self.channel
              ^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kombu/messaging.py", line 218, in _get_channel
    channel = self._channel = channel()
                              ^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kombu/utils/functional.py", line 34, in __call__
    value = self.__value__ = self.__contract__()
                             ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kombu/messaging.py", line 234, in <lambda>
    channel = ChannelPromise(lambda: connection.default_channel)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kombu/connection.py", line 953, in default_channel
    self._ensure_connection(**conn_opts)
  File "/usr/local/lib/python3.12/site-packages/kombu/connection.py", line 458, in _ensure_connection
    with ctx():
  File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/usr/local/lib/python3.12/site-packages/kombu/connection.py", line 476, in _reraise_as_library_errors
    raise ConnectionError(str(exc)) from exc
kombu.exceptions.OperationalError: [Errno -3] Try again
pablohashescobar commented 2 days ago

@broncha, can you check if the AMQP_URL is correct? The api is unable to connect to it.