1

Topic: Problems with adding domains since upgrade from 1.7 to 1.8.1

==== Required information ====
- iRedMail version: 1.8.1
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): mysql
- Linux/BSD distribution name and version: ubuntu 12.04
- Related log if you're reporting an issue:  [Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1] Traceback (most recent call last):
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]   File "/usr/lib/pymodules/python2.7/web/application.py", line 242, in process
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]     return self.handle()
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]   File "/usr/lib/pymodules/python2.7/web/application.py", line 233, in handle
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]     return self._delegate(fn, self.fvars, args)
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]   File "/usr/lib/pymodules/python2.7/web/application.py", line 415, in _delegate
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]     return handle_class(cls)
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]   File "/usr/lib/pymodules/python2.7/web/application.py", line 390, in handle_class
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]     return tocall(*args)
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]   File "/web/iredadmin/controllers/decorators.py", line 11, in proxyfunc
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]     return func(self, *args, **kw)
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]   File "/web/iredadmin/controllers/mysql/domain.py", line 133, in GET
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]     gl = greylist.Greylisting()
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]   File "/web/iredadmin/libs/cluebringer/core.py", line 78, in __init__
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]     self.policy_ids = _get_all_policy_ids(self.db)
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]   File "/web/iredadmin/libs/cluebringer/core.py", line 17, in _get_all_policy_ids
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]     qr = conn.select('policies', what='id,name,priority')
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]   File "/usr/lib/pymodules/python2.7/web/db.py", line 649, in select
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]     return self.query(qout, processed=True)
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]   File "/usr/lib/pymodules/python2.7/web/db.py", line 610, in query
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]     db_cursor = self._db_cursor()
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]   File "/usr/lib/pymodules/python2.7/web/db.py", line 541, in _db_cursor
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]     return self.ctx.db.cursor()
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]   File "/usr/lib/pymodules/python2.7/web/db.py", line 482, in _getctx
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]     self._load_context(self._ctx)
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]   File "/usr/lib/pymodules/python2.7/web/db.py", line 493, in _load_context
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]     ctx.db = self._connect(self.keywords)
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]   File "/usr/lib/pymodules/python2.7/web/db.py", line 521, in _connect
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]     return self.db_module.connect(**keywords)
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]   File "/usr/lib/python2.7/dist-packages/MySQLdb/__init__.py", line 81, in Connect
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]     return Connection(*args, **kwargs)
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]   File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 187, in __init__
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1]     super(Connection, self).__init__(*args, **kwargs2)
[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1] OperationalError: (2003, "Can't connect to MySQL server on '172.1.1.1' (110)")

====


Hello, I'm having this problem since the upgrade, I can go into the admin portal, check the mails, check the logs, see the domains that exist, check the stats, lots of stuff, but whenever I try to add a domain, add a user or check the domain profile, it hangs for about a minute and then I get "Internal server error"

I've looked through all of the logs and the only thing I can find is the sequence listed above. From that it seems fairly obvious what the problem is, except it can talk to the database (which is on a separate server) Surely if there were a problem, it wouldn't let me log in in the first place? Also, I've verified all of the connection strings listed in settings.py.

anyone any ideas?

----

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

2

Re: Problems with adding domains since upgrade from 1.7 to 1.8.1

I had a copy of the nginx server that I used to have this on, so I threw it on to that. I'm now getting "504 gateway timeout" at the same places and this error in the logs

2014/02/12 19:12:13 [error] 2455#0: *10 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 1.1.1.1, server: mailadmin.mydomain.net, request: "GET /profile/domain/general/anothertest.com HTTP/1.1", upstream: "http://127.0.0.1:7878/profile/domain/ge … ertest.com", host: "mailadmin.mydomain.net"


I can telnet to localhost on 7878 though and when I put http://127.0.0.1:7878 into lynx on the server, it brings up the ired login, but it times out when I try to put that port into a browser.

Hang on, I think I'm getting an idea

3

Re: Problems with adding domains since upgrade from 1.7 to 1.8.1

well, that idea didn't pan out. I found an error in the iredapd conf, but that seems to have always been there. This error popped up in the logs again

NameError: global name 'greylist' is not defined

A bit of googling, took me to http://www.iredmail.org/forum/topic5350 … fined.html and while it's not exactly the same error, I tried setting

[policyd]
enabled = False

and now it works fine and dandy. So now I'm wondering

What did I do to break policyd and what's the downside to having it disabled?

4

Re: Problems with adding domains since upgrade from 1.7 to 1.8.1

vmos wrote:

[Wed Feb 12 16:43:03 2014] [error] [client 11.1.1.1] OperationalError: (2003, "Can't connect to MySQL server on '172.1.1.1' (110)")

The problem is iRedAdmin-Pro cannot connect to MySQL server. Do you have correct SQL server address, port, username, password in iRedAdmin-Pro config file? It's a good idea to verify them all.

iRedAdmin-Pro-MySQL-1.8.1 doesn't have "[policyd]" section, but it uses "policyd_enabled = False" instead. are you sure you're running iRedAdmin-Pro-MySQL-1.8.1?

5

Re: Problems with adding domains since upgrade from 1.7 to 1.8.1

You're right, on closer inspection, looks like I missed a step in the upgrade process http://iredmail.org/wiki/index.php?titl … .8.0-1.8.1 Specifically "Add all mail domains in Cluebringer database as internal domains"

Oddly enough, when I ran that script, it still gave me the "could not connect to database" error, which was a total lie as I was on the database server, watching the connections and queries running. Anyway, it all seems to be working now, groovy.

If in doubt, RTFM, then read it again.