Psycojoker / dierentheater

lachambre.be_to_json
GNU Affero General Public License v3.0
8 stars 6 forks source link

Create collection error with recent MongoDB version #3

Closed mhermans closed 10 years ago

mhermans commented 11 years ago

Running syncdb after a clean install with pip -r results in this error:

pymongo.errors.OperationFailure: command SON([('create', u'django_content_type'), ('max', False), ('capped', False), ('size', 0.0)]) failed: exception: create collection invalid size spec

It seems related to running older django-norel versions with a recent version of MongoDB.

I adapted the requirements-file to use the most recent versions of the various django-norel components, but now I get this error when running syncdb:

AttributeError: 'list' object has no attribute 'iteritems'

Psycojoker commented 11 years ago

Hello Maarten,

Thanks for taking the time to report this bug.

Which version of mongodb are you using? Things are working fine with "db version v2.0.4, pdfile version 4.5" here (Ubuntu LTS). Also, can you give me the updated version of you requirements.txt plz?

There is chances that this issue is related to django-nonrel not supporting the latest version of mongodb (but I haven't checked it it's the case).

Kind regards,

mhermans commented 11 years ago

Cf. the third link for my adapted requirements-files. For MongoDB I'm using the 10gen-repository on Ubuntu, which results in this version:

db.runCommand("buildInfo") { "version" : "2.4.6", "gitVersion" : "b9925db5eac369d77a3a5f5d98a145eaaacd9673", "sysInfo" : "Linux ip-10-2-29-40 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_49", "loaderFlags" : "-fPIC -pthread -rdynamic", "compilerFlags" : "-Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -pipe -fno-builtin-memcmp -O3", "allocator" : "tcmalloc", "versionArray" : [ 2, 4, 6, 0 ], "javascriptEngine" : "V8", "bits" : 64, "debug" : false, "maxBsonObjectSize" : 16777216, "ok" : 1 }

Psycojoker commented 11 years ago

"Oups", didn't checked well enough.

Just to inform you: I've managed to reproduce the bug.

But has you can guess by looking at the hour, I don't have that much time right now to invest in debugging this (and my 5min attempts didn't succeed). I'll try to find time in the next days.

mhermans commented 10 years ago

Any updates on this issue? Or recommendations on which versions of the different components would work together?

Psycojoker commented 10 years ago

Oups, sorry, this issue completely fall out of my scope, my bad :/

I'm using in this in production and it works fine (comes with debian stable or ubuntu LTS):

bram@memopol:~$ mongod --version
db version v2.0.6, pdfile version 4.5

I'm also using the versions of the python libs specified in the master requirements.txt.

FYI: lachambre.be has changed their layout, so most of my parsers are broken for the moment. But, the changes are very minor (generally it means changing from the X table of the page to the 2 or 3) but I haven't taken the time to fix those (except the deputies one) since I'm on other projects and DierenTheater hasn't got any urgent request. If you want some parsers (it can be all), just ask me and I'll took the time to fix them. I have way more free time now.

Psycojoker commented 10 years ago

Ohai,

I've made it works with the latest version of mongodb (version 2.6), the changes are in the requirements.txt, can you confirm that it's working for you?

FYI I've followed https://django-mongodb-engine.readthedocs.org/en/latest/topics/setup.html and fixed the git+... links to the commits I've used.

I'm also going to try to clean a bit the code (at least the commands/interface and remove lxml) and fix the parsers in the next days.

mhermans commented 10 years ago

Thanks for the effort.

Running pip install -r requirements.txt from the updated requirements (on a clean virtualenv) results in the following install-error:

  Running setup.py install for django-mongodb-engine
    ERROR:root:Error while trying to get django settings module.
    Error was: Requested setting INSTALLED_APPS, but settings are not 
        configured. You must either define the environment variable 
        DJANGO_SETTINGS_MODULE or call settings.configure() before 
        accessing settings.

Setting the required environmental variables (I think) as so

export PYTHONPATH=$PYTHONPATH:$PWD
export DJANGO_SETTINGS_MODULE=settings

allows the install to pass without this error.

Running python manage.py syncdb however results in the same error:

ImportError: No module named django_extensions

Uncommenting the django_extensions line in settings.py seems to allow it to work (apart from some depreciation warnings). I do however not know how to test this, running python manage.py scrape --deputies results in

Unknown command: 'scrape'

So, I'm guessing that the Mongodb-version error that this issue is about is fixed (and can be closed AFAIC), but I'm still struggling with the requirements-stack to evaluate it...

Psycojoker commented 10 years ago

Fixed after discussion.