[Dovecot] "Not connected to database" MySQL errors
I've been in the process of moving my pop3 proxy over to the dovecot proxy. I have a ton of users using pop3 still, and am seeing these errors popup within a minute or so of the connection to the database:
Password query failed: Not connected to database
Eventually the auth-worker will reconnect to the database and things will go on normal for another minute or two, then the same issue occurs. I'm runing MySQL 5.0.22 on FreeBSD 6.1. I upgraded to 5.0.27, however I started getting the: "Password query failed: Commands out of sync; you can't run this command now" error instead. So I downgraded until I could figure out this issue first.
I've tried connecting to localhost, /tmp/mysql.sock, and a remote server and all exhibit the same problem. The MySQL idle timeouts shouldnt come into play because I'm constantly having users check their accounts.
Any insights will be useful,
Thanks!
Cassidy
### Part of my dovecot.conf that might be useful: login_process_per_connection = yes login_processes_count = 3 login_max_processes_count = 512
auth_verbose = yes auth_debug = yes auth_debug_passwords =yes auth_worker_max_count = 400
auth mail.infowest.com { mechanisms = plain
passdb sql {
args = /usr/local/etc/dovecot-sql.conf
}
userdb static {
args = uid=5000 gid=5000 home=/dev/null
}
user = root
# Number of authentication processes to create
count = 10
## dovecot-sql.conf driver = mysql connect = host=/tmp/mysql.sock dbname=iwmailsystem user=imap_proxy password=***** client_flags=65536 default_pass_scheme = MD5 password_query = CALL pop_auth('%u','%l','%r')
On 3.1.2007, at 0.28, Cassidy B. Larson wrote:
I've been in the process of moving my pop3 proxy over to the
dovecot proxy. I have a ton of users using pop3 still, and am
seeing these errors popup within a minute or so of the connection
to the database:Password query failed: Not connected to database
You could try if the attached patch logs something more useful. I
doubt it though. I don't really see how to debug this any better
without looking into what the MySQL library does internally. You
could see what ktrace shows though. Does the MySQL library close()
the connection, or does it receive some "connection closed" error?
Eventually the auth-worker will reconnect to the database and
things will go on normal for another minute or two, then the same
issue occurs. I'm runing MySQL 5.0.22 on FreeBSD 6.1. I upgraded
to 5.0.27, however I started getting the: "Password query failed:
Commands out of sync; you can't run this command now" error
instead. So I downgraded until I could figure out this issue first. .. password_query = CALL pop_auth('%u','%l','%r')
Could it be that MySQL just doesn't like having CALL used as a
replacement for SELECT, and while newer versions directly say that,
the older versions just go and do random disconnects or whatever?
You could try if the attached patch logs something more useful. I doubt it though. I don't really see how to debug this any better without looking into what the MySQL library does internally. You could see what ktrace shows though. Does the MySQL library close() the connection, or does it receive some "connection closed" error?
Tried the patch and get this: mysql_query() failed: Lost connection to MySQL server during query
Could it be that MySQL just doesn't like having CALL used as a
replacement for SELECT, and while newer versions directly say that, the older versions just go and do random disconnects or whatever?
Why would MySQL drop my connections every minutes or so? This is very strange. The issue can re-occur on 5.0.27, although I got the 'commands out of sync' stuff.
I ended up using some SQL voodoo and making a big SELECT statement out of my "CALL". Not sure if it's a surprise or not..but no dropped connections when using SELECT. Same load.
Cassidy
participants (2)
-
Cassidy B. Larson
-
Timo Sirainen