1 (edited by riosdesantiago 2018-06-21 04:58:41)

Topic: Internal server error

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.8
- Linux/BSD distribution name and version:  UBUNTU 16.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MYSQL
- 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.
====

Whenever i try to edit system preferences in iredadmin pro, or try to edit an user i get "internal server error"
error log:

[Wed Jun 20 14:42:38.619195 2018] [wsgi:error] [pid 1775] [remote XXX.XXX.XXX.XXX:6762] Traceback (most recent call last):
[Wed Jun 20 14:42:38.619211 2018] [wsgi:error] [pid 1775] [remote XXX.XXX.XXX.XXX:6762]   File "/usr/lib/python2.7/dist-packages/web/application.py", line 239, in process
[Wed Jun 20 14:42:38.619214 2018] [wsgi:error] [pid 1775] [remote XXX.XXX.XXX.XXX:6762]     return self.handle()
[Wed Jun 20 14:42:38.619215 2018] [wsgi:error] [pid 1775] [remote XXX.XXX.XXX.XXX:6762]   File "/usr/lib/python2.7/dist-packages/web/application.py", line 230, in handle
[Wed Jun 20 14:42:38.619217 2018] [wsgi:error] [pid 1775] [remote XXX.XXX.XXX.XXX:6762]     return self._delegate(fn, self.fvars, args)
[Wed Jun 20 14:42:38.619219 2018] [wsgi:error] [pid 1775] [remote XXX.XXX.XXX.XXX:6762]   File "/usr/lib/python2.7/dist-packages/web/application.py", line 420, in _delegate
[Wed Jun 20 14:42:38.619220 2018] [wsgi:error] [pid 1775] [remote XXX.XXX.XXX.XXX:6762]     return handle_class(cls)
[Wed Jun 20 14:42:38.619222 2018] [wsgi:error] [pid 1775] [remote XXX.XXX.XXX.XXX:6762]   File "/usr/lib/python2.7/dist-packages/web/application.py", line 396, in handle_class
[Wed Jun 20 14:42:38.619224 2018] [wsgi:error] [pid 1775] [remote XXX.XXX.XXX.XXX:6762]     return tocall(*args)
[Wed Jun 20 14:42:38.619225 2018] [wsgi:error] [pid 1775] [remote XXX.XXX.XXX.XXX:6762]   File "/opt/www/iredadmin/controllers/sql/user.py", line 322, in GET
[Wed Jun 20 14:42:38.619227 2018] [wsgi:error] [pid 1775] [remote XXX.XXX.XXX.XXX:6762]     _qr = mlmmj.get_subscribed_lists(mail=mail, query_all_lists=False)
[Wed Jun 20 14:42:38.619228 2018] [wsgi:error] [pid 1775] [remote XXX.XXX.XXX.XXX:6762]   File "/opt/www/iredadmin/libs/mlmmj/__init__.py", line 327, in get_subscribed_lists
[Wed Jun 20 14:42:38.619230 2018] [wsgi:error] [pid 1775] [remote XXX.XXX.XXX.XXX:6762]     r = requests.get(url, params=params, headers=api_headers, verify=_verify_ssl)
[Wed Jun 20 14:42:38.619231 2018] [wsgi:error] [pid 1775] [remote XXX.XXX.XXX.XXX:6762]   File "/usr/lib/python2.7/dist-packages/requests/api.py", line 72, in get
[Wed Jun 20 14:42:38.619233 2018] [wsgi:error] [pid 1775] [remote XXX.XXX.XXX.XXX:6762]     return request('get', url, params=params, **kwargs)
[Wed Jun 20 14:42:38.619234 2018] [wsgi:error] [pid 1775] [remote XXX.XXX.XXX.XXX:6762]   File "/usr/lib/python2.7/dist-packages/requests/api.py", line 58, in request
[Wed Jun 20 14:42:38.619236 2018] [wsgi:error] [pid 1775] [remote XXX.XXX.XXX.XXX:6762]     return session.request(method=method, url=url, **kwargs)
[Wed Jun 20 14:42:38.619237 2018] [wsgi:error] [pid 1775] [remote XXX.XXX.XXX.XXX:6762]   File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 502, in request
[Wed Jun 20 14:42:38.619239 2018] [wsgi:error] [pid 1775] [remote XXX.XXX.XXX.XXX:6762]     resp = self.send(prep, **send_kwargs)
[Wed Jun 20 14:42:38.619240 2018] [wsgi:error] [pid 1775] [remote XXX.XXX.XXX.XXX:6762]   File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 612, in send
[Wed Jun 20 14:42:38.619246 2018] [wsgi:error] [pid 1775] [remote XXX.XXX.XXX.XXX:6762]     r = adapter.send(request, **kwargs)
[Wed Jun 20 14:42:38.619247 2018] [wsgi:error] [pid 1775] [remote XXX.XXX.XXX.XXX:6762]   File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 504, in send
[Wed Jun 20 14:42:38.619249 2018] [wsgi:error] [pid 1775] [remote XXX.XXX.XXX.XXX:6762]     raise ConnectionError(e, request=request)
[Wed Jun 20 14:42:38.619251 2018] [wsgi:error] [pid 1775] [remote XXX.XXX.XXX.XXX:6762] ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=7790): Max retries exceeded with url: /$/api/subscriber/USER@DOMAIN.com/subscribed?query_all_lists=no&email_only=no (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5844ba9a50>: Failed to establish a new connection: [Errno 111] Connection refused',))
[Wed Jun 20 14:42:38.619255 2018] [wsgi:error] [pid 1775] [remote XXX.XXX.XXX.XXX:6762]



My settings in /opt/mlmmjadmin/settings.py 

iredmail_sql_db_type = 'mysql'
iredmail_sql_db_server = '127.0.0.1'
iredmail_sql_db_port = 3306
iredmail_sql_db_name = 'vmail'
iredmail_sql_db_user = 'vmailadmin'
iredmail_sql_db_password = 'password'

MLMMJ_SPOOL_DIR = '/var/vmail/mlmmj'
MLMMJ_ARCHIVE_DIR = '/var/vmail/mlmmj-archive'
MLMMJ_DEFAULT_PROFILE_SETTINGS.update({'smtp_port': 10027})

I updated mlmmj to version 1.4 the issue still persist

Checking this thread:
https://forum.iredmail.org/topic14265-i … -page.html

If i run the command    python mlmmjadmin.py     in      cd /opt/mlmmjadmin/

Everything works fine as long as i don't cancel the command, any suggestions?

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: Internal server error

riosdesantiago wrote:

[Wed Jun 20 14:42:38.619251 2018] [wsgi:error] [pid 1775] [remote XXX.XXX.XXX.XXX:6762] ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=7790): Max retries exceeded with url: /$/api/subscriber/USER@DOMAIN.com/subscribed?query_all_lists=no&email_only=no (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5844ba9a50>: Failed to establish a new connection: [Errno 111] Connection refused',))

This means iRedAdmin-Pro cannot connect to 127.0.0.1:7790.

After stopped mlmmjadmin service you started manually, then run 'service mlmmjadmin restart', is port 7790 open? You can check with command:

netstat -ntlp | grep 7790

3 (edited by riosdesantiago 2018-06-21 06:27:47)

Re: Internal server error

Running the command      sudo netstat -tulnp | grep 7790    does nothing, i get no output



the mlmmjadmin service seems not able to run even with restart command, i executed  service mlmmjadmin status and this what i get:

● 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 mié 2018-06-20 16:21:42 MDT; 4s ago
  Process: 21157 ExecStopPost=/bin/rm -rf /var/run/mlmmjadmin (code=exited, status=0/SUCCESS)
  Process: 21154 ExecStop=/usr/bin/uwsgi --stop /var/run/mlmmjadmin/mlmmjadmin.pid (code=exited, status=255)
  Process: 21150 ExecStart=/usr/bin/uwsgi --ini /opt/mlmmjadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/mlmmjadmin/mlmmjadmin.pid (code=exited, status=1/FAILURE)
  Process: 21146 ExecStartPre=/bin/chmod 0755 /var/run/mlmmjadmin (code=exited, status=0/SUCCESS)
  Process: 21138 ExecStartPre=/bin/chown mlmmj:mlmmj /var/run/mlmmjadmin (code=exited, status=0/SUCCESS)
  Process: 21135 ExecStartPre=/bin/mkdir -p /var/run/mlmmjadmin (code=exited, status=0/SUCCESS)
Main PID: 21150 (code=exited, status=1/FAILURE)

jun 20 16:21:42 mail systemd[1]: Starting RESTful API server used to manage mlmmj mailing list manager...
jun 20 16:21:42 mail systemd[1]: Started RESTful API server used to manage mlmmj mailing list manager.
jun 20 16:21:42 mail uwsgi[21150]: [uWSGI] getting INI configuration from /opt/mlmmjadmin/rc_scripts/uwsgi/debian.ini
jun 20 16:21:42 mail systemd[1]: mlmmjadmin.service: Main process exited, code=exited, status=1/FAILURE
jun 20 16:21:42 mail uwsgi[21154]: signal_pidfile()/kill(): No such process [core/uwsgi.c line 1654]
jun 20 16:21:42 mail systemd[1]: mlmmjadmin.service: Control process exited, code=exited status=255
jun 20 16:21:42 mail systemd[1]: mlmmjadmin.service: Unit entered failed state.
jun 20 16:21:42 mail systemd[1]: mlmmjadmin.service: Failed with result 'exit-code'.

4

Re: Internal server error

Try this:

- Did you get any log in /var/log/syslog right after restart mlmmjadmin service? If you're not sure, try to restart mlmmjadmin again and check log file immediately.
- Show us the directory permissions:

ls -dl /var/vmail
ls -dl /var/vmail/mlmmj
ls -dl /var/vmail/mlmmj-archive

mlmmjadmin will exist if it cannot access the latter 2.

5

Re: Internal server error

ZhangHuangbin wrote:

Try this:

- Did you get any log in /var/log/syslog right after restart mlmmjadmin service? If you're not sure, try to restart mlmmjadmin again and check log file immediately.
- Show us the directory permissions:

ls -dl /var/vmail
ls -dl /var/vmail/mlmmj
ls -dl /var/vmail/mlmmj-archive

mlmmjadmin will exist if it cannot access the latter 2.


Yei!  I found the error thanks to you!

I had:
drwxrwx--- 8 vmail vmail 4096 may  9 /var/vmail

And it should be
drwxrwxr-x 8 vmail vmail 4096 may  9 /var/vmail

After fixing those permissions the service started correctly

Thanks!!