1

Topic: Internal Server Error after upgrade to 3.4 when choosing Domain/Admins

iRedMail version : 0.9.9
iRedAdmin-Pro - MySQL - 3.4
Linux: CentOS 7
Web server Apache

After the upgrade from 3.1 to 3.4 after choosing a domain and then choosing the menu point Administrators I experience an internal server error.

What I found in the apache ssl_error_log is this:
[Tue Apr 30 11:26:44 2019] [:error] File "/var/www/iredadmin/libs/../templates/default/sql/user/list.html", line 23, in top-level template code
[Tue Apr 30 11:26:44 2019] [:error]  {% from "macros/msg_handlers.html" import user_msg_handler with context %}
[Tue Apr 30 11:26:44 2019] [:error]  File "/var/www/iredadmin/libs/../templates/default/layout.html", line 192, in top-level template code
[Tue Apr 30 11:26:44 2019] [:error]  {% block main %}{% endblock %}
[Tue Apr 30 11:26:44 2019] [:error]  File "/var/www/iredadmin/libs/../templates/default/sql/user/list.html", line 178, in block "main"
[Tue Apr 30 11:26:44 2019] [:error]  {% set usedQuotaBytes = used_quotas.get(mail, {}).get('bytes', 0) %}
[Tue Apr 30 11:26:44 2019] [:error]  File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 397, in getattr
[Tue Apr 30 11:26:44 2019] [:error]  return getattr(obj, attribute)
[Tue Apr 30 11:26:44 2019] [:error]  UndefinedError: 'used_quotas' is undefined

Any suggestions?
Thx
Ulf

----

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

2 (edited by jdodge 2019-05-01 11:24:29)

Re: Internal Server Error after upgrade to 3.4 when choosing Domain/Admins

OS: CentOS Linux release 7.6.1810
IredMail .99
IredAdmin Pro 3.4
Web Server: Apache 2.4.6


I  just upgraded from 3.3 to 3.4 and have the same error, but only for the Admins underneath domains not domain itself.

[Tue Apr 30 23:16:52.715164 2019] [:error] [pid 10802] [remote 71.43.201.114:140]   File "/var/www/iredadmin/libs/../templates/default/sql/user/list.html", line 23, in top-level template code
[Tue Apr 30 23:16:52.715169 2019] [:error] [pid 10802] [remote 71.43.201.114:140]     {% from "macros/msg_handlers.html" import user_msg_handler with context %}
[Tue Apr 30 23:16:52.715174 2019] [:error] [pid 10802] [remote 71.43.201.114:140]   File "/var/www/iredadmin/libs/../templates/default/layout.html", line 192, in top-level template code
[Tue Apr 30 23:16:52.715180 2019] [:error] [pid 10802] [remote 71.43.201.114:140]     {% block main %}{% endblock %}
[Tue Apr 30 23:16:52.715185 2019] [:error] [pid 10802] [remote 71.43.201.114:140]   File "/var/www/iredadmin/libs/../templates/default/sql/user/list.html", line 178, in block "main"
[Tue Apr 30 23:16:52.715190 2019] [:error] [pid 10802] [remote 71.43.201.114:140]     {% set usedQuotaBytes = used_quotas.get(mail, {}).get('bytes', 0) %}
[Tue Apr 30 23:16:52.715196 2019] [:error] [pid 10802] [remote 71.43.201.114:140]   File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 397, in getattr
[Tue Apr 30 23:16:52.715201 2019] [:error] [pid 10802] [remote 71.43.201.114:140]     return getattr(obj, attribute)
[Tue Apr 30 23:16:52.715206 2019] [:error] [pid 10802] [remote 71.43.201.114:140] UndefinedError: 'used_quotas' is undefined
[Tue Apr 30 23:16:52.715220 2019] [:error] [pid 10802] [remote 71.43.201.114:140]

3

Re: Internal Server Error after upgrade to 3.4 when choosing Domain/Admins

Sorry about this trouble. It's a bug of iRedAdmin-Pro-SQL-3.4. patch attached.

diff -r 979ae473f7fa controllers/sql/user.py
--- a/controllers/sql/user.py    Fri May 03 22:30:01 2019 +0700
+++ b/controllers/sql/user.py    Fri May 03 23:26:57 2019 +0700
@@ -634,12 +634,12 @@
             mails += [str(r.get('username'))]
 
         # Get real-time used quota.
-        accountUsedQuota = {}
+        used_quotas = {}
 
         if settings.SHOW_USED_QUOTA:
             if mails:
                 try:
-                    accountUsedQuota = sql_lib_general.get_account_used_quota(accounts=mails, conn=conn)
+                    used_quotas = sql_lib_general.get_account_used_quota(accounts=mails, conn=conn)
                 except Exception:
                     pass
 
@@ -677,7 +677,7 @@
                           user_forwardings=user_forwardings,
                           user_alias_addresses=user_alias_addresses,
                           user_assigned_groups=user_assigned_groups,
-                          accountUsedQuota=accountUsedQuota,
+                          used_quotas=used_quotas,
                           first_char=first_char,
                           days_to_keep_removed_mailbox=days_to_keep_removed_mailbox,
                           all_are_admins=True,

if you're not familiar with patch, please contact us to get a patched version.

4

Re: Internal Server Error after upgrade to 3.4 when choosing Domain/Admins

Hello,

the patch worked perfectly for me.

thx a lot
Ulf