Topic: iRedAdmin : ImportError: No module named settings
============ Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.4
- Linux/BSD distribution name and version: Debian 8.3
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): Mysql
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No (postfixadmin)
- Related log if you're reporting an issue: See in post
====
I Switched from apache to Nginx (much simpler config in my eyes, apache is a mess), everything works as intended exept iRedAdmin,
So I added UWSGI (and depandancy), copy the configuration files.
cat /etc/uwsgi/apps-enabled/iredadmin.ini
[uwsgi]
plugins=python
vhost=true
socket=/var/run/uwsgi/app/iredadmin/iredadmin.socket
it starts, with no error in log, then here is the configuration of Nginx
# iRedAdmin: static files under /iredadmin/static
location ~ ^/iredadmin/static/(.*)\.(png|jpg|gif|css|js) {
alias /usr/share/apache2/iredadmin/static/$1.$2;
}
# iRedAdmin: Python scripts
location ~ ^/iredadmin(.*) {
rewrite ^/iredadmin(/.*)$ $1 break;
include uwsgi_params;
uwsgi_pass unix:/var/run/uwsgi/app/iredadmin/iredadmin.socket;
uwsgi_param UWSGI_CHDIR /usr/share/apache2/iredadmin;
uwsgi_param UWSGI_SCRIPT iredadmin;
uwsgi_param SCRIPT_NAME /iredadmin;
}
# iRedAdmin: redirect /iredadmin to /iredadmin/
location = /iredadmin {
rewrite ^ /iredadmin/;
}
Socket exist, path are valid, I'm able to load it in the browser, but I have : "Internal Server Error" that show up.
And i Have in /var/log/uwsgi/app/iredadmin.log
Traceback (most recent call last):
File "/usr/share/apache2/iRedAdmin-0.5/iredadmin.py", line 9, in <module>
from libs import iredbase
File "/usr/share/apache2/iRedAdmin-0.5/libs/iredbase.py", line 18, in <module>
import iredutils
File "/usr/share/apache2/iRedAdmin-0.5/libs/iredutils.py", line 14, in <module>
import settings
ImportError: No module named settings
Tue Mar 8 14:33:37 2016 - unable to load app 0 (mountpoint='mail.DOMAIN.com|/iredadmin') (callable not found or import error)
Tue Mar 8 14:33:37 2016 - --- no python application found, check your startup logs for errors ---
mail.DOMAIN.com [pid: 4078|app: -1|req: -1/3] 192.168.10.104 () {50 vars in 899 bytes} [Tue Mar 8 14:33:37 2016] GET /iredadmin/ => generated 21 bytes in 4 msecs (HTTP/1.1 500) 2 headers in 83 bytes (0 switches on core 0)
I Checked in the /usr/share/apache2/iredadmin/ folder, here is the content :
ls -lah /usr/share/apache2/iredadmin/
total 100K
dr-xr-xr-x 9 iredadmin iredadmin 4.0K Mar 8 14:32 .
drwxr-xr-x 20 root root 4.0K Mar 8 14:31 ..
-r-xr-xr-x 1 iredadmin iredadmin 49 Mar 8 14:31 AUTHORS
-r-xr-xr-x 1 iredadmin iredadmin 7.3K Mar 8 14:31 ChangeLog
-r-xr-xr-x 1 iredadmin iredadmin 18K Mar 8 14:31 LICENSE
-r-xr-xr-x 1 iredadmin iredadmin 439 Mar 8 14:31 README
dr-xr-xr-x 6 iredadmin iredadmin 4.0K Jan 27 17:54 controllers
dr-xr-xr-x 3 iredadmin iredadmin 4.0K Jan 27 17:54 docs
dr-xr-xr-x 18 iredadmin iredadmin 4.0K Jan 27 17:54 i18n
-r-xr-xr-x 1 iredadmin iredadmin 402 Mar 8 14:31 iredadmin.py
dr-xr-xr-x 6 iredadmin iredadmin 4.0K Mar 8 14:31 libs
-r-------- 1 iredadmin iredadmin 4.2K Mar 8 14:31 settings.py
-r-xr-xr-x 1 iredadmin iredadmin 4.1K Mar 8 14:31 settings.py.ldap.sample
-r-xr-xr-x 1 iredadmin iredadmin 3.5K Mar 8 14:31 settings.py.mysql.sample
-r-xr-xr-x 1 iredadmin iredadmin 3.5K Mar 8 14:31 settings.py.pgsql.sample
dr-xr-xr-x 4 iredadmin iredadmin 4.0K Jan 27 17:54 static
dr-xr-xr-x 3 iredadmin iredadmin 4.0K Jan 27 17:54 templates
dr-xr-xr-x 2 iredadmin iredadmin 4.0K Mar 8 14:31 tools
iRedAdmin version is 0.5, I tried to rerun the tools/upgrade_iredadmin.sh witch worked without any error.
I cant figure out why, settings.py cant be loaded.
Any hint ?
PS:settings.py do contains correct settings for my installation.
PSPS: Thanks, again, for iredmail, it's quite nice.
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.