1

Topic: Issues with migration to new server (issue 1 of 2)

==== Required information ====
- iRedMail version (check /etc/iredmail-release):
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- Related log if you're reporting an issue:
======== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.2
- Linux/BSD distribution name and version: FreeBSD 10.2
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Apache 2.4
- Manage mail accounts with iRedAdmin-Pro? Yes
- Related log if you're reporting an issue: ProErrors.txt
====

After a possible intrusion to a an iRedMail / iRedAdmin-Pro server, I built a new server and succesfully migrated all databases to the new server. The server also successfully displayed the open-source iRedMail Admin panel.

However, after trying to upgrade to iRedAdmin-Pro (using 'bash upgrade_iredadmin.sh' from the tools directory), the server returns 'internal server error' after logging in to https://<servername>/iredadmin

The httpd-error log is attached.

Thanks in advance for clues on fixing this.

----

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

2

Re: Issues with migration to new server (issue 1 of 2)

Did you forget to attach log?

3

Re: Issues with migration to new server (issue 1 of 2)

Sorry, I thought it was attached. I have pasted the log entries in this reply.

[Thu Oct 15 20:57:26.072183 2015] [:error] [pid 1429] [remote 75.82.83.187:0] Traceback (most recent call last):
[Thu Oct 15 20:57:26.072224 2015] [:error] [pid 1429] [remote 75.82.83.187:0]   File "/usr/local/lib/python2.7/site-packages/web/application.py", line 239, in process
[Thu Oct 15 20:57:26.072232 2015] [:error] [pid 1429] [remote 75.82.83.187:0]     return self.handle()
[Thu Oct 15 20:57:26.072238 2015] [:error] [pid 1429] [remote 75.82.83.187:0]   File "/usr/local/lib/python2.7/site-packages/web/application.py", line 230, in handle
[Thu Oct 15 20:57:26.072244 2015] [:error] [pid 1429] [remote 75.82.83.187:0]     return self._delegate(fn, self.fvars, args)
[Thu Oct 15 20:57:26.072250 2015] [:error] [pid 1429] [remote 75.82.83.187:0]   File "/usr/local/lib/python2.7/site-packages/web/application.py", line 420, in _delegate
[Thu Oct 15 20:57:26.072256 2015] [:error] [pid 1429] [remote 75.82.83.187:0]     return handle_class(cls)
[Thu Oct 15 20:57:26.072262 2015] [:error] [pid 1429] [remote 75.82.83.187:0]   File "/usr/local/lib/python2.7/site-packages/web/application.py", line 396, in handle_class
[Thu Oct 15 20:57:26.072268 2015] [:error] [pid 1429] [remote 75.82.83.187:0]     return tocall(*args)
[Thu Oct 15 20:57:26.072274 2015] [:error] [pid 1429] [remote 75.82.83.187:0]   File "/usr/local/www/iredadmin/controllers/decorators.py", line 22, in proxyfunc
[Thu Oct 15 20:57:26.072280 2015] [:error] [pid 1429] [remote 75.82.83.187:0]     return func(self, *args, **kw)
[Thu Oct 15 20:57:26.072286 2015] [:error] [pid 1429] [remote 75.82.83.187:0]   File "/usr/local/www/iredadmin/controllers/mysql/basic.py", line 246, in GET
[Thu Oct 15 20:57:26.072291 2015] [:error] [pid 1429] [remote 75.82.83.187:0]     removeQuarantinedInDays=settings.AMAVISD_REMOVE_QUARANTINED_IN_DAYS,
[Thu Oct 15 20:57:26.072297 2015] [:error] [pid 1429] [remote 75.82.83.187:0]   File "/usr/local/www/iredadmin/libs/iredbase.py", line 199, in render_template
[Thu Oct 15 20:57:26.072303 2015] [:error] [pid 1429] [remote 75.82.83.187:0]     return jinja_env.get_template(template_name).render(context)
[Thu Oct 15 20:57:26.072309 2015] [:error] [pid 1429] [remote 75.82.83.187:0]   File "/usr/local/lib/python2.7/site-packages/jinja2/environment.py", line 989, in render
[Thu Oct 15 20:57:26.072315 2015] [:error] [pid 1429] [remote 75.82.83.187:0]     return self.environment.handle_exception(exc_info, True)
[Thu Oct 15 20:57:26.072322 2015] [:error] [pid 1429] [remote 75.82.83.187:0]   File "/usr/local/lib/python2.7/site-packages/jinja2/environment.py", line 754, in handle_exception

4

Re: Issues with migration to new server (issue 1 of 2)

No enough log, did you paste FULL log related to this issue?

Try this:

*) monitor log file with 'tail -f' command.
*) open web browser and visit iRedAdmin-Pro to trigger the same issue
*) Copy full log in 'tail -f' console and paste here.

5

Re: Issues with migration to new server (issue 1 of 2)

That's everything from httpd-error.log. Here it is again, using tail -f. Note that the first two entries are from 22:36 yesterday, and then from 07:25 today. These errors came from trying to log in to https://<hostname>/iredadmin, with the web server returning an "internal server error" message:

