1

Topic: Dovecot dict auth-worker Lost connection to MySQL server during query

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.4.0
- Deployed with iRedMail Easy or the downloadable installer? Downloadable installer
- Linux/BSD distribution name and version: Debian 10
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? Yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hello, we're having these error messages in dovecot log (/etc/dovecot/dovecot.log):

Jul  9 16:34:43 mailtec dovecot: dict(4601): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 30 secs)
Jul  9 16:34:43 mailtec dovecot: auth-worker(31533): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 33 secs)
Jul  9 16:44:30 mailtec dovecot: auth: Warning: auth client 0 disconnected with 1 pending requests: EOF
Jul  9 16:44:43 mailtec dovecot: dict(12392): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 55 secs)
Jul  9 16:44:43 mailtec dovecot: dict(8297): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 55 secs)
Jul  9 16:44:43 mailtec dovecot: dict(12397): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 55 secs)
Jul  9 16:44:43 mailtec dovecot: dict(12399): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 55 secs)
Jul  9 16:44:43 mailtec dovecot: dict(14895): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 30 secs)
Jul  9 16:44:43 mailtec dovecot: dict(14896): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 30 secs)
Jul  9 16:44:43 mailtec dovecot: dict(14897): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 30 secs)
Jul  9 17:39:23 mailtec dovecot: log(31516): Warning: Log connection fd 21 listen_fd 21 prefix 'imap: ' is sending input faster than we can write
Jul  9 17:44:43 mailtec dovecot: dict(7473): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 55 secs)
Jul  9 17:44:43 mailtec dovecot: dict(29169): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 54 secs)
Jul  9 17:44:43 mailtec dovecot: dict(7472): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 55 secs)
Jul  9 17:44:43 mailtec dovecot: dict(29143): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 55 secs)
Jul  9 17:44:43 mailtec dovecot: dict(29168): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 55 secs)
Jul  9 17:44:43 mailtec dovecot: dict(7931): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 30 secs)
Jul  9 17:44:43 mailtec dovecot: dict(7932): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 30 secs)
Jul  9 17:44:43 mailtec dovecot: dict(7933): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 30 secs)
Jul  9 17:44:43 mailtec dovecot: dict(7934): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 30 secs)
Jul  9 17:44:43 mailtec dovecot: dict(7935): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 30 secs)
Jul  9 17:44:44 mailtec dovecot: dict(7937): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 30 secs)
Jul  9 17:44:44 mailtec dovecot: dict(7936): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 30 secs)
Jul  9 17:44:46 mailtec dovecot: dict(7941): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 30 secs)
Jul  9 19:14:43 mailtec dovecot: dict(21555): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 30 secs)
Jul  9 19:14:43 mailtec dovecot: dict(22807): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 54 secs)
Jul  9 19:14:43 mailtec dovecot: dict(20282): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 54 secs)
Jul  9 19:14:43 mailtec dovecot: dict(22734): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 45 secs)
Jul  9 19:14:43 mailtec dovecot: dict(20725): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 54 secs)
Jul  9 19:14:43 mailtec dovecot: dict(23131): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 30 secs)
Jul  9 19:14:43 mailtec dovecot: dict(23132): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 30 secs)
Jul  9 19:14:43 mailtec dovecot: dict(23134): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 30 secs)
Jul  9 19:14:43 mailtec dovecot: dict(23133): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 30 secs)
Jul  9 19:14:43 mailtec dovecot: dict(23135): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 30 secs)
Jul  9 19:14:43 mailtec dovecot: dict(23136): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 30 secs)
Jul  9 19:14:46 mailtec dovecot: auth-worker(31533): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 36 secs)

We've had 'Too many connections' to MySQL errors in /var/log/mail.log before, but we've increased max_connections (from 150 to 1024) value on MariaDB and they went away.

We've also had max_process errors in Dovecot:
Jul  9 10:55:23 mailtec dovecot: master: Warning: service(dict): process_limit (100) reached, client connections are being dropped
We've increased default_process_limit to 1024 and they went away.

Finally, we've also had client_limit errors in Dovecot:
Jul  9 11:59:53 mailtec dovecot: config: Warning: service auth { client_limit=3000 } is lower than required under max. load (4596)
We've increased default_client_limit to 5000 (that's the value Dovecot recommended to acomodate heavy load) and they went away.

But these errors:
Jul  9 17:44:43 mailtec dovecot: dict(7935): Warning: sqlpool(mysql): Query failed, retrying: Lost connection to MySQL server during query (idled for 30 secs)
Still persist and I don't know what to try or what to look for anymore.
Any help would be truly appreciated.

2

Re: Dovecot dict auth-worker Lost connection to MySQL server during query

Looks like a busy server. Is MySQL max_connection 1024 enough?

----

Buy me a cup of coffee ($5) to support iRedMail:

buy me a cup of coffee