gpt4 book ai didi

python - Celery 'i' 格式的内部错误

转载 作者:行者123 更新时间:2023-12-01 05:59:55 26 4
gpt4 key购买 nike

当我尝试使用 celery 和 amqp 执行任务时,出现以下错误,我的配置是否有问题。我该如何解决这个问题?

[2012-06-12 16:49:37,231: CRITICAL/MainProcess] Task core.tasks.sanity[c44c8058-46d1-48cd-a687-0481f5bd5ee5] INTERNAL ERROR: error("'i' format requires -2147483648 <= number <= 2147483647",)
Traceback (most recent call last):
File "/nobackup/vivenara/pyenv/lib/python2.7/site-packages/celery/execute/trace.py", line 192, in trace_task
R = I.handle_error_state(task, eager=eager)
File "/nobackup/vivenara/pyenv/lib/python2.7/site-packages/celery/execute/trace.py", line 91, in handle_error_state
}[self.state](task, store_errors=store_errors)
File "/nobackup/vivenara/pyenv/lib/python2.7/site-packages/celery/execute/trace.py", line 114, in handle_failure
task.backend.mark_as_failure(req.id, exc, self.strtb)
File "/nobackup/vivenara/pyenv/lib/python2.7/site-packages/celery/backends/base.py", line 96, in mark_as_failure
traceback=traceback)
File "/nobackup/vivenara/pyenv/lib/python2.7/site-packages/celery/backends/base.py", line 229, in store_result
return self._store_result(task_id, result, status, traceback, **kwargs)
File "/nobackup/vivenara/pyenv/lib/python2.7/site-packages/celery/backends/amqp.py", line 121, in _store_result
"traceback": traceback})
File "/nobackup/vivenara/pyenv/lib/python2.7/site-packages/kombu/connection.py", line 272, in _ensured
return fun(*args, **kwargs)
File "/nobackup/vivenara/pyenv/lib/python2.7/site-packages/celery/backends/amqp.py", line 97, in _publish_result
self._create_producer(task_id, connection).publish(meta)
File "/nobackup/vivenara/pyenv/lib/python2.7/site-packages/celery/backends/amqp.py", line 87, in _create_producer
self._create_binding(task_id)(connection.default_channel).declare()
File "/nobackup/vivenara/pyenv/lib/python2.7/site-packages/kombu/entity.py", line 386, in declare
self.queue_declare(nowait, passive=False)
File "/nobackup/vivenara/pyenv/lib/python2.7/site-packages/kombu/entity.py", line 408, in queue_declare
nowait=nowait)
File "/nobackup/vivenara/pyenv/lib/python2.7/site-packages/amqplib/client_0_8/channel.py", line 1376, in queue_declare
args.write_table(arguments)
File "/nobackup/vivenara/pyenv/lib/python2.7/site-packages/amqplib/client_0_8/serialization.py", line 378, in write_table
table_data.write(pack('>i', v))
error: 'i' format requires -2147483648 <= number <= 2147483647

最佳答案

存储结果时值溢出:

error: 'i' format requires -2147483648 <= number <= 2147483647

一个 bigint/long 值正在被写入 AMQP 队列,而它会将其识别为 int。我相信这不是配置问题。您尝试保存的结果是什么?

我在堆栈跟踪中看到:

return self._store_result(task_id, result, status, traceback, **kwargs)

你能检查一下结果值是多少吗?可能这是一些奇怪的值......

编辑:

task.backend.mark_as_failure(req.id, exc, self.strtb)

所以在这种情况下它返回 exc 作为结果:

def mark_as_failure(self, task_id, exc, traceback=None):
"""Mark task as executed with failure. Stores the execption."""
return self.store_result(task_id, exc, status=states.FAILURE,
traceback=traceback)

是否是任务抛出的异常包含bigint状态码?

关于python - Celery 'i' 格式的内部错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10995646/

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