Celery连接rabbitmq出现billiard.exceptions.RestartFreqExceeded: 5 in 1s,解决方案

这篇具有很好参考价值的文章主要介绍了Celery连接rabbitmq出现billiard.exceptions.RestartFreqExceeded: 5 in 1s,解决方案。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

[2023-08-04 10:28:39,866: DEBUG/MainProcess] Start from server, version: 0.9, properties: {'capabilities': {'publisher_confirms': True, 'exchange_exchange_bindings': True, 'basic.nack': True, 'consumer_cancel_notify': True, 'connection.blocked': True, 'consumer_priorities': True, 'authentication_failure_close': True, 'per_consumer_qos': True, 'direct_reply_to': True}, 'cluster_name': 'rabbit@NQ31', 'copyright': 'Copyright (c) 2007-2022 VMware, Inc. or its affiliates.', 'information': 'Licensed under the MPL 2.0. Website: https://rabbitmq.com', 'platform': 'Erlang/OTP 26.0.2', 'product': 'RabbitMQ', 'version': '3.10.8'}, mechanisms: [b'AMQPLAIN', b'PLAIN'], locales: ['en_US']
[2023-08-04 10:28:39,867: INFO/MainProcess] Connected to amqp://guest:**@127.0.0.1:5672//
[2023-08-04 10:28:39,867: DEBUG/MainProcess] ^-- substep ok
[2023-08-04 10:28:39,867: DEBUG/MainProcess] | Consumer: Starting Events
[2023-08-04 10:28:39,867: DEBUG/MainProcess] Closed channel #1
[2023-08-04 10:28:39,867: WARNING/MainProcess] /home/nq/.virtualenvs/env_django/lib/python3.9/site-packages/celery/worker/consumer/consumer.py:498: CPendingDeprecationWarning: The broker_connection_retry configuration setting will no longer determine
whether broker connection retries are made during startup in Celery 6.0 and above.
If you wish to retain the existing behavior for retrying connections on startup,
you should set broker_connection_retry_on_startup to True.
  warnings.warn(

[2023-08-04 10:28:39,868: DEBUG/MainProcess] Start from server, version: 0.9, properties: {'capabilities': {'publisher_confirms': True, 'exchange_exchange_bindings': True, 'basic.nack': True, 'consumer_cancel_notify': True, 'connection.blocked': True, 'consumer_priorities': True, 'authentication_failure_close': True, 'per_consumer_qos': True, 'direct_reply_to': True}, 'cluster_name': 'rabbit@NQ31', 'copyright': 'Copyright (c) 2007-2022 VMware, Inc. or its affiliates.', 'information': 'Licensed under the MPL 2.0. Website: https://rabbitmq.com', 'platform': 'Erlang/OTP 26.0.2', 'product': 'RabbitMQ', 'version': '3.10.8'}, mechanisms: [b'AMQPLAIN', b'PLAIN'], locales: ['en_US']
[2023-08-04 10:28:39,869: DEBUG/MainProcess] using channel_id: 1
[2023-08-04 10:28:39,870: DEBUG/MainProcess] Start from server, version: 0.9, properties: {'capabilities': {'publisher_confirms': True, 'exchange_exchange_bindings': True, 'basic.nack': True, 'consumer_cancel_notify': True, 'connection.blocked': True, 'consumer_priorities': True, 'authentication_failure_close': True, 'per_consumer_qos': True, 'direct_reply_to': True}, 'cluster_name': 'rabbit@NQ31', 'copyright': 'Copyright (c) 2007-2022 VMware, Inc. or its affiliates.', 'information': 'Licensed under the MPL 2.0. Website: https://rabbitmq.com', 'platform': 'Erlang/OTP 26.0.2', 'product': 'RabbitMQ', 'version': '3.10.8'}, mechanisms: [b'AMQPLAIN', b'PLAIN'], locales: ['en_US']
[2023-08-04 10:28:39,870: DEBUG/MainProcess] using channel_id: 1
[2023-08-04 10:28:39,871: DEBUG/MainProcess] ^-- substep ok
[2023-08-04 10:28:39,871: DEBUG/MainProcess] | Consumer: Starting Heart
[2023-08-04 10:28:39,872: DEBUG/MainProcess] Start from server, version: 0.9, properties: {'capabilities': {'publisher_confirms': True, 'exchange_exchange_bindings': True, 'basic.nack': True, 'consumer_cancel_notify': True, 'connection.blocked': True, 'consumer_priorities': True, 'authentication_failure_close': True, 'per_consumer_qos': True, 'direct_reply_to': True}, 'cluster_name': 'rabbit@NQ31', 'copyright': 'Copyright (c) 2007-2022 VMware, Inc. or its affiliates.', 'information': 'Licensed under the MPL 2.0. Website: https://rabbitmq.com', 'platform': 'Erlang/OTP 26.0.2', 'product': 'RabbitMQ', 'version': '3.10.8'}, mechanisms: [b'AMQPLAIN', b'PLAIN'], locales: ['en_US']
[2023-08-04 10:28:39,872: DEBUG/MainProcess] using channel_id: 1
[2023-08-04 10:28:39,873: DEBUG/MainProcess] Closed channel #1
[2023-08-04 10:28:39,874: DEBUG/MainProcess] Start from server, version: 0.9, properties: {'capabilities': {'publisher_confirms': True, 'exchange_exchange_bindings': True, 'basic.nack': True, 'consumer_cancel_notify': True, 'connection.blocked': True, 'consumer_priorities': True, 'authentication_failure_close': True, 'per_consumer_qos': True, 'direct_reply_to': True}, 'cluster_name': 'rabbit@NQ31', 'copyright': 'Copyright (c) 2007-2022 VMware, Inc. or its affiliates.', 'information': 'Licensed under the MPL 2.0. Website: https://rabbitmq.com', 'platform': 'Erlang/OTP 26.0.2', 'product': 'RabbitMQ', 'version': '3.10.8'}, mechanisms: [b'AMQPLAIN', b'PLAIN'], locales: ['en_US']
[2023-08-04 10:28:39,874: DEBUG/MainProcess] using channel_id: 1
[2023-08-04 10:28:39,875: DEBUG/MainProcess] ^-- substep ok
[2023-08-04 10:28:39,875: DEBUG/MainProcess] | Consumer: Starting Mingle
[2023-08-04 10:28:39,875: INFO/MainProcess] mingle: searching for neighbors
[2023-08-04 10:28:39,875: DEBUG/MainProcess] using channel_id: 1
[2023-08-04 10:28:39,875: WARNING/MainProcess] consumer: Connection to broker lost. Trying to re-establish the connection...
Traceback (most recent call last):
  File "/home/nq/.virtualenvs/env_django/lib/python3.9/site-packages/amqp/connection.py", line 514, in channel
    return self.channels[channel_id]
KeyError: None

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/nq/.virtualenvs/env_django/lib/python3.9/site-packages/celery/worker/consumer/consumer.py", line 336, in start
    blueprint.start(self)
  File "/home/nq/.virtualenvs/env_django/lib/python3.9/site-packages/celery/bootsteps.py", line 116, in start
    step.start(parent)
  File "/home/nq/.virtualenvs/env_django/lib/python3.9/site-packages/celery/worker/consumer/mingle.py", line 37, in start
    self.sync(c)
  File "/home/nq/.virtualenvs/env_django/lib/python3.9/site-packages/celery/worker/consumer/mingle.py", line 41, in sync
    replies = self.send_hello(c)
  File "/home/nq/.virtualenvs/env_django/lib/python3.9/site-packages/celery/worker/consumer/mingle.py", line 54, in send_hello
    replies = inspect.hello(c.hostname, our_revoked._data) or {}
  File "/home/nq/.virtualenvs/env_django/lib/python3.9/site-packages/celery/app/control.py", line 389, in hello
    return self._request('hello', from_node=from_node, revoked=revoked)
  File "/home/nq/.virtualenvs/env_django/lib/python3.9/site-packages/celery/app/control.py", line 106, in _request
    return self._prepare(self.app.control.broadcast(
  File "/home/nq/.virtualenvs/env_django/lib/python3.9/site-packages/celery/app/control.py", line 776, in broadcast
    return self.mailbox(conn)._broadcast(
  File "/home/nq/.virtualenvs/env_django/lib/python3.9/site-packages/kombu/pidbox.py", line 330, in _broadcast
    chan = channel or self.connection.default_channel
  File "/home/nq/.virtualenvs/env_django/lib/python3.9/site-packages/kombu/connection.py", line 963, in default_channel
    self._default_channel = self.channel()
  File "/home/nq/.virtualenvs/env_django/lib/python3.9/site-packages/kombu/connection.py", line 303, in channel
    chan = self.transport.create_channel(self.connection)
  File "/home/nq/.virtualenvs/env_django/lib/python3.9/site-packages/kombu/transport/pyamqp.py", line 168, in create_channel
    return connection.channel()
  File "/home/nq/.virtualenvs/env_django/lib/python3.9/site-packages/amqp/connection.py", line 517, in channel
    channel.open()
  File "/home/nq/.virtualenvs/env_django/lib/python3.9/site-packages/amqp/channel.py", line 448, in open
    return self.send_method(
  File "/home/nq/.virtualenvs/env_django/lib/python3.9/site-packages/amqp/abstract_channel.py", line 79, in send_method
    return self.wait(wait, returns_tuple=returns_tuple)
  File "/home/nq/.virtualenvs/env_django/lib/python3.9/site-packages/amqp/abstract_channel.py", line 99, in wait
    self.connection.drain_events(timeout=timeout)
  File "/home/nq/.virtualenvs/env_django/lib/python3.9/site-packages/amqp/connection.py", line 525, in drain_events
    while not self.blocking_read(timeout):
  File "/home/nq/.virtualenvs/env_django/lib/python3.9/site-packages/amqp/connection.py", line 530, in blocking_read
    frame = self.transport.read_frame()
  File "/home/nq/.virtualenvs/env_django/lib/python3.9/site-packages/amqp/transport.py", line 294, in read_frame
    frame_header = read(7, True)
  File "/home/nq/.virtualenvs/env_django/lib/python3.9/site-packages/amqp/transport.py", line 627, in _read
    s = recv(n - len(rbuf))
ConnectionResetError: [Errno 104] Connection reset by peer
[2023-08-04 10:28:39,876: DEBUG/MainProcess] Closed channel #1
[2023-08-04 10:28:39,876: WARNING/MainProcess] /home/nq/.virtualenvs/env_django/lib/python3.9/site-packages/celery/worker/consumer/consumer.py:386: CPendingDeprecationWarning: 
In Celery 5.1 we introduced an optional breaking change which
on connection loss cancels all currently executed tasks with late acknowledgement enabled.
These tasks cannot be acknowledged as the connection is gone, and the tasks are automatically redelivered
back to the queue. You can enable this behavior using the worker_cancel_long_running_tasks_on_connection_loss
setting. In Celery 5.1 it is set to False by default. The setting will be set to True by default in Celery 6.0.

  warnings.warn(CANCEL_TASKS_BY_DEFAULT, CPendingDeprecationWarning)

[2023-08-04 10:28:39,876: DEBUG/MainProcess] | Consumer: Restarting event loop...
[2023-08-04 10:28:39,876: DEBUG/MainProcess] | Consumer: Restarting Gossip...
[2023-08-04 10:28:39,876: DEBUG/MainProcess] | Consumer: Restarting Control...
[2023-08-04 10:28:39,876: DEBUG/MainProcess] | Consumer: Restarting Tasks...
[2023-08-04 10:28:39,876: DEBUG/MainProcess] | Consumer: Restarting Mingle...
[2023-08-04 10:28:39,876: DEBUG/MainProcess] | Consumer: Restarting Heart...
[2023-08-04 10:28:39,877: DEBUG/MainProcess] Start from server, version: 0.9, properties: {'capabilities': {'publisher_confirms': True, 'exchange_exchange_bindings': True, 'basic.nack': True, 'consumer_cancel_notify': True, 'connection.blocked': True, 'consumer_priorities': True, 'authentication_failure_close': True, 'per_consumer_qos': True, 'direct_reply_to': True}, 'cluster_name': 'rabbit@NQ31', 'copyright': 'Copyright (c) 2007-2022 VMware, Inc. or its affiliates.', 'information': 'Licensed under the MPL 2.0. Website: https://rabbitmq.com', 'platform': 'Erlang/OTP 26.0.2', 'product': 'RabbitMQ', 'version': '3.10.8'}, mechanisms: [b'AMQPLAIN', b'PLAIN'], locales: ['en_US']
[2023-08-04 10:28:39,878: DEBUG/MainProcess] using channel_id: 1
[2023-08-04 10:28:39,878: DEBUG/MainProcess] | Consumer: Restarting Events...
[2023-08-04 10:28:39,878: DEBUG/MainProcess] | Consumer: Restarting Connection...
[2023-08-04 10:28:39,878: CRITICAL/MainProcess] Frequent restarts detected: RestartFreqExceeded('5 in 1s')
Traceback (most recent call last):
  File "/home/nq/.virtualenvs/env_django/lib/python3.9/site-packages/celery/worker/consumer/consumer.py", line 326, in start
    self._restart_state.step()
  File "/home/nq/.virtualenvs/env_django/lib/python3.9/site-packages/billiard/common.py", line 153, in step
    raise self.RestartFreqExceeded("%r in %rs" % (R, self.maxT))
billiard.exceptions.RestartFreqExceeded: 5 in 1s

一开始用的rabbitmq是3.10版本,尝试了网上各种方法,一直没有解决这个问题,后面
根据rabbitmq官网重新安装最新版本3.12就可以解决这个问题了文章来源地址https://www.toymoban.com/news/detail-632442.html

到了这里,关于Celery连接rabbitmq出现billiard.exceptions.RestartFreqExceeded: 5 in 1s,解决方案的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Rabbitmq 消费者 : Exception (504) Reason: “channel/connection is not open“

    启动微服务 Rabbitmq 时,定位 ch.consume() 出现异常 一、问题分析 分析日志:no exchange ‘log_topic’ 二、检查代码 consumer.go 中,ch.QueueBind 绑定在 “log_topic” event.go 中,ch.ExchangeDeclare 配置的是 “logs_topic” 三、优化代码 定义一个常量 channelName,代码中使用这个常量

    2024年02月13日
    浏览(25)
  • Elasticsearch - 新增数据时 出现index_not_found_exception的解决办法

    前言 新增数据时出现 index_not_found_exception  ,表明该index不存在。出现的原因: es未开启自动创建索引功能 或者不想启动es自动创建索引,但又没手动创建索引 解决方法1:开启es自动创建索引 手动修改 /etc/elasticsearch/elasticsearch.yml 文件 或者在kibana中执行命令 解决方法2:不开

    2024年02月11日
    浏览(39)
  • Stable diffusion加载safetensors 模型出现Exception: device privateuseone:0 is invalid

          博主用CPU硬解 Stable diffusion,sd-v1-4.ckpt能跑,但换成v1-5-pruned-emaonly.safetensors等最新格式的模型就出现Exception: device privateuseone:0 is invalid错误。        原因是在启动参数中使用了底运存命令--lowram,这个参数似乎会让device指向gpu,电脑是amd的集显,所以出现找不到GPU的情

    2024年02月11日
    浏览(19)
  • python 运行脚本出现报错"selenium.common.exceptions.ElementClickInterceptedException: Message: element click ...

    \\\"selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted:\\\" 这个错误通常是由于在尝试点击元素时被其他元素挡住了。这可能是由于页面布局的原因,导致元素实际上并不能被点击到。 解决方法有很多种,你可以尝试以下方法之一: 尝试使用 Selenium 的 move_

    2024年02月14日
    浏览(30)
  • Python对与测试HTML文件,出现selenium.common.exceptions.WebDriverException: Message: Reached error page: about

    在测试 html文件 是出现:selenium.common.exceptions.WebDriverException: Message: Reached error page: about:neterror?e=fileNotFoundu=file%3A.....报错 如下: Firefox上也出现了一下情况   我查了许多网上的资料,也看出个所以然,所以琢磨了一下,若是把文件的路径改成没有中文的呢,然后结果还是如此

    2024年02月15日
    浏览(46)
  • 在配置Maven中出现的问题java.lang.RuntimeException: org.codehaus.plexus.component.repository.exception.Compone

    出现这个问题在idea 2021中适配的过高maven,需要换低一点的,表示你的Maven版本配置过高,所以需要下载一个版本低的 原本用了3.9.1后来改了3.6.3 需要安装包可以关注 java.lang.RuntimeException: org.codehaus.plexus.component.repository.exception.ComponentLookupException: com.google.inject.ProvisionException:

    2024年02月19日
    浏览(27)
  • RabbitMQ清除积压消息/管理界面出现 Unacked 消息

    1.问题: rabbitmq的生产者端循环产生了多条消息给消费者,而消费者无法及时将消息处理掉,在消费端积压了多条消息(消费失败的时候,消息队列会一直重复的发送消息,导致程序死循环)需要清理项目因为错误而产生的积压消息队列。 2.原因: 消息接收方因退出企业,账

    2024年02月09日
    浏览(26)
  • 【rabbitmq】出现问题Channel error on connection

    🎈博客主页:🌈我的主页🌈 🎈欢迎点赞 👍 收藏 🌟留言 📝 欢迎讨论!👏 🎈本文由 【泠青沼~】 原创,首发于 CSDN🚩🚩🚩 🎈由于博主是在学小白一枚,难免会有错误,有任何问题欢迎评论区留言指出,感激不尽!🌠个人主页 问题就是dong.mail.exchange交换机在 / 当前目

    2024年02月04日
    浏览(32)
  • 微服务: 00-rabbitmq出现的异常以及解决方案

    目录 前言: 问题概述:  1. rabbitmq初始安装配置异常  - 1.1 rabbitmq报您与此网站连接不是私密连接 ---1.1.1 上述问题解决方案 --- 1.1.2 依次执行下面代码  - 1.2 解决用户的No access情况 - 1.2.1 使用设置的账号密码进行登录  - 1.2.2  点击 Admin功能 查看用户列表  - 1.2.3 查看用户情况情

    2024年02月13日
    浏览(25)
  • mysql连接错误:com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

    目录 一、遇到问题 二、找到报错具体原因  三、解决办法  在电脑上面有多个mysql版本的时候。可能会启用之前的mysql版本的执行路径,所以导致出现了这个mysql连接错误。 com.mysql.jdbc.exceptions.jdbc4.Commu

    2024年02月09日
    浏览(35)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包