1 (edited by svoboda77 2019-05-08 09:08:32)

Topic: Internal Server Error even with patch applied

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

Hello,

I am experiencing Internal Server Error on new installation of iRedMail 0.9.9 with iRedAdmin Pro 3.4, users manually migrated from old installation, it worked for a while but suddenly stopped with Internal Server Errors on most functions (Preferences, Add user etc.). Applied the patch from https://forum.iredmail.org/topic15618-i … npro.html, helped for a minute but stopped working again. Incoming and outgoing emails work fine, just iRedAdmin management has problems. This log may be relevant?

root@mx:/opt/www/iredadmin# patch -p1 < patch_001 
patching file libs/iredutils.py
May  8 02:37:47 mx uwsgi: 127.0.0.1:7790 [pid: 1664|app: 0|req: 25/51] 127.0.0.1 () {32 vars in 586 bytes} [Wed May  8 02:37:47 2019] GET /api/subscriber/postmaster@domain.cas.cz/subscribed?query_all_lists=no&email_only=yes => generated 70 bytes in 0 msecs (HTTP/1.1 200) 1 headers in 51 bytes (2 switches on core 0)
May  8 02:37:47 mx uwsgi: 127.0.0.1:7790 [pid: 1661|app: 0|req: 27/52] 127.0.0.1 () {32 vars in 584 bytes} [Wed May  8 02:37:47 2019] GET /api/subscriber/postmaster@domain.cas.cz/subscribed?query_all_lists=no&email_only=no => generated 70 bytes in 0 msecs (HTTP/1.1 200) 1 headers in 51 bytes (2 switches on core 0)
May  8 02:37:48 mx uwsgi: Traceback (most recent call last):#012  File "/usr/lib/python2.7/dist-packages/web/application.py", line 239, in process#012    return self.handle()#012  File "/usr/lib/python2.7/dist-packages/web/application.py", line 230, in handle#012    return self._delegate(fn, self.fvars, args)#012  File "/usr/lib/python2.7/dist-packages/web/application.py", line 462, in _delegate#012    return handle_class(cls)#012  File "/usr/lib/python2.7/dist-packages/web/application.py", line 438, in handle_class#012    return tocall(*args)#012  File "/opt/www/iRedAdmin-Pro-SQL-3.4/controllers/sql/user.py", line 477, in GET#012    msg=form.get('msg'),#012  File "/opt/www/iRedAdmin-Pro-SQL-3.4/libs/iredbase.py", line 179, in render_template#012    return jinja_env.get_template(template_name).render(context)#012  File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 989, in render#012    return self.environment.handle_exception(exc_info, True)#012  File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 754, in handle_exception#012    reraise(exc_type, exc_value, tb)#012  File "/opt/www/iRedAdmin-Pro-SQL-3.4/libs/../templates/default/sql/user/profile.html", line 46, in top-level template code#012    {% from "macros/msg_handlers.html" import user_msg_handler with context %}#012TypeError: unsupported operand type(s) for -=: 'unicode' and 'int'
May  8 02:37:48 mx uwsgi: 
May  8 02:37:48 mx uwsgi: mail.domain.cas.cz [pid: 1723|app: 1|req: 30/146] 147.231.28.11 () {52 vars in 1057 bytes} [Wed May  8 02:37:47 2019] GET /iredadmin/profile/user/general/postmaster@domain.cas.cz => generated 21 bytes in 982 msecs (HTTP/1.1 500) 3 headers in 190 bytes (2 switches on core 0)
May  8 02:37:50 mx uwsgi: 127.0.0.1:7790 [pid: 1661|app: 0|req: 28/53] 127.0.0.1 () {32 vars in 586 bytes} [Wed May  8 02:37:50 2019] GET /api/subscriber/postmaster@domain.cas.cz/subscribed?query_all_lists=no&email_only=yes => generated 70 bytes in 0 msecs (HTTP/1.1 200) 1 headers in 51 bytes (2 switches on core 0)
May  8 02:37:50 mx uwsgi: 127.0.0.1:7790 [pid: 1661|app: 0|req: 29/54] 127.0.0.1 () {32 vars in 584 bytes} [Wed May  8 02:37:50 2019] GET /api/subscriber/postmaster@domain.cas.cz/subscribed?query_all_lists=no&email_only=no => generated 70 bytes in 0 msecs (HTTP/1.1 200) 1 headers in 51 bytes (2 switches on core 0)
May  8 02:37:51 mx uwsgi: Traceback (most recent call last):#012  File "/usr/lib/python2.7/dist-packages/web/application.py", line 239, in process#012    return self.handle()#012  File "/usr/lib/python2.7/dist-packages/web/application.py", line 230, in handle#012    return self._delegate(fn, self.fvars, args)#012  File "/usr/lib/python2.7/dist-packages/web/application.py", line 462, in _delegate#012    return handle_class(cls)#012  File "/usr/lib/python2.7/dist-packages/web/application.py", line 438, in handle_class#012    return tocall(*args)#012  File "/opt/www/iRedAdmin-Pro-SQL-3.4/controllers/sql/user.py", line 477, in GET#012    msg=form.get('msg'),#012  File "/opt/www/iRedAdmin-Pro-SQL-3.4/libs/iredbase.py", line 179, in render_template#012    return jinja_env.get_template(template_name).render(context)#012  File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 989, in render#012    return self.environment.handle_exception(exc_info, True)#012  File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 754, in handle_exception#012    reraise(exc_type, exc_value, tb)#012  File "/opt/www/iRedAdmin-Pro-SQL-3.4/libs/../templates/default/sql/user/profile.html", line 46, in top-level template code#012    {% from "macros/msg_handlers.html" import user_msg_handler with context %}#012TypeError: unsupported operand type(s) for -=: 'unicode' and 'int'
May  8 02:37:51 mx uwsgi: 
May  8 02:37:51 mx uwsgi: mail.domain.cas.cz [pid: 1723|app: 1|req: 31/147] 147.231.28.11 () {52 vars in 1057 bytes} [Wed May  8 02:37:50 2019] GET /iredadmin/profile/user/general/postmaster@domain.cas.cz => generated 21 bytes in 983 msecs (HTTP/1.1 500) 3 headers in 190 bytes (2 switches on core 0)

