Rq: UnpickleError: (u'Could not unpickle', ImportError('cannot import name SmsRecord',))

Created on 13 Nov 2015  路  5Comments  路  Source: rq/rq

I have been struggling with an import issue that I cannot seem to resolve.

I have a django app (not using django-rq because of some issues I do not remember) and have been using rq nicely for a while now. I added another module to my django app, and I started getting importError. I confirmed there are no circular import issues. I suspect there is a problem in the namespace and so want to explain a bit. I also feel like the error messages are not indicative of the real problems.

I have a module called quicken module that has from sprint.models import SmsRecord. There were no problems. I later created a module called waze that also from sprint.models import SmsRecord, but now I get a UnpickleError: (u'Could not unpickle', ImportError('cannot import name SmsRecord',)). Here is the full traceback.

To see what is happening, I included a import waze in my worker.py to see the cause of the error, and I see slightly better error message without the unpickleError. Any clues as to how I might debug this better?

Version used: rq==0.5.6, redis==2.10.5 and django==1.8.4 all in osx environment.

Most helpful comment

I encountered this same problem and was able to solve it by ensuring I was running rq worker in the directory where the required module could be imported.

All 5 comments

This doesn't seem to be a bug in RQ but in the way your environment is set up. I'm not familiar with the way your code is structured so I can't provide much insight.

I encountered this same problem and was able to solve it by ensuring I was running rq worker in the directory where the required module could be imported.

upgrading to rq==0.10.0 fixed this error for me

Having this issue now on 1.1.0 馃槵

Looks like this exception was removed in https://github.com/rq/rq/commit/e1cbc3736c55d7a72be121a170d1b8c811619dc2#diff-27817b1a9be843cacb4ebeb20393c486

Was this page helpful?
0 / 5 - 0 ratings