2364: WSGI exception

sarc*****@gmai***** (Google Code) (Is this you? Claim this profile.)
Nov. 27, 2011
What version are you running?
ReviewBoard 1.6.1
Apache and mod_wsgi
MySql
Python 2.6.5

What's the URL of the page containing the problem?
http://reviewbd/reviews.wae.com

What steps will reproduce the problem?
1. Attempt to install on Ubuntu 10.04.3

This appears to be some kind of Django or mod_wsgi issue, but I've tried re-installing with no luck.  The only questionable part of the installation seemed to be the install of pycrypto -- I started with version 2.3, but then dropped back down to 2.1 after seeing that users had issues with newer versions.


What is the expected output? What do you see instead?
Initial screen displays "Review Board is taking a nap" message.

What operating system are you using? What browser?
Ubuntu 10.04.3
IE 8 browser

Please provide any additional information below.

Apache error log:
PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/mcrypt.ini on line 1 in Unknown on line 0
[Wed Nov 02 09:21:27 2011] [notice] mod_python: Creating 8 session mutexes based on 150 max processes and 0 max threads.
[Wed Nov 02 09:21:27 2011] [notice] mod_python: using mutex_directory /tmp
[Wed Nov 02 09:21:27 2011] [notice] Apache/2.2.14 (Ubuntu) PHP/5.3.2-1ubuntu4.10 with Suhosin-Patch mod_python/3.3.1 Python/2.6.5 mod_wsgi/2.8 configured -- resuming normal operations
[Wed Nov 02 08:21:33 2011] [error] /usr/local/lib/python2.6/dist-packages/ReviewBoard-1.6.1-py2.6.egg/reviewboard/accounts/backends.py:2: UserWarning: Module _mysql was already imported from /usr/lib/pymodules/python2.6/_mysql.so, but /usr/lib/pymodules/python2.6 is being added to sys.path
[Wed Nov 02 08:21:33 2011] [error]   import pkg_resources
[Wed Nov 02 08:21:33 2011] [error] [client 135.9.58.19] mod_wsgi (pid=16009): Exception occurred processing WSGI script '/var/www/reviews.wae.com/htdocs/reviewboard.wsgi'.
[Wed Nov 02 08:21:33 2011] [error] [client 135.9.58.19] Traceback (most recent call last):
[Wed Nov 02 08:21:33 2011] [error] [client 135.9.58.19]   File "/usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/core/handlers/wsgi.py", line 250, in __call__
[Wed Nov 02 08:21:33 2011] [error] [client 135.9.58.19]     self.load_middleware()
[Wed Nov 02 08:21:33 2011] [error] [client 135.9.58.19]   File "/usr/local/lib/python2.6/dist-packages/Django-1.3.1-py2.6.egg/django/core/handlers/base.py", line 47, in load_middleware
[Wed Nov 02 08:21:33 2011] [error] [client 135.9.58.19]     raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e))
[Wed Nov 02 08:21:33 2011] [error] [client 135.9.58.19] ImproperlyConfigured: Error importing middleware reviewboard.admin.middleware: "cannot import name Random"
#1 elias.herm**********@gmai***** (Google Code) (Is this you? Claim this profile.)
I got the same with one extra line (?) in the error.log:

File does not exist: /var/www/reviews/htdocs/media/rbcommons
#2 andrew.se*********@gmai***** (Google Code) (Is this you? Claim this profile.)
I had the same issue. 
The root cause of the issue: the module pycrypto on your Linux box is old and does not contain the function Random.
I upgraded the pycrypto module and issue disappeared.

Try to upgrade pycrypto module:
easy_install --upgrade pycrypto 

and restart apache after that...

david
#3 david
  • +ThirdParty
#4 bruc****@gmai***** (Google Code) (Is this you? Claim this profile.)
easy_install --upgrade pycrypto in Windows Server 2003, but error display:
 
Searching for pycrypto
Reading http://pypi.python.org/simple/pycrypto/
Reading http://pycrypto.sourceforge.net
Reading http://www.amk.ca/python/code/crypto
Reading http://www.pycrypto.org/
Best match: pycrypto 2.5
Downloading http://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-2.5.tar.gz
Processing pycrypto-2.5.tar.gz
Running pycrypto-2.5\setup.py -q bdist_egg --dist-dir c:\docume~1\admini~1\local
s~1\temp\1\easy_install-ff6uwf\pycrypto-2.5\egg-dist-tmp-miisdb
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.

error: Setup script exited with error: Unable to find vcvarsall.bat
#5 bachirt********@gmai***** (Google Code) (Is this you? Claim this profile.)
Thanks  andrew ;-) works fine for me.
#6 Amardeep*********@druv***** (Google Code) (Is this you? Claim this profile.)
Processing dependencies for Paramiko
Searching for pycrypto>=2.1,!=2.4
Reading http://pypi.python.org/simple/pycrypto/
Reading http://pycrypto.sourceforge.net
Reading http://www.pycrypto.org/
Reading http://www.amk.ca/python/code/crypto
Best match: pycrypto 2.6
Downloading http://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-2.6.tar.gz
Processing pycrypto-2.6.tar.gz
Running pycrypto-2.6\setup.py -q bdist_egg --dist-dir c:\users\XXXXXX\....
p\easy_install-x8gmro\pycrypto-2.6\egg-dist-tmp-72l0hj
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
error: Setup script exited with error: Unable to find vcvarsall.bat