1

Topic: IRedAdmin-Pro: NameError: global name 'throttle' is not defined

======== Required information ====
- iRedMail version: 0.8.5, iRedAdmin Pro 1.7.0
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: Debian 7.0
- Related log if you're reporting an issue: apache error log
====

Hello!
We installed a new mail server instance on Debian 7 and used the "old" database and maildir to migrate our users.
Everything works fine except iRedAdmin Pro panel. When I try to access the mailbox I get "internal server error" and following message in the apache error log:

[Thu Aug 29 09:15:42 2013] [error] [client xxx] Traceback (most recent call last):
[Thu Aug 29 09:15:42 2013] [error] [client xxx]   File "/usr/lib/python2.7/dist-packages/web/application.py", line 239, in process
[Thu Aug 29 09:15:42 2013] [error] [client xxx]     return self.handle()
[Thu Aug 29 09:15:42 2013] [error] [client xxx]   File "/usr/lib/python2.7/dist-packages/web/application.py", line 230, in handle
[Thu Aug 29 09:15:42 2013] [error] [client xxx]     return self._delegate(fn, self.fvars, args)
[Thu Aug 29 09:15:42 2013] [error] [client xxx]   File "/usr/lib/python2.7/dist-packages/web/application.py", line 420, in _delegate
[Thu Aug 29 09:15:42 2013] [error] [client xxx]     return handle_class(cls)
[Thu Aug 29 09:15:42 2013] [error] [client xxx]   File "/usr/lib/python2.7/dist-packages/web/application.py", line 396, in handle_class
[Thu Aug 29 09:15:42 2013] [error] [client xxx]     return tocall(*args)
[Thu Aug 29 09:15:42 2013] [error] [client xxx]   File "/usr/share/apache2/iredadmin/controllers/decorators.py", line 11, in proxyfunc
[Thu Aug 29 09:15:42 2013] [error] [client xxx]     return func(self, *args, **kw)
[Thu Aug 29 09:15:42 2013] [error] [client xxx]   File "/usr/share/apache2/iredadmin/controllers/mysql/user.py", line 176, in GET
[Thu Aug 29 09:15:42 2013] [error] [client xxx]     throttleLib = throttle.Throttle()
[Thu Aug 29 09:15:42 2013] [error] [client xxx] NameError: global name 'throttle' is not defined

What can be wrong?

Thank you!

Best regards,
Bernhard

2

Re: IRedAdmin-Pro: NameError: global name 'throttle' is not defined

Please disable policyd integration in iRedAdmin-Pro config file, /usr/share/apache2/iredadmin/settings.ini, and restart Apache service.

# File: /usr/share/apache2/iredadmin/settings.ini
[policyd]
enabled = False
...

Debian 7 ships Cluebringer (a.k.a. Policyd v2), not Policyd-1.8, and iRedAdmin-Pro-MySQL-1.7.0 doesn't support Cluebringer yet, so please disable Policyd integration.

We're not working on Cluebringer support, next release of iRedAdmin-Pro will have below features:

- [DONE] Able to enable/disable per-domain and per-user greylisting.
- [DONE] List and remove accounts which have greylisting disabled in a separate web page, so that you don't need to disable per-domain or per-user greylisting in account profile page.

- Whitelist
- Blacklist.

3

Re: IRedAdmin-Pro: NameError: global name 'throttle' is not defined

Ah okay, this explains the issue very well.
Now I disabled the policyd support and get following new error:

