auth-worker looses MySQL connection and doesn't reconnect when MySQL/MariaDB has been restarted

Christian Ruppert idl0r at qasl.de
Mon Aug 16 18:08:49 EEST 2021


Hey,

I have MariaDB 10.5.10 and Dovecot 2.3.14.1 right now but it's broken 
since a few months already. I don't remember when it started and what 
versions I had running of both.
As stated in the subject, the Dovecot auth-worker looses connection 
during a MySQL/MariaDB restart, which is ok so far, but it doesn't 
reconnect for some reason and instead all further actions fail because 
of it, like doveadm or IMAP login / commands etc.
Aug 15 13:21:28 thor dovecot[20862]: auth-worker(24450): Warning: 
sqlpool(mysql): Query failed, retrying: Connection was killed
Aug 15 13:21:28 thor dovecot[20862]: auth-worker(24450): Error: conn 
unix:auth-worker (pid=24449,uid=97): auth-worker<376>: 
sql(user at example.com,::1,<somesession>): Password query failed: 
Connection was killed
Aug 15 13:21:30 thor dovecot[20862]: imap-login: Disconnected (auth 
service reported temporary failure): user=<user at example.com>, 
method=PLAIN, rip=::1, lip=::1, secured, session=<somesession>

This repeats basically for every command / action I do until I restart 
dovecot or kill the auth-worker process. Both works.

dovecot-sql.conf.ext:
driver = mysql
connect = host=/run/mysqld/mysqld.sock dbname=mail user=dovecot 
password=SOMEPW


Steps to reproduce:
Use MySQL in Dovecot
Restart MySQL while Dovecot is running
Do either some doveadm commands or try to login e.g. using IMAP or just 
try to navigate through your mailbox
See errors / logs

pkill -f 'dovecot/auth worker'
Try doveadm etc. again
Works

-- 
Regards,
Christian Ruppert


More information about the dovecot mailing list