Framing Errors in Celery 3.0.1

2024/4/15 1:10:45

I recently upgraded to Celery 3.0.1 from 2.3.0 and all the tasks run fine. Unfortunately. I'm getting a "Framing Error" exception pretty frequently. I'm also running supervisor to restart the threads but since these are never really killed supervisor has no way of knowing that celery needs to be restarted. Has anyone seen this before?

2012-07-13 18:53:59,004: ERROR/MainProcess] Unrecoverable error: Exception('Framing Error, received 0x00 while expecting 0xce',)
Traceback (most recent call last):File "/usr/local/lib/python2.7/dist-packages/celery/worker/__init__.py", line 350, in startcomponent.start()File "/usr/local/lib/python2.7/dist-packages/celery/worker/consumer.py", line 360, in startself.consume_messages()File "/usr/local/lib/python2.7/dist-packages/celery/worker/consumer.py", line 445, in consume_messagesdrain_nowait()File "/usr/local/lib/python2.7/dist-packages/kombu/connection.py", line 175, in drain_nowaitself.drain_events(timeout=0)File "/usr/local/lib/python2.7/dist-packages/kombu/connection.py", line 171, in drain_eventsreturn self.transport.drain_events(self.connection, **kwargs)File "/usr/local/lib/python2.7/dist-packages/kombu/transport/amqplib.py", line 262, in drain_eventsreturn connection.drain_events(**kwargs)File "/usr/local/lib/python2.7/dist-packages/kombu/transport/amqplib.py", line 97, in drain_eventschanmap, None, timeout=timeout)File "/usr/local/lib/python2.7/dist-packages/kombu/transport/amqplib.py", line 155, in     _wait_multiplechannel, method_sig, args, content = read_timeout(timeout)File "/usr/local/lib/python2.7/dist-packages/kombu/transport/amqplib.py", line 129, in read_timeoutreturn self.method_reader.read_method()File "/usr/local/lib/python2.7/dist-packages/amqplib/client_0_8/method_framing.py", line 221, in read_methodraise m
Exception: Framing Error, received 0x00 while expecting 0xce
Answer

While I am not sure why this actually happens, switching from amqplib to librabbitmq helped me to overcome this trouble.

I haven't changed anything in configuration, just:

pip uninstall amqplib
pip install librabbitmq

And restarted celery workers.

Got this idea form https://github.com/celery/celery/issues/922

https://en.xdnf.cn/q/73097.html

Related Q&A

decorator() got an unexpected keyword argument

I have this error on Django view:TypeError at /web/host/1/ decorator() got an unexpected keyword argument host_id Request Method: GET Request URL: http://127.0.0.1:8000/web/host/1/edit Django Versio…

Conflict between sys.stdin and input() - EOFError: EOF when reading a line

I cant get the following script to work without throwing an EOFError exception:#!/usr/bin/env python3import json import sys# usage: # echo [{"testname": "testval"}] | python3 test.p…

Requests - inability to handle two cookies with same name, different domain

I am writing a Python 2.7 script using Requests to automate access to a website that sets two cookies with the same name, but different domains, E.g. Name mycookie, Domain www.example.com and subdomain…

Python logging from multiple processes

I have a possibly long running program that currently has 4 processes, but could be configured to have more. I have researched logging from multiple processes using pythons logging and am using the So…

Error while fetching Tweets with Tweepy

I have a Python script that fetch tweets. In the script i use the libary Tweepy . I use a valid authentication parameters. After running this script some tweets are stored in my MongoDB and some are r…

Example to throw a BufferError

On reading in the Python 3.3 documentation I noticed the entry about a BufferError exception: "Raised when a buffer related operation cannot be performed.". Now Im wondering in which cases co…

Which algorithm would fit best to solve a word-search game like Boggle with Python

Im coding a game similar to Boggle where the gamer should find words inside a big string made of random letters.For example, there are five arrays with strings inside like this. Five rows, made of six …

Sort using argsort in python

I try to sort an array: import numpy as nparr = [5,3,7,2,6,34,46,344,545,32,5,22] print "unsorted" print arrnp.argsort(arr)print "sorted" print arrBut the output is:unsorted [5, 3, …

pandas DataFrame resample from irregular timeseries index

I want to resample a DataFrame to every five seconds, where the time stamps of the original data are irregular. Apologies if this looks like a duplicate question, but I have issues with the interpolati…

django makemigrations to rename field without user input

I have a model with CharField named oldName. I want to rename the field to newName. When I run python manage.py makemigrations, I get a confirmation request "Did you rename model.oldName to model.…