super(type, obj): obj must be an instance or subtype of type
See original GitHub issueI’m trying to get raven client working with celery. Initially things weren’t working because of the inability to use class methods as tasks (issue 59).
The relevant code is in CeleryMxin:
def send_raw(self, *args, **kwargs):
return super(CeleryMixin, self).send_encoded(*args, **kwargs)
After a couple of hours, I was no longer getting that error, but instead was getting the new error below. Note that this error somehow creates another error message to be tried and published, so celeryd gets into an infinite loop.
TypeError: super(type, obj): obj must be an instance or subtype of type
[2012-07-07 05:12:48,397: INFO/MainProcess] Got task from broker: raven.contrib.celery.send_raw[6e9a
a446-8fa3-4828-b96c-dff7317beffd]
[2012-07-07 05:12:48,398: INFO/MainProcess] Got task from broker: raven.contrib.celery.send_raw[8ec5
7888-0ac5-4388-902f-65b7800bf184]
[2012-07-07 05:12:48,420: ERROR/MainProcess] Task raven.contrib.celery.send_raw[50f6eeb1-99a1-4357-a
75f-0649ee3040b1] raised exception: TypeError('super(type, obj): obj must be an instance or subtype
of type',)
Traceback (most recent call last):
File "F:\taras\programming\goparcel\venv\lib\site-packages\celery\execute\trace.py", line 181, in
trace_task
R = retval = fun(*args, **kwargs)
Googling the eror message leads to:
http://thingspython.wordpress.com/2010/09/27/another-super-wrinkle-raising-typeerror/
Which looks like mxins & reloading modules can both cause this error.
Sure enough if I print
@task
def send_raw(self, *args, **kwargs):
print "INSTANCE: ", isinstance(self, CeleryMixin)
I get false
if I try to explicitly call the method:
lArgs = [self] + list(args)
DjangoClient.send_encoded(*lArgs, **kwargs)
I get an error message saying that the first element needs to be an instance of DjangoClient, but a str was received instead.
Trying to copy/paste the mixincode to CeleryClient, and removing the multiple inheritance so that it only inherits from DjangoClient, gets the same error message (both when calling super and when calling explicitly via DjangoClient).
Printing out ‘self’ prints out a massive random looking string.
Using celery and django-celery 2.5.5.
Issue Analytics
- State:
- Created 11 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
for anyone else who gets directed by google to this page in search of answers, I think your answer lies in:
This is now a problem for me with Flask and APScheduler. Did anyone find a solution to the problem?