PicklingError on Apache using WSGI

Issue #143 new
Anonymous created an issue

I am using HayStack version 1.2.1 and Whoosh version 1.8.3. I turned on RealTimeSearchIndex so that the search index is updated anytime something is added or removed from my site. When I run on the django (1.2.4) test server everything works as expected. When I moved the site over to Apache using WSGI I get an error about 1 in 3 times when adding something new.



PicklingError at /recipe/new/ Can't pickle <type 'function'>: attribute lookup builtin.function failed Request Method: POST Request URL: http://new.openeats.org/recipe/new/ Django Version: 1.2.4 Exception Type: PicklingError Exception Value:
Can't pickle <type 'function'>: attribute lookup builtin.function failed Exception Location: /opt/local/virtenvs/oe2demo/lib/python2.6/site-packages/whoosh/filedb/fileindex.py in _write_toc, line 110 Python Executable: /usr/bin/python Python Version: 2.6.5 Python Path: ['/opt/local/virtenvs/BASE/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg', '/opt/local/virtenvs/BASE/lib/python2.6/site-packages/pip-0.8.1-py2.6.egg', '/opt/local/virtenvs/oe2demo/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg', '/opt/local/virtenvs/oe2demo/lib/python2.6/site-packages/pip-0.8.1-py2.6.egg', '/opt/local/virtenvs/BASE/lib/python26.zip', '/opt/local/virtenvs/BASE/lib/python2.6', '/opt/local/virtenvs/BASE/lib/python2.6/plat-linux2', '/opt/local/virtenvs/BASE/lib/python2.6/lib-tk', '/opt/local/virtenvs/BASE/lib/python2.6/lib-old', '/opt/local/virtenvs/BASE/lib/python2.6/lib-dynload', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/opt/local/virtenvs/BASE/lib/python2.6/site-packages', '/opt/local/virtenvs/oe2demo/lib/python2.6/site-packages', '/opt/local/virtenvs/oe2demo/lib/python2.6/site-packages/PIL', '/var/www/oe2demo/', '/var/www/oe2demo/openeats/'] Server time: Wed, 25 May 2011 06:32:40 -0500 }}}

I actually first noticed this with DjangoBB and thought it was a issue with that code. However now it is occurring in my code as well as soon as I turned on RealTimeSearch.

Comments (2)

  1. Anonymous

    I think I may see the issue. When whoosh is creating the search index it is creating it with rw-r-r permissions. I am running apache as the owner apache and the group apache. Of course the user apache is in the apache group. So since the index are being created with only read privileges for the group, apache is unable to edit the index files when a new item is added. I changed apache to run as the group nobody, which the apache user is not part of. Since doing this I have not had a pickling error issue.

  2. Log in to comment