1

Topic: iRedAdmin Problem after 0.9.5(-1) Upgrade

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.5-1
- Linux/BSD distribution name and version: Debian 8
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Apache2
- Manage mail accounts with iRedAdmin-Pro? No
- Related log if you're reporting an issue: /var/log/apache2/error.log
====

Hi there. After having upgraded to 0.9.5-1, I seem to have a problem with Apache and iRedAdmin. I'm not quite sure why I'm getting a 500 Internal Server Error, but the related logs for apache (/var/log/apache2/error.log) has this to say:

[Mon May 23 23:04:27.055754 2016] [core:notice] [pid 18476] AH00094: Command line: '/usr/sbin/apache2'
[Mon May 23 23:04:33.213604 2016] [wsgi:error] [pid 18480] [remote 192.168.1.1:512] mod_wsgi (pid=18480): Target WSGI script '/opt/www/iredadmin/iredadmin.py' cannot be loaded as Python module.
[Mon May 23 23:04:33.214114 2016] [wsgi:error] [pid 18480] [remote 192.168.1.1:512] mod_wsgi (pid=18480): Exception occurred processing WSGI script '/opt/www/iredadmin/iredadmin.py'.
[Mon May 23 23:04:33.214288 2016] [wsgi:error] [pid 18480] [remote 192.168.1.1:512] Traceback (most recent call last):
[Mon May 23 23:04:33.214408 2016] [wsgi:error] [pid 18480] [remote 192.168.1.1:512]   File "/opt/www/iredadmin/iredadmin.py", line 9, in <module>
[Mon May 23 23:04:33.214809 2016] [wsgi:error] [pid 18480] [remote 192.168.1.1:512]     from libs import iredbase
[Mon May 23 23:04:33.214909 2016] [wsgi:error] [pid 18480] [remote 192.168.1.1:512]   File "/opt/www/iredadmin/libs/iredbase.py", line 18, in <module>
[Mon May 23 23:04:33.215346 2016] [wsgi:error] [pid 18480] [remote 192.168.1.1:512]     import iredutils
[Mon May 23 23:04:33.215448 2016] [wsgi:error] [pid 18480] [remote 192.168.1.1:512]   File "/opt/www/iredadmin/libs/iredutils.py", line 14, in <module>
[Mon May 23 23:04:33.216236 2016] [wsgi:error] [pid 18480] [remote 192.168.1.1:512]     import settings
[Mon May 23 23:04:33.216428 2016] [wsgi:error] [pid 18480] [remote 192.168.1.1:512] ImportError: No module named settings

Anyone have any advice as to how to fix this?

Thanks in advance!

----

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

2

Re: iRedAdmin Problem after 0.9.5(-1) Upgrade

SteveLuxe wrote:

[Mon May 23 23:04:33.216428 2016] [wsgi:error] [pid 18480] [remote 192.168.1.1:512] ImportError: No module named settings

Seems file permission issue. Please show us output of commands below:

ls -l /opt/www/
ls -l /opt/www/iredadmin/

3

Re: iRedAdmin Problem after 0.9.5(-1) Upgrade

Hi Zhang!

Here's the result of ls -l /opt/www/

lrwxrwxrwx  1 root     root       15 May 23 22:34 iredadmin -> iRedAdmin-0.6.1
dr-xr-xr-x  9 www-data www-data 4096 May 23 23:02 iRedAdmin-0.6.1
lrwxrwxrwx  1 root     root       28 Aug 22  2015 roundcubemail -> /opt/www/roundcubemail-1.2.0
drwxr-xr-x 12 root     root     4096 May 23 22:40 roundcubemail-1.2.0


Here are the results of ls -l /opt/www/iredadmin

root@mail /var/log/apache2 # ls -l /opt/www/iredadmin/
total 88
-r-xr-xr-x  1 www-data www-data    49 May 23 22:34 AUTHORS
-r-xr-xr-x  1 www-data www-data  8028 May 23 22:34 ChangeLog
dr-xr-xr-x  6 www-data www-data  4096 May 23 22:34 controllers
dr-xr-xr-x  3 www-data www-data  4096 May 23 22:34 docs
dr-xr-xr-x 18 www-data www-data  4096 May 23 22:34 i18n
-r-xr-xr-x  1 www-data www-data   402 May 23 22:34 iredadmin.py
dr-xr-xr-x  6 www-data www-data  4096 May 23 22:34 libs
-r-xr-xr-x  1 www-data www-data 18092 May 23 22:34 LICENSE
-r-xr-xr-x  1 www-data www-data   264 May 23 22:34 README
-r--------  1 www-data www-data  4080 May 23 22:34 settings.py
-r-xr-xr-x  1 www-data www-data  4138 May 23 22:34 settings.py.ldap.sample
-r-xr-xr-x  1 www-data www-data  3512 May 23 22:34 settings.py.mysql.sample
-r-xr-xr-x  1 www-data www-data  3494 May 23 22:34 settings.py.pgsql.sample
dr-xr-xr-x  4 www-data www-data  4096 May 23 22:34 static
dr-xr-xr-x  3 www-data www-data  4096 May 23 22:34 templates
dr-xr-xr-x  2 www-data www-data  4096 May 23 22:34 tools

4

Re: iRedAdmin Problem after 0.9.5(-1) Upgrade

Never mind... All good. I re-ran the upgrade script, and it seemed to resolve the problem. I'm no longer getting a 500 Internal Server Error after the upgrade script was re-run. Thanks for the help, Zhang!



SteveLuxe wrote:

Hi Zhang!

Here's the result of ls -l /opt/www/

lrwxrwxrwx  1 root     root       15 May 23 22:34 iredadmin -> iRedAdmin-0.6.1
dr-xr-xr-x  9 www-data www-data 4096 May 23 23:02 iRedAdmin-0.6.1
lrwxrwxrwx  1 root     root       28 Aug 22  2015 roundcubemail -> /opt/www/roundcubemail-1.2.0
drwxr-xr-x 12 root     root     4096 May 23 22:40 roundcubemail-1.2.0


Here are the results of ls -l /opt/www/iredadmin

root@mail /var/log/apache2 # ls -l /opt/www/iredadmin/
total 88
-r-xr-xr-x  1 www-data www-data    49 May 23 22:34 AUTHORS
-r-xr-xr-x  1 www-data www-data  8028 May 23 22:34 ChangeLog
dr-xr-xr-x  6 www-data www-data  4096 May 23 22:34 controllers
dr-xr-xr-x  3 www-data www-data  4096 May 23 22:34 docs
dr-xr-xr-x 18 www-data www-data  4096 May 23 22:34 i18n
-r-xr-xr-x  1 www-data www-data   402 May 23 22:34 iredadmin.py
dr-xr-xr-x  6 www-data www-data  4096 May 23 22:34 libs
-r-xr-xr-x  1 www-data www-data 18092 May 23 22:34 LICENSE
-r-xr-xr-x  1 www-data www-data   264 May 23 22:34 README
-r--------  1 www-data www-data  4080 May 23 22:34 settings.py
-r-xr-xr-x  1 www-data www-data  4138 May 23 22:34 settings.py.ldap.sample
-r-xr-xr-x  1 www-data www-data  3512 May 23 22:34 settings.py.mysql.sample
-r-xr-xr-x  1 www-data www-data  3494 May 23 22:34 settings.py.pgsql.sample
dr-xr-xr-x  4 www-data www-data  4096 May 23 22:34 static
dr-xr-xr-x  3 www-data www-data  4096 May 23 22:34 templates
dr-xr-xr-x  2 www-data www-data  4096 May 23 22:34 tools