Topic: Internal server Error when trying to edit user via iRedAdminpro
==== 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: Ubuntu 18.04.2 LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGSQL edition
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? Yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
When trying to edit a user profile via iRedAdmin-Pro, we are having an "internal server error" message with blank page.
Log from /var/log/syslog
May 3 16:18:37 imail2 uwsgi: 127.0.0.1:7790 [pid: 2763|app: 0|req: 1/4] 127.0.0.1 () {32 vars in 572 bytes} [Fri May 3 16:18:37 2019] GET /api/subscriber/user@mydomain.com/subscribed?query_all_lists=no&email_only=no => generated 31 bytes in 13 msecs (HTTP/1.1 200) 1 headers in 51 bytes (2 switches on core 0)
May 3 16:18:39 imail2 uwsgi: Traceback (most recent call last):#012 File "/usr/lib/python2.7/dist-packages/web/application.py", line 257, in process#012 return self.handle()#012 File "/usr/lib/python2.7/dist-packages/web/application.py", line 248, in handle#012 return self._delegate(fn, self.fvars, args)#012 File "/usr/lib/python2.7/dist-packages/web/application.py", line 488, in _delegate#012 return handle_class(cls)#012 File "/usr/lib/python2.7/dist-packages/web/application.py", line 466, 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 1008, in render#012 return self.environment.handle_exception(exc_info, True)#012 File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 780, 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 %}#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/profile.html", line 509, in block "main"#012 {{ display_random_password(password_length=min_passwd_length,#012 File "/usr/lib/python2.7/dist-packages/jinja2/runtime.py", line 579, in _invoke#012 rv = self._func(*arguments)#012 File "/opt/www/iRedAdmin-Pro-SQL-3.4/libs/../templates/default/macros/general.html", line 1914, in template#012 {% set random_password = password_length | generate_random_password %}#012 File "/opt/www/iRedAdmin-Pro-SQL-3.4/libs/iredpwd.py", line 113, in generate_random_password#012 length -= 1#012TypeError: unsupported operand type(s) for -=: 'unicode' and 'int'
May 3 16:18:39 imail2 uwsgi:
May 3 16:18:39 imail2 uwsgi: mail2.domain.com [pid: 2783|app: 2|req: 3/10] 11.11.11.11 () {56 vars in 968 bytes} [Fri May 3 16:18:37 2019] GET /iredadmin/profile/user/general/user@mydomain.com => generated 21 bytes in 1771 msecs (HTTP/1.1 500) 3 headers in 190 bytes (2 switches on core 0)
Email address changed to user@domain.com
Client IP changed to 11.11.11.11
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.