1

Topic: ireadmin inaccessible after system update

==== Provide required information ====
- iRedMail version and backend (LDAP/MySQL/PGSQL): MYSQL
- Linux/BSD distribution name and version: CentOS 6.2 x64
- Any related log? Log is helpful for troubleshooting.
====
So, I updated today one of the servers i manage and between the updates there was a python update ( python.x86_64 0:2.6.6-29.el6_2.2 and python-libs.x86_64 0:2.6.6-29.el6_2.2 )
After the update the link to iredadmin doesnt work anymore, it show a internal server error.
Logs bellow.


[Tue Jun 19 16:50:42 2012] [error] [client 192.168.1.1] mod_wsgi (pid=15169): Target WSGI script '/var/www/iredadmin/iredadmin.py' cannot be loaded as Python module.
[Tue Jun 19 16:50:42 2012] [error] [client 192.168.1.1] mod_wsgi (pid=15169): Exception occurred processing WSGI script '/var/www/iredadmin/iredadmin.py'.
[Tue Jun 19 16:50:42 2012] [error] [client 192.168.1.1] Traceback (most recent call last):
[Tue Jun 19 16:50:42 2012] [error] [client 192.168.1.1]   File "/var/www/iredadmin/iredadmin.py", line 10, in <module>
[Tue Jun 19 16:50:42 2012] [error] [client 192.168.1.1]     from libs import iredbase
[Tue Jun 19 16:50:42 2012] [error] [client 192.168.1.1]   File "/var/www/iredadmin/libs/iredbase.py", line 7, in <module>
[Tue Jun 19 16:50:42 2012] [error] [client 192.168.1.1]     import web
[Tue Jun 19 16:50:42 2012] [error] [client 192.168.1.1]   File "/usr/lib/python2.6/site-packages/web/__init__.py", line 14, in <module>
[Tue Jun 19 16:50:42 2012] [error] [client 192.168.1.1]     import utils, db, net, wsgi, http, webapi, httpserver, debugerror
[Tue Jun 19 16:50:42 2012] [error] [client 192.168.1.1]   File "/usr/lib/python2.6/site-packages/web/wsgi.py", line 8, in <module>
[Tue Jun 19 16:50:42 2012] [error] [client 192.168.1.1]     import http
[Tue Jun 19 16:50:42 2012] [error] [client 192.168.1.1]   File "/usr/lib/python2.6/site-packages/web/http.py", line 16, in <module>
[Tue Jun 19 16:50:42 2012] [error] [client 192.168.1.1]     import net, utils, webapi as web
[Tue Jun 19 16:50:42 2012] [error] [client 192.168.1.1]   File "/usr/lib/python2.6/site-packages/web/webapi.py", line 31, in <module>
[Tue Jun 19 16:50:42 2012] [error] [client 192.168.1.1]     import sys, cgi, Cookie, pprint, urlparse, urllib
[Tue Jun 19 16:50:42 2012] [error] [client 192.168.1.1]   File "/usr/lib64/python2.6/cgi.py", line 49, in <module>
[Tue Jun 19 16:50:42 2012] [error] [client 192.168.1.1]     import mimetools
[Tue Jun 19 16:50:42 2012] [error] [client 192.168.1.1]   File "/usr/lib64/python2.6/mimetools.py", line 6, in <module>
[Tue Jun 19 16:50:42 2012] [error] [client 192.168.1.1]     import tempfile
[Tue Jun 19 16:50:42 2012] [error] [client 192.168.1.1]   File "/usr/lib64/python2.6/tempfile.py", line 34, in <module>
[Tue Jun 19 16:50:42 2012] [error] [client 192.168.1.1]     from random import Random as _Random
[Tue Jun 19 16:50:42 2012] [error] [client 192.168.1.1]   File "/usr/lib64/python2.6/random.py", line 47, in <module>
[Tue Jun 19 16:50:42 2012] [error] [client 192.168.1.1]     from os import urandom as _urandom
[Tue Jun 19 16:50:42 2012] [error] [client 192.168.1.1] ImportError: cannot import name urandom

Anyway to resolv this problem ?
Thanks

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: ireadmin inaccessible after system update

File "/usr/lib64/python2.6/random.py", line 47, in <module>
    from os import urandom as _urandom
ImportError: cannot import name urandom

os module is a core module shipped in Python. Does this command for you in command line:

# python
>>> from os import urandom as _urandom
>>>

If it returns nothing, then it works. If it raises the same error message, there's something wrong with your Python update.

3

Re: ireadmin inaccessible after system update

server1 ~: python
Python 2.6.6 (r266:84292, Jun 18 2012, 14:18:47)
[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from os import urandom as _urandom
>>>

Nothing happens so its working; after a httpd restart everything works as intend.
Thanks for the support and hard work