1 (edited by jobu 2019-01-10 15:55:27)

Topic: Internal Server Error after upgrade when changing users profile (wsgi)

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.9
- Deployed with iRedMail Easy or the downloadable installer? downloadable installer
- Linux/BSD distribution name and version: Debian 9.6
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hello

after an upgrade from 0.9.8 to 0.9.9 i get an internal server error when trying to edit a users profile with iRedAdmin-Pro. Apaches error.log:

[DoW Mon xx xx:xx:xx.199605 2019] [wsgi:error] [pid 24759] [remote x.x.x.x:41744] Traceback (most recent call last):
[DoW Mon xx xx:xx:xx.199642 2019] [wsgi:error] [pid 24759] [remote x.x.x.x:41744]   File "/usr/lib/python2.7/dist-packages/web/application.py", line 239, in process
[DoW Mon xx xx:xx:xx.199657 2019] [wsgi:error] [pid 24759] [remote x.x.x.x:41744]     return self.handle()
[DoW Mon xx xx:xx:xx.199671 2019] [wsgi:error] [pid 24759] [remote x.x.x.x:41744]   File "/usr/lib/python2.7/dist-packages/web/application.py", line 230, in handle
[DoW Mon xx xx:xx:xx.199685 2019] [wsgi:error] [pid 24759] [remote x.x.x.x:41744]     return self._delegate(fn, self.fvars, args)
[DoW Mon xx xx:xx:xx.199698 2019] [wsgi:error] [pid 24759] [remote x.x.x.x:41744]   File "/usr/lib/python2.7/dist-packages/web/application.py", line 462, in _delegate
[DoW Mon xx xx:xx:xx.199712 2019] [wsgi:error] [pid 24759] [remote x.x.x.x:41744]     return handle_class(cls)
[DoW Mon xx xx:xx:xx.199725 2019] [wsgi:error] [pid 24759] [remote x.x.x.x:41744]   File "/usr/lib/python2.7/dist-packages/web/application.py", line 438, in handle_class
[DoW Mon xx xx:xx:xx.199739 2019] [wsgi:error] [pid 24759] [remote x.x.x.x:41744]     return tocall(*args)
[DoW Mon xx xx:xx:xx.199752 2019] [wsgi:error] [pid 24759] [remote x.x.x.x:41744]   File "/opt/www/iredadmin/controllers/ldap/user.py", line 293, in GET
[DoW Mon xx xx:xx:xx.199766 2019] [wsgi:error] [pid 24759] [remote x.x.x.x:41744]     _qr = mlmmj.get_subscribed_lists(mail=mail, query_all_lists=False)
[DoW Mon xx xx:xx:xx.199779 2019] [wsgi:error] [pid 24759] [remote x.x.x.x:41744]   File "/opt/www/iredadmin/libs/mlmmj/__init__.py", line 338, in get_subscribed_lists
[DoW Mon xx xx:xx:xx.199792 2019] [wsgi:error] [pid 24759] [remote x.x.x.x:41744]     r = requests.get(url, params=params, headers=api_headers, verify=_verify_ssl)
[DoW Mon xx xx:xx:xx.199806 2019] [wsgi:error] [pid 24759] [remote x.x.x.x:41744]   File "/usr/lib/python2.7/dist-packages/requests/api.py", line 70, in get
[DoW Mon xx xx:xx:xx.199819 2019] [wsgi:error] [pid 24759] [remote x.x.x.x:41744]     return request('get', url, params=params, **kwargs)
[DoW Mon xx xx:xx:xx.199832 2019] [wsgi:error] [pid 24759] [remote x.x.x.x:41744]   File "/usr/lib/python2.7/dist-packages/requests/api.py", line 56, in request
[DoW Mon xx xx:xx:xx.199846 2019] [wsgi:error] [pid 24759] [remote x.x.x.x:41744]     return session.request(method=method, url=url, **kwargs)
[DoW Mon xx xx:xx:xx.199859 2019] [wsgi:error] [pid 24759] [remote x.x.x.x:41744]   File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 488, in request
[DoW Mon xx xx:xx:xx.199873 2019] [wsgi:error] [pid 24759] [remote x.x.x.x:41744]     resp = self.send(prep, **send_kwargs)
[DoW Mon xx xx:xx:xx.199886 2019] [wsgi:error] [pid 24759] [remote x.x.x.x:41744]   File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 609, in send
[DoW Mon xx xx:xx:xx.199899 2019] [wsgi:error] [pid 24759] [remote x.x.x.x:41744]     r = adapter.send(request, **kwargs)
[DoW Mon xx xx:xx:xx.199913 2019] [wsgi:error] [pid 24759] [remote x.x.x.x:41744]   File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 487, in send
[DoW Mon xx xx:xx:xx.199926 2019] [wsgi:error] [pid 24759] [remote x.x.x.x:41744]     raise ConnectionError(e, request=request)
[DoW Mon xx xx:xx:xx.199940 2019] [wsgi:error] [pid 24759] [remote x.x.x.x:41744] ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=7790): Max retries exceeded with url: /api/subscriber/demo@example.com/subscribed?query_all_lists=no&email_only=no (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f98ebb52ad0>: Failed to establish a new connection: [Errno 111] Connection refused',))
[DoW Mon xx xx:xx:xx.199973 2019] [wsgi:error] [pid 24759] [remote x.x.x.x:41744] 

Replacing iredadmin.conf like mentioned in https://forum.iredmail.org/post66809.html#p66809 with an adjusted Alias-path for Debian doesn't help and brings up new errors (No protocol handler was valid for the URL /iredadmin/).

Any ideas ? Thanks in advance.

2

Re: Internal Server Error after upgrade when changing users profile (wsgi)

Is service "mlmmjadmin" running?

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

3

Re: Internal Server Error after upgrade when changing users profile (wsgi)

No, it isn't ...

# systemctl -l status mlmmjadmin.service

● mlmmjadmin.service - RESTful API server used to manage mlmmj mailing list manager
   Loaded: loaded (/lib/systemd/system/mlmmjadmin.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2019-01-10 13:28:51 CET; 8s ago
  Process: 2449 ExecStopPost=/bin/rm -rf /var/run/mlmmjadmin (code=exited, status=0/SUCCESS)
  Process: 2447 ExecStop=/usr/bin/uwsgi --stop /var/run/mlmmjadmin/mlmmjadmin.pid (code=exited, status=255)
  Process: 2444 ExecStart=/usr/bin/uwsgi --ini /opt/mlmmjadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/mlmmjadmin/mlmmjadmin.pid (code=exited, status=1/FAILURE)
  Process: 2442 ExecStartPre=/bin/chmod 0755 /var/run/mlmmjadmin (code=exited, status=0/SUCCESS)
  Process: 2438 ExecStartPre=/bin/chown mlmmj:mlmmj /var/run/mlmmjadmin (code=exited, status=0/SUCCESS)
  Process: 2436 ExecStartPre=/bin/mkdir -p /var/run/mlmmjadmin (code=exited, status=0/SUCCESS)
 Main PID: 2444 (code=exited, status=1/FAILURE)

Jan 10 13:28:51 mail systemd[1]: Starting RESTful API server used to manage mlmmj mailing list manager...
Jan 10 13:28:51 mail systemd[1]: Started RESTful API server used to manage mlmmj mailing list manager.
Jan 10 13:28:51 mail uwsgi[2444]: [uWSGI] getting INI configuration from /opt/mlmmjadmin/rc_scripts/uwsgi/debian.ini
Jan 10 13:28:51 mail uwsgi[2444]: *** Starting uWSGI 2.0.14-debian (64bit) on [Thu Jan 10 13:28:51 2019] ***
Jan 10 13:28:51 mail systemd[1]: mlmmjadmin.service: Main process exited, code=exited, status=1/FAILURE
Jan 10 13:28:51 mail uwsgi[2447]: signal_pidfile()/kill(): No such process [core/uwsgi.c line 1659]
Jan 10 13:28:51 mail systemd[1]: mlmmjadmin.service: Control process exited, code=exited status=255
Jan 10 13:28:51 mail systemd[1]: mlmmjadmin.service: Unit entered failed state.
Jan 10 13:28:51 mail systemd[1]: mlmmjadmin.service: Failed with result 'exit-code'.

# tail -f /var/log/syslog

Jan 10 13:28:51 mail uwsgi: mapped 436608 bytes (426 KB) for 5 cores
Jan 10 13:28:51 mail uwsgi: *** Operational MODE: preforking ***
Jan 10 13:28:51 mail uwsgi: ERROR: directory doesn't exist: /var/vmail/mlmmj.
Jan 10 13:28:51 mail uwsgi: 
Jan 10 13:28:51 mail systemd[1]: mlmmjadmin.service: Main process exited, code=exited, status=1/FAILURE
Jan 10 13:28:51 mail uwsgi[2447]: signal_pidfile()/kill(): No such process [core/uwsgi.c line 1659]
Jan 10 13:28:51 mail systemd[1]: mlmmjadmin.service: Control process exited, code=exited status=255
Jan 10 13:28:51 mail systemd[1]: mlmmjadmin.service: Unit entered failed state.
Jan 10 13:28:51 mail systemd[1]: mlmmjadmin.service: Failed with result 'exit-code'.

But the directory exists ...
# ls -hal /var/vmail/

insgesamt 12K
drwx------  7 vmail vmail   76 Dez 10 15:16 .
drwxr-xr-x 14 root  root  4,0K Sep  9  2016 ..
drwxr-xr-x  3 root  root    17 Jul 26  2017 backup
drwx------  2 mlmmj mlmmj   54 Dez 10 15:16 mlmmj
drwx------  2 mlmmj mlmmj    6 Dez 10 15:16 mlmmj-archive
drwx------ 12 vmail vmail 4,0K Jun  2  2016 sieve
drwx------ 13 vmail vmail 4,0K Jun  2  2016 vmail1

The path is set correctly in /opt/mlmmjadmin/settings.py

4

Re: Internal Server Error after upgrade when changing users profile (wsgi)

Please check permission of directory /var, also /var/vmail. It's very possible that /var/vmail is owned by vmail:vmail with permission 0700, please set it to owned by "root:root", permission 0755, then it should be fixed.

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

5

Re: Internal Server Error after upgrade when changing users profile (wsgi)

Thanks (as always) - you were right and it works now.

Best regards