[Thu Aug 29 14:55:50 2013] [error] [client xxx] Traceback (most recent call last):
[Thu Aug 29 14:55:50 2013] [error] [client xxx]   File "/usr/lib/python2.7/dist-packages/web/application.py", line 239, in process
[Thu Aug 29 14:55:50 2013] [error] [client xxx]     return self.handle()
[Thu Aug 29 14:55:50 2013] [error] [client xxx]   File "/usr/lib/python2.7/dist-packages/web/application.py", line 230, in handle
[Thu Aug 29 14:55:50 2013] [error] [client xxx]     return self._delegate(fn, self.fvars, args)
[Thu Aug 29 14:55:50 2013] [error] [client xxx]   File "/usr/lib/python2.7/dist-packages/web/application.py", line 420, in _delegate
[Thu Aug 29 14:55:50 2013] [error] [client xxx]     return handle_class(cls)
[Thu Aug 29 14:55:50 2013] [error] [client xxx]   File "/usr/lib/python2.7/dist-packages/web/application.py", line 396, in handle_class
[Thu Aug 29 14:55:50 2013] [error] [client xxx]     return tocall(*args)
[Thu Aug 29 14:55:50 2013] [error] [client xxx]   File "/usr/share/apache2/iredadmin/controllers/decorators.py", line 11, in proxyfunc
[Thu Aug 29 14:55:50 2013] [error] [client xxx]     return func(self, *args, **kw)
[Thu Aug 29 14:55:50 2013] [error] [client xxx]   File "/usr/share/apache2/iredadmin/controllers/mysql/domain.py", line 128, in GET
[Thu Aug 29 14:55:50 2013] [error] [client xxx]     result_throttle = throttleLib.getThrottling(sender='@' + self.domain, recipient='@' + self.domain)
[Thu Aug 29 14:55:50 2013] [error] [client xxx]   File "/usr/share/apache2/iredadmin/libs/policyd/throttle.py", line 162, in getThrottling
[Thu Aug 29 14:55:50 2013] [error] [client xxx]     limit=1,
[Thu Aug 29 14:55:50 2013] [error] [client xxx]   File "/usr/lib/python2.7/dist-packages/web/db.py", line 682, in select
[Thu Aug 29 14:55:50 2013] [error] [client xxx]     return self.query(qout, processed=True)
[Thu Aug 29 14:55:50 2013] [error] [client xxx]   File "/usr/lib/python2.7/dist-packages/web/db.py", line 644, in query
[Thu Aug 29 14:55:50 2013] [error] [client xxx]     self._db_execute(db_cursor, sql_query)
[Thu Aug 29 14:55:50 2013] [error] [client xxx]   File "/usr/lib/python2.7/dist-packages/web/db.py", line 587, in _db_execute
[Thu Aug 29 14:55:50 2013] [error] [client xxx]     out = cur.execute(query, params)
[Thu Aug 29 14:55:50 2013] [error] [client xxx]   File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
[Thu Aug 29 14:55:50 2013] [error] [client xxx]     self.errorhandler(self, exc, value)
[Thu Aug 29 14:55:50 2013] [error] [client xxx]   File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
[Thu Aug 29 14:55:50 2013] [error] [client xxx]     raise errorclass, errorvalue
[Thu Aug 29 14:55:50 2013] [error] [client xxx] ProgrammingError: (1146, "Table 'cluebringer.throttle' doesn't exist")
[Thu Aug 29 14:55:50 2013] [error] [client xxx]

4

Re: IRedAdmin-Pro: NameError: global name 'throttle' is not defined

It seems even if it is set to "false", it tries to access the database.
When I comment the database settings, I get:
...
TypeError: connect() argument 3 must be string, not None
...

5

Re: IRedAdmin-Pro: NameError: global name 'throttle' is not defined

I wonder if I have overseen the "detail" that upgrading from Debian 6 to 7 will cause features to get lost.
We are using many of these features in production.
Do you have put this information about policyd 1.8 -> 2 upgrade somewhere? If not this would be great for every user smile

6

Re: IRedAdmin-Pro: NameError: global name 'throttle' is not defined

My mistake, please logout and re-login, then it should be fine. if it doesn't work, please delete all records in SQL table "iredadmin.sessions", it will force all domain admins to re-login immediately.

7

Re: IRedAdmin-Pro: NameError: global name 'throttle' is not defined

broth wrote:

I wonder if I have overseen the "detail" that upgrading from Debian 6 to 7 will cause features to get lost.
We are using many of these features in production.
Do you have put this information about policyd 1.8 -> 2 upgrade somewhere? If not this would be great for every user smile

The problem is, Policyd doesn't have an OFFICIAL upgrade tutorial.
I will try to provide a Policyd upgrade tutorial for iRedMail users when new version of iRedMail has been released.