[Thu Oct 15 22:36:15.758499 2015] [:error] [pid 2949] [remote 75.82.83.187:0] TemplateSyntaxError: non-default argument follows default argument
[Thu Oct 15 22:36:15.758513 2015] [:error] [pid 2949] [remote 75.82.83.187:0]
[Fri Oct 16 07:25:22.003674 2015] [:error] [pid 2949] [remote 75.82.83.187:0] Traceback (most recent call last):
[Fri Oct 16 07:25:22.003787 2015] [:error] [pid 2949] [remote 75.82.83.187:0]   File "/usr/local/lib/python2.7/site-packages/web/application.py", line 239, in process
[Fri Oct 16 07:25:22.003798 2015] [:error] [pid 2949] [remote 75.82.83.187:0]     return self.handle()
[Fri Oct 16 07:25:22.003806 2015] [:error] [pid 2949] [remote 75.82.83.187:0]   File "/usr/local/lib/python2.7/site-packages/web/application.py", line 230, in handle
[Fri Oct 16 07:25:22.003814 2015] [:error] [pid 2949] [remote 75.82.83.187:0]     return self._delegate(fn, self.fvars, args)
[Fri Oct 16 07:25:22.003821 2015] [:error] [pid 2949] [remote 75.82.83.187:0]   File "/usr/local/lib/python2.7/site-packages/web/application.py", line 420, in _delegate
[Fri Oct 16 07:25:22.003830 2015] [:error] [pid 2949] [remote 75.82.83.187:0]     return handle_class(cls)
[Fri Oct 16 07:25:22.003900 2015] [:error] [pid 2949] [remote 75.82.83.187:0]   File "/usr/local/lib/python2.7/site-packages/web/application.py", line 396, in handle_class
[Fri Oct 16 07:25:22.003916 2015] [:error] [pid 2949] [remote 75.82.83.187:0]     return tocall(*args)
[Fri Oct 16 07:25:22.003956 2015] [:error] [pid 2949] [remote 75.82.83.187:0]   File "/usr/local/www/iredadmin/controllers/decorators.py", line 22, in proxyfunc
[Fri Oct 16 07:25:22.003980 2015] [:error] [pid 2949] [remote 75.82.83.187:0]     return func(self, *args, **kw)
[Fri Oct 16 07:25:22.004003 2015] [:error] [pid 2949] [remote 75.82.83.187:0]   File "/usr/local/www/iredadmin/controllers/mysql/basic.py", line 246, in GET
[Fri Oct 16 07:25:22.004025 2015] [:error] [pid 2949] [remote 75.82.83.187:0]     removeQuarantinedInDays=settings.AMAVISD_REMOVE_QUARANTINED_IN_DAYS,
[Fri Oct 16 07:25:22.004048 2015] [:error] [pid 2949] [remote 75.82.83.187:0]   File "/usr/local/www/iredadmin/libs/iredbase.py", line 199, in render_template
[Fri Oct 16 07:25:22.004071 2015] [:error] [pid 2949] [remote 75.82.83.187:0]     return jinja_env.get_template(template_name).render(context)
[Fri Oct 16 07:25:22.004107 2015] [:error] [pid 2949] [remote 75.82.83.187:0]   File "/usr/local/lib/python2.7/site-packages/jinja2/environment.py", line 989, in render
[Fri Oct 16 07:25:22.004134 2015] [:error] [pid 2949] [remote 75.82.83.187:0]     return self.environment.handle_exception(exc_info, True)
[Fri Oct 16 07:25:22.004158 2015] [:error] [pid 2949] [remote 75.82.83.187:0]   File "/usr/local/lib/python2.7/site-packages/jinja2/environment.py", line 754, in handle_exception
[Fri Oct 16 07:25:22.004181 2015] [:error] [pid 2949] [remote 75.82.83.187:0]     reraise(exc_type, exc_value, tb)
[Fri Oct 16 07:25:22.004203 2015] [:error] [pid 2949] [remote 75.82.83.187:0]   File "/usr/local/www/iredadmin/libs/../templates/default/macros/general.html", line 1170, in template
[Fri Oct 16 07:25:22.004226 2015] [:error] [pid 2949] [remote 75.82.83.187:0]     {% macro display_per_user_wblist(values=[], htmlInputName, label) -%}
[Fri Oct 16 07:25:22.004249 2015] [:error] [pid 2949] [remote 75.82.83.187:0] TemplateSyntaxError: non-default argument follows default argument
[Fri Oct 16 07:25:22.004284 2015] [:error] [pid 2949] [remote 75.82.83.187:0]

6

Re: Issues with migration to new server (issue 1 of 2)

cvcvelo wrote:

[Fri Oct 16 07:25:22.004203 2015] [:error] [pid 2949] [remote 75.82.83.187:0]   File "/usr/local/www/iredadmin/libs/../templates/default/macros/general.html", line 1170, in template
[Fri Oct 16 07:25:22.004226 2015] [:error] [pid 2949] [remote 75.82.83.187:0]     {% macro display_per_user_wblist(values=[], htmlInputName, label) -%}

This is the error.
Please open file /usr/local/www/iredadmin/templates/default/macros/general.html, find this line:

{% macro display_per_user_wblist(values=[], htmlInputName, label) -%}

Remove '=[]':

{% macro display_per_user_wblist(values, htmlInputName, label) -%}

Save your change and try again.

7

Re: Issues with migration to new server (issue 1 of 2)

Success! Thanks for that fix.

8

Re: Issues with migration to new server (issue 1 of 2)

This issue might be specific to iRedAdmin-Pro on FreeBSD.

I erroneously installed an old version (1.9.2) on the new server, and corrected the login issue with the fix you suggested.

After an upgrade to the current 2.1.3 version, the issue return, and can be fixed in the same way.

Thanks again for your help with this.