1 (edited by spango 2013-12-18 06:48:34)

Topic: "internal server error" using policyd 1.8 after 0.8.6 + 1.8.0 upgrade

==== Required information ====
- iRedMail version: 0.8.6
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: RHEL 6.5
- Related log if you're reporting an issue:
====

iRedMail 0.8.5 and iRedAdmin-Pro 1.7.0 was my initial installation.

Upgraded iRedMail from 0.8.5 -> 0.8.6 and iRedAdmin-Pro 1.7.0 -> 1.8.0.  I assume I'm running policyd 1.8.x, so I skipped the Cluebringer SQL mentioned http://iredmail.org/wiki/index.php?titl … .8.5-0.8.6

# rpm -qa | grep "policyd"
policyd-1.82-6.el6.x86_64

Now when I click on a user's record trying to load: https://example.com/iredadmin/profile/u … xample.com I get "internal server error"

Error from the web log:

[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77] Traceback (most recent call last):
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77]   File "/usr/lib/python2.6/site-packages/web/application.py", line 239, in process
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77]     return self.handle()
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77]   File "/usr/lib/python2.6/site-packages/web/application.py", line 230, in handle
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77]     return self._delegate(fn, self.fvars, args)
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77]   File "/usr/lib/python2.6/site-packages/web/application.py", line 420, in _delegate
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77]     return handle_class(cls)
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77]   File "/usr/lib/python2.6/site-packages/web/application.py", line 396, in handle_class
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77]     return tocall(*args)
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77]   File "/var/www/iredadmin/controllers/decorators.py", line 11, in proxyfunc
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77]     return func(self, *args, **kw)
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77]   File "/var/www/iredadmin/controllers/mysql/user.py", line 192, in GET
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77]     throttleLib = throttle.Throttle()
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77]   File "/var/www/iredadmin/libs/cluebringer/core.py", line 78, in __init__
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77]     self.policy_ids = _get_all_policy_ids(self.db)
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77]   File "/var/www/iredadmin/libs/cluebringer/core.py", line 17, in _get_all_policy_ids
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77]     qr = conn.select('policies', what='id,name,priority')
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77]   File "/usr/lib/python2.6/site-packages/web/db.py", line 682, in select
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77]     return self.query(qout, processed=True)
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77]   File "/usr/lib/python2.6/site-packages/web/db.py", line 644, in query
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77]     self._db_execute(db_cursor, sql_query)
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77]   File "/usr/lib/python2.6/site-packages/web/db.py", line 587, in _db_execute
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77]     out = cur.execute(query, params)
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77]   File "/usr/lib64/python2.6/site-packages/MySQLdb/cursors.py", line 173, in execute
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77]     self.errorhandler(self, exc, value)
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77]   File "/usr/lib64/python2.6/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77]     raise errorclass, errorvalue
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77] ProgrammingError: (1146, "Table 'policyd.policies' doesn't exist")
[Tue Dec 17 16:08:03 2013] [error] [client 70.90.115.77]

I've already restarted the web server a few times, and cleared iredmail.sessions table.

----

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

2

Re: "internal server error" using policyd 1.8 after 0.8.6 + 1.8.0 upgrade

Does logout then re-login fix this issue?

3

Re: "internal server error" using policyd 1.8 after 0.8.6 + 1.8.0 upgrade

Logging out and back in to the iRedAdmin-Pro web interface doesn't make any difference, I still get the "internal server error" message, and the same log entries.

MySQL "policyd" database has a "policy" table, but not "policies".  Did I miss a step in the upgrade?

4

Re: "internal server error" using policyd 1.8 after 0.8.6 + 1.8.0 upgrade

What's the value of parameter "policyd_db_name" in your iRedAdmin-Pro config file (settings.py)?

iRedAdmin-Pro should detect you have Policyd running, not Cluebringer.

5

Re: "internal server error" using policyd 1.8 after 0.8.6 + 1.8.0 upgrade

Sorry about this, just confirmed this is a bug in new release of iRedAdmin-Pro. Please fix it with below steps:

*) Open file libs/iredbase.py, find below line (about line 23-27):

# Check Policyd/Cluebringer
enable_policyd = settings.policyd_enabled
enable_cluebringer = settings.policyd_enabled
if settings.policyd_db_name in ['cluebringer']:
    enable_policyd = False

*) Add two lines after 'enable_policyd = False':

# Check Policyd/Cluebringer
enable_policyd = settings.policyd_enabled
enable_cluebringer = settings.policyd_enabled
if settings.policyd_db_name in ['cluebringer']:
    enable_policyd = False
else:
    enable_cluebringer = False

*) Save your changes.
*) Restart Apache service, delete all records in SQL table "iredadmin.sessions". Then it should be fine.

6

Re: "internal server error" using policyd 1.8 after 0.8.6 + 1.8.0 upgrade

This patch solved the issue for me.  Thanks so much for the quick fix!