1

Topic: iredadmin throws an internal server error after patching FreeBSD

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

Hi,

I installed iredmail 0.9.2 on a fresh, fully patched FreeBSD 10.2 jail a couple of weeks ago, and all was working fine. Yesterday I ran portsnap fetch update on the jailhost, then ezjail-admin update -P in order to update the ports tree. In the jail, I ran portmaster -a, and the following ports were updated:
portmaster-3.17.8
GeoIP-1.6.6
perl5-5.20.3_7
ca_root_nss-3.20
lmdb-0.9.16
p7zip-9.38.1_1
pcre-8.37_4
png-1.6.18
curl-7.44.0
gettext-runtime-0.19.5.1
libgpg-error-1.20
p5-Archive-Zip-1.50
p5-Convert-BinHex-1.124
p5-DBI-1.634
php55-5.5.29
php55-dom-5.5.29
php55-filter-5.5.29
php55-iconv-5.5.29
php55-json-5.5.29
php55-mbstring-5.5.29
php55-openssl-5.5.29
php55-pdo-5.5.29
php55-pdo_pgsql-5.5.29
php55-session-5.5.29
php55-pspell-5.5.29
php55-simplexml-5.5.29
php55-xml-5.5.29
php55-zip-5.5.29
py27-psycopg2-2.6.1_1
spamassassin-3.4.1_3
bash-static-4.3.42
libcheck-0.10.0
php55-bz2-5.5.29
php55-ctype-5.5.29
php55-gettext-5.5.29
php55-hash-5.5.29
php55-imap-5.5.29
php55-mcrypt-5.5.29
php55-pgsql-5.5.29
php55-zlib-5.5.29
py27-Jinja2-2.8

I then exited, and restarted the jail. When I attempted to login to the admin interface I get a "internal server error" message.

Here's the entry from uwsgi-iredadmin.log.

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/web/application.py", line 239, in process
    return self.handle()
  File "/usr/local/lib/python2.7/site-packages/web/application.py", line 230, in handle
    return self._delegate(fn, self.fvars, args)
  File "/usr/local/lib/python2.7/site-packages/web/application.py", line 420, in _delegate
    return handle_class(cls)
  File "/usr/local/lib/python2.7/site-packages/web/application.py", line 396, in handle_class
    return tocall(*args)
  File "/usr/local/www/iRedAdmin-0.4.2/controllers/decorators.py", line 11, in proxyfunc
    return func(self, *args, **kw)
  File "/usr/local/www/iRedAdmin-0.4.2/controllers/pgsql/basic.py", line 133, in GET
    newVersionInfo=newVersionInfo,
  File "/usr/local/www/iRedAdmin-0.4.2/libs/iredbase.py", line 166, in render_template
    return jinja_env.get_template(template_name).render(context)
  File "/usr/local/lib/python2.7/site-packages/jinja2/environment.py", line 989, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/local/lib/python2.7/site-packages/jinja2/environment.py", line 754, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/www/iRedAdmin-0.4.2/libs/../templates/default/macros/general.html", line 795, in template
    {% macro display_per_user_wblist(values=[], htmlInputName, label) -%}
TemplateSyntaxError: non-default argument follows default argument

jefferson.usperson.net [pid: 44748|app: 0|req: 8/8] 66.162.182.66 () {52 vars in 906 bytes} [Tue Sep 15 12:23:11 2015] GET /iredadmin/dashboard => generated 21 bytes in 281 msecs (HTTP/1.1 500) 2 headers in 155 bytes (2 switches on core 0)

There was nothing in the nginx error logs, but this was in the regular nxinx log:

Sep 15 12:31:12 jefferson.usperson.net nginx: 66.162.182.66 - - [15/Sep/2015:12:31:12 +0000] "GET /iredadmin/dashboard HTTP/1.1" 500 32 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0"

I didn't see anything in any of the other logs.

Is it possible that one of the patches broke things, or should I look elsewhere?

Thanks!

----

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

2

Re: iredadmin throws an internal server error after patching FreeBSD

It's a known issue with iredadmin open source edition (v0.4.2). You can fix it by removing macro 'display_per_user_wblist' in file 'templates/default/macros/general.html'.

Reference:
https://bitbucket.org/zhb/iredadmin-ose … 675484c5e0

3

Re: iredadmin throws an internal server error after patching FreeBSD

That worked. Thanks!