1

Topic: Error when creating admin user

==== Required information ====
- iRedMail version: Pro v1.9.2
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Linux/BSD distribution name and version: CentOS 6
- Related log if you're reporting an issue:
====

When creating an admin user, I get internal server error.
The user seems to be created though, its in the admin user list, but when I try to edit it, I get the same error message again.

I checked these logs but I did not find anything to clarify that general error.

/var/log/nginx/error.log
/var/log/php-fpm/www-error.log
/var/log/php-fpm/error.log
/var/log/messages
/var/log/maillog

----

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

2

Re: Error when creating admin user

Any related log in /var/log/uwsgi*?

Another way to get the error is:

*) Set 'MAIL_ERROR_TO_WEBMASTER = True' in iRedAdmin-Pro config file.
*) Update `webmaster =` to use a proper email address in iRedAdmin-Pro config file.

Then this webmaster will receive email when it raises 'internal server error'.

3

Re: Error when creating admin user

This is the error:

Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/web/application.py", line 239, in process
    return self.handle()
  File "/usr/lib/python2.6/site-packages/web/application.py", line 230, in handle
    return self._delegate(fn, self.fvars, args)
  File "/usr/lib/python2.6/site-packages/web/application.py", line 420, in _delegate
    return handle_class(cls)
  File "/usr/lib/python2.6/site-packages/web/application.py", line 396, in handle_class
    return tocall(*args)
  File "/var/www/iRedAdmin-Pro-MySQL-1.9.2/controllers/decorators.py", line 22, in proxyfunc
    return func(self, *args, **kw)
  File "/var/www/iRedAdmin-Pro-MySQL-1.9.2/controllers/mysql/admin.py", line 124, in GET
    msg=i.get('msg'),
  File "/var/www/iRedAdmin-Pro-MySQL-1.9.2/libs/iredbase.py", line 199, in render_template
    return jinja_env.get_template(template_name).render(context)
  File "/usr/lib64/python2.6/site-packages/jinja2/environment.py", line 669, in render
    return self.environment.handle_exception(exc_info, True)
  File "/var/www/iRedAdmin-Pro-MySQL-1.9.2/libs/../templates/default/mysql/admin/profile.html", line 21, in top-level template code
    {% from "macros/msgHandlers.html" import adminMsgHandler with context %}
  File "/var/www/iRedAdmin-Pro-MySQL-1.9.2/libs/../templates/default/layout.html", line 162, in top-level template code
    {% block main %}{% endblock %}
  File "/var/www/iRedAdmin-Pro-MySQL-1.9.2/libs/../templates/default/mysql/admin/profile.html", line 83, in block "main"
    {{ display_all_domains(managedDomains=managedDomains, allDomains=allDomains) }}
  File "/var/www/iRedAdmin-Pro-MySQL-1.9.2/libs/../templates/default/macros/sql.html", line 8, in template
    {% for r in allDomains |sort %}
  File "/usr/lib64/python2.6/site-packages/jinja2/filters.py", line 556, in do_sort
    return sorted(value, reverse=reverse)
TypeError: can't compare datetime.datetime to NoneType

4

Re: Error when creating admin user

Could you please show me full SQL record of this admin account? Looks like you don't have value for some SQL column (time stamp) for this admin user.

Note: please remove/hide password of sensitive info.

5

Re: Error when creating admin user

from vmail.admin

# username, password, name, language, passwordlastchange, settings, created, modified, expired, active
'operations@connexeon.com', '{SSHA512}***', 'Connexeon Operations', 'en_US', '0000-00-00 00:00:00', NULL, '2015-06-10 16:15:00', '0000-00-00 00:00:00', '9999-12-31 00:00:00', '1'

6

Re: Error when creating admin user

Could you upgrade to iRedAdmin-Pro-SQL-2.1.1 and try again?

7

Re: Error when creating admin user

Upgrading fixed the problem. Thanks.