I'm currently having a problem using an external MySQL server.
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] Traceback (most recent call last):
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] File "/usr/lib/pymodules/python2.6/web/application.py", line 242, in process
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] return self.handle()
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] File "/usr/lib/pymodules/python2.6/web/application.py", line 233, in handle
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] return self._delegate(fn, self.fvars, args)
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] File "/usr/lib/pymodules/python2.6/web/application.py", line 415, in _delegate
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] return handle_class(cls)
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] File "/usr/lib/pymodules/python2.6/web/application.py", line 390, in handle_class
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] return tocall(*args)
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] File "/usr/share/apache2/iredadmin/controllers/base.py", line 34, in proxyfunc
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] return func(self, *args, **kw)
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] File "/usr/share/apache2/iredadmin/controllers/policyd/whitelist.py", line 19, in GET
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] total, entries = whitelistLib.list(listcategory=self.listcategory, cur_page=self.cur_page,)
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] File "/usr/share/apache2/iredadmin/libs/policyd/whitelist.py", line 30, in list
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] self.count = self.db.query("""SELECT COUNT(*) as total FROM %s""" % (mapCategoryToTable[listcategory]) )
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] File "/usr/lib/pymodules/python2.6/web/db.py", line 610, in query
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] db_cursor = self._db_cursor()
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] File "/usr/lib/pymodules/python2.6/web/db.py", line 541, in _db_cursor
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] return self.ctx.db.cursor()
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] File "/usr/lib/pymodules/python2.6/web/db.py", line 482, in _getctx
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] self._load_context(self._ctx)
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] File "/usr/lib/pymodules/python2.6/web/db.py", line 493, in _load_context
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] ctx.db = self._connect(self.keywords)
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] File "/usr/lib/pymodules/python2.6/web/db.py", line 521, in _connect
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] return self.db_module.connect(**keywords)
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] File "/usr/lib/pymodules/python2.6/MySQLdb/__init__.py", line 81, in Connect
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] return Connection(*args, **kwargs)
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] File "/usr/lib/pymodules/python2.6/MySQLdb/connections.py", line 170, in __init__
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] super(Connection, self).__init__(*args, **kwargs2)
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx] OperationalError: (2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)")
[Tue Apr 05 15:28:53 2011] [error] [client xxx.xx.xxx.xx]
For whatever reason it tried to connect to localhost using a socket even though I have the appropriated section on the settings.ini file:
[policyd]
# Enable policyd integration: True, False.
enabled = True
host = mysql01
port = 3306
db = postfixpolicyd
user = postfix-policyd
passwd = mypass
I've double checked my user has permissions.
Cheers.