gpt4 book ai didi

python - celery :消费者:无法连接到 amqp://guest:**@127.0.0.1:5672//:[Errno 92] 协议(protocol)不可用

转载 作者:可可西里 更新时间:2023-11-01 14:16:47 24 4
gpt4 key购买 nike

我一直收到这个错误,我不知道为什么。我在 Windows 10 上使用 Ubuntu, celery 过去工作正常。然后发生了一些事情,我一直收到这个错误。我使用 celery 文档来学习。

这是任务.py:

from celery import Celery

app = Celery('tasks', broker='pyamqp://guest@localhost//')

@app.task
def add(x, y):
return x + y

这是我得到的错误:

[2017-08-14 17:34:04,436: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 92] Protocol not available.
Trying again in 2.00 seconds...

[2017-08-14 17:34:06,453: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 92] Protocol not available.
Trying again in 4.00 seconds...

[2017-08-14 17:34:10,465: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 92] Protocol not available.
Trying again in 6.00 seconds...

[2017-08-14 17:34:16,480: ERROR/MainProcess] consumer: Cannot connect to amqp://guest:**@127.0.0.1:5672//: [Errno 92] Protocol not available.
Trying again in 8.00 seconds...

为了启动 Celery,我输入:

celery -A tasks worker --loglevel=info

最佳答案

你最近有更新 amqp 吗?

似乎从 Linux 子系统连接到 RabbitMQ 实例是不可能的,因为 2.1.2 之后的版本由于套接字巫术。

https://github.com/celery/py-amqp/issues/145

我建议尝试 Celery 可能支持的其他后端,我将尝试 redis。至少降级到 RabbitMQ 2.1.2 也可能解决问题。

关于python - celery :消费者:无法连接到 amqp://guest:**@127.0.0.1:5672//:[Errno 92] 协议(protocol)不可用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45677111/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com