----

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 even with patch applied

My server has several DNS aliases (mail, mx, webmail, smtp, imap) and it looks like the behavior is dependent on the alias used. Using mail.domain... almost nothing works in iRedAdmin, using other aliases most functions work, except for example displaying domain administrators - this page again ends with Internal Server Error...

May  8 03:20:00 mx uwsgi: Traceback (most recent call last):#012  File "/usr/lib/python2.7/dist-packages/web/application.py", line 239, in process#012    return self.handle()#012  File "/usr/lib/python2.7/dist-packages/web/application.py", line 230, in handle#012    return self._delegate(fn, self.fvars, args)#012  File "/usr/lib/python2.7/dist-packages/web/application.py", line 462, in _delegate#012    return handle_class(cls)#012  File "/usr/lib/python2.7/dist-packages/web/application.py", line 438, in handle_class#012    return tocall(*args)#012  File "/opt/www/iRedAdmin-Pro-SQL-3.4/libs/sqllib/decorators.py", line 31, in proxyfunc#012    return func(*args, **kw)#012  File "/opt/www/iRedAdmin-Pro-SQL-3.4/controllers/sql/user.py", line 684, in GET#012    msg=web.input().get('msg', None))#012  File "/opt/www/iRedAdmin-Pro-SQL-3.4/libs/iredbase.py", line 179, in render_template#012    return jinja_env.get_template(template_name).render(context)#012  File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 989, in render#012    return self.environment.handle_exception(exc_info, True)#012  File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 754, in handle_exception#012    reraise(exc_type, exc_value, tb)#012  File "/opt/www/iRedAdmin-Pro-SQL-3.4/libs/../templates/default/sql/user/list.html", line 23, in top-level template code#012    {% from "macros/msg_handlers.html" import user_msg_handler with context %}#012  File "/opt/www/iRedAdmin-Pro-SQL-3.4/libs/../templates/default/layout.html", line 192, in top-level template code#012    {% block main %}{% endblock %}#012  File "/opt/www/iRedAdmin-Pro-SQL-3.4/libs/../templates/default/sql/user/list.html", line 178, in block "main"#012    {% set usedQuotaBytes = used_quotas.get(mail, {}).get('bytes', 0) %}#012  File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 408, in getattr#012    return getattr(obj, attribute)#012UndefinedError: 'used_quotas' is undefined
May  8 03:20:00 mx uwsgi: 
May  8 03:20:00 mx uwsgi: mx.domain.cas.cz [pid: 1726|app: 2|req: 31/349] 147.231.28.11 () {52 vars in 1017 bytes} [Wed May  8 03:19:59 2019] GET /iredadmin/admins/domain.cas.cz => generated 21 bytes in 778 msecs (HTTP/1.1 500) 3 headers in 190 bytes (2 switches on core 0)

3

Re: Internal Server Error even with patch applied

Dear svoboda77,

This is a known bug of iRedAdmin-Pro-SQL-3.4, we have patch available to fix it.
Please contact us to get a patched version: https://www.iredmail.org/contact.html

We will release a new iRedAdmin-Pro release soon.

4

Re: Internal Server Error even with patch applied

Thank you. I applied the patch from https://forum.iredmail.org/topic15618-i … inpro.html but it didn't help, so I thought it might be a different issue. No problem, I can wait until the new version if oficially released. Thank you for your great job smile

5

Re: Internal Server Error even with patch applied

Dear svoboda77,

Could you please try to restart "iredadmin" service manually and try again? This issue has been fixed.