Quantcast
Viewing latest article 1
Browse Latest Browse All 18

CentOS Python crash after update: Urandom [SOLVED]

We updated our CentOS machines and when we restarted our Apache servers, and tried to access the sites, a “500 Internal Server Error” was being shown.

We noticed some ugly shit in Apache error.log:

ImportError: cannot import name urandom
[Tue Nov 27 11:45:17 2012] [error] make_obcallback: Python path being used "['/usr/lib64/python2.4/site-packages/setuptools-0.6c5-py2.4.egg', '/usr/lib64/python2.4/site-packages/rdflib-2.4.0-py2.4-linux-x86_64.egg', '/usr/lib64/python2.4/site-packages/cx_Oracle-5.0-py2.4-linux-x86_64.egg', '/usr/lib64/python2.4/site-packages/MySQL_python-1.2.2-py2.4-linux-x86_64.egg', '/usr/lib/python2.4/site-packages/pylint-0.18.1-py2.4.egg', '/usr/lib/python2.4/site-packages/logilab_astng-0.19.1-py2.4.egg', '/usr/lib/python2.4/site-packages/logilab_common-0.44.0-py2.4.egg', '/usr/lib/python2.4/site-packages/pysnmp_apps-0.2.9a-py2.4.egg', '/usr/lib/python2.4/site-packages/pysnmp-4.1.13a-py2.4.egg', '/usr/lib/python2.4/site-packages/pyasn1-0.0.11a-py2.4.egg', '/usr/lib64/python24.zip', '/usr/lib64/python2.4', '/usr/lib64/python2.4/plat-linux2', '/usr/lib64/python2.4/lib-tk', '/usr/lib64/python2.4/lib-dynload', '/usr/lib64/python2.4/site-packages', '/usr/lib64/python2.4/site-packages/Numeric', '/usr/lib64/python2.4/site-packages/gtk-2.0', '/usr/lib/python2.4/site-packages']".
[Tue Nov 27 11:45:17 2012] [error] get_interpreter: no interpreter callback found.

To fix this, you must check the following:

[root@aneto ~]# rpm -q mod_python
mod_python-3.2.8-3.1
[root@aneto ~]# rpm -q httpd
httpd-2.2.3-65.el5_8.3
[root@aneto ~]# rpm -q python
python-2.4.3-46.el5_8.2

If the output is like the one above, then run:

[root@aneto ~]# yum downgrade python python-libs

And then restart Apache. Issues should be now fixed.


Viewing latest article 1
Browse Latest Browse All 18