consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 111] Connection refused. #8942

Closed
opened 2026-02-21 18:28:45 -05:00 by yindo · 2 comments
Owner

Originally created by @fyl080801 on GitHub (Mar 3, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.0.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

start worker, and appear [Errno 111] Connection refused.

ERROR [MainThread] [consumer.py:493] - consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 111] Connection refused.
│ Trying again in 2.00 seconds... (1/100)

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @fyl080801 on GitHub (Mar 3, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.0.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce start worker, and appear [Errno 111] Connection refused. ``` ERROR [MainThread] [consumer.py:493] - consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 111] Connection refused. │ Trying again in 2.00 seconds... (1/100) ``` ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 18:28:45 -05:00
yindo closed this issue 2026-02-21 18:28:45 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 3, 2025):

The error "[Errno 111] Connection refused" typically occurs when the service you're trying to connect to is not accessible. In a Dockerized environment, this can happen due to several reasons:

  1. Service Accessibility: The RabbitMQ service might not be running or is not accessible from the Docker container. Ensure that RabbitMQ is up and running.

  2. Incorrect Host Reference: Using 127.0.0.1 or localhost in Docker can cause issues because these refer to the container itself, not the host machine or other containers. You might need to use host.docker.internal to refer to the host machine from within a Docker container.

To resolve this, try the following steps:

  • Ensure RabbitMQ is running and accessible. You can check this by trying to connect to RabbitMQ from the host machine using a client or command-line tool.
  • Update the connection string to use host.docker.internal instead of 127.0.0.1 if you're trying to connect to a service running on the host machine.

For more detailed troubleshooting, you might want to check similar issues or discussions, such as the one titled "Node Code run failed" [1], which might provide additional insights or solutions.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Mar 3, 2025): <!-- Answer --> The error "[Errno 111] Connection refused" typically occurs when the service you're trying to connect to is not accessible. In a Dockerized environment, this can happen due to several reasons: 1. **Service Accessibility**: The RabbitMQ service might not be running or is not accessible from the Docker container. Ensure that RabbitMQ is up and running. 2. **Incorrect Host Reference**: Using `127.0.0.1` or `localhost` in Docker can cause issues because these refer to the container itself, not the host machine or other containers. You might need to use `host.docker.internal` to refer to the host machine from within a Docker container. To resolve this, try the following steps: - Ensure RabbitMQ is running and accessible. You can check this by trying to connect to RabbitMQ from the host machine using a client or command-line tool. - Update the connection string to use `host.docker.internal` instead of `127.0.0.1` if you're trying to connect to a service running on the host machine. For more detailed troubleshooting, you might want to check similar issues or discussions, such as the one titled "Node Code run failed" <sup>[[1]](https://github.com/langgenius/dify/discussions/7902)</sup>, which might provide additional insights or solutions. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/2ce586fd-d4bb-40ae-9011-a596ed3ede15?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/2ce586fd-d4bb-40ae-9011-a596ed3ede15?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/2ce586fd-d4bb-40ae-9011-a596ed3ede15?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/2ce586fd-d4bb-40ae-9011-a596ed3ede15?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/2ce586fd-d4bb-40ae-9011-a596ed3ede15?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/2ce586fd-d4bb-40ae-9011-a596ed3ede15?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/2ce586fd-d4bb-40ae-9011-a596ed3ede15?feedback_type=other)</sup>
Author
Owner

@fyl080801 commented on GitHub (Mar 3, 2025):

lose CELERY_BROKER_URL

@fyl080801 commented on GitHub (Mar 3, 2025): lose CELERY_BROKER_URL
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8942