Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 425794 - dev-python/celery-2.5.3 with dev-python/pymongo-2.2 - included from pymongo.binary import Binary ImportError: No module named binary
Summary: dev-python/celery-2.5.3 with dev-python/pymongo-2.2 - included from pymongo.b...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Corentin Chary (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-11 10:56 UTC by Guillaume Bandet
Modified: 2012-07-17 15:11 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guillaume Bandet 2012-07-11 10:56:27 UTC
dev-python/celery-2.5.3 in its mongodb backend import the module pymongo.binary but this module was deprecated since pymongo 1.9 in favor of bson.binary and was finally removed in pymongo 2.2. (http://api.mongodb.org/python/1.9/api/pymongo/binary.html)

Since there is no version limitation in the ebuild (and also no dependency to pymongo outside of the test use flag), an update to the last version of pymongo breaks celery tasks using the mongodb backend.

Reproducible: Always

Steps to Reproduce:
1. Start a celeryd server
2. Run a celery task which uses the mongodb backend

Actual Results:  
There is the traceback of this import error:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/celery/execute/trace.py", line 206, in trace_task
    store_result(uuid, retval, SUCCESS)
  File "/usr/lib64/python2.7/site-packages/celery/backends/base.py", line 229, in store_result
    return self._store_result(task_id, result, status, traceback, **kwargs)
  File "/usr/lib64/python2.7/site-packages/celery/backends/mongodb.py", line 112, in _store_result
    from pymongo.binary import Binary
ImportError: No module named binary

Expected Results:  
No import error. Task runnning normally
Comment 1 Ian Delaney (RETIRED) gentoo-dev 2012-07-11 14:52:32 UTC
actually, no

+       # For some reason uses import pymongo.binary but system has bson.binary
        sed -e 's:from pymongo import binary:from bson import binary:' -i celery/tests/test_backends/test_mongodb.py || die
        sed -e 's:pymongo.binary:bson.binary:' -i celery/backends/mongodb.py || die

from my home's patches/celery.patch
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2012-07-11 15:36:39 UTC
oops, wrong
Comment 3 Ian Delaney (RETIRED) gentoo-dev 2012-07-12 03:52:49 UTC
hmm; 
but this module was deprecated since pymongo 1.9 in favor of bson.binary

so this is known.

sed -e 's:pymongo.binary:bson.binary:' -i celery/backends/mongodb.py || die

from 422661 adjusts celery's mongodb.py directly to use bson.
422661 is yet to be actioned.  
enough said. iksaif will sort them.
Comment 4 Corentin Chary (RETIRED) gentoo-dev 2012-07-17 15:11:07 UTC
Thanks