1 (edited by Senku 2021-02-05 03:33:24)

Topic: Emails are not sent or arrive in inbox until restart the server

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version: 0.9.9
- Downloadable installer
- CentOS 7.6.1810 (Core)
- MySQL (MARIADB)
- Nginx
- No iRedAdmin-Pro
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

The whole system is deployed on Hyperv. System on CentOS. Two disks, one for the system, the second for the vmail directory (ext4). Everything was fine until I once again increased the size of the disk for vmail. Everything went without errors, but after a while I received complaints that messages were not sent or received.
First I checked the permissions on the vmail folder. They were for user root, I changed them for vmail (chmod - 774). The problem went away, but a few hours. Then I looked at the event log for dovecot (/var/log/dovecot/dovecot.log) and this is what I saw:

Feb  4 17:49:48 mail dovecot: auth: Warning: auth workers: Auth request was queued for 6 seconds, 30 left in queue (see auth_worker_max_count)
Feb  4 18:37:53 mail dovecot: auth: Warning: auth client 0 disconnected with 1 pending requests: EOF
Feb  4 18:37:55 mail dovecot: auth: Warning: auth client 0 disconnected with 1 pending requests: EOF
Feb  4 19:38:52 mail dovecot: auth: Warning: auth client 0 disconnected with 1 pending requests: EOF
Feb  4 19:59:30 mail dovecot: auth: Warning: auth client 0 disconnected with 1 pending requests: EOF
Feb  4 20:03:42 mail dovecot: auth: Warning: auth client 0 disconnected with 1 pending requests: EOF
Feb  4 21:26:33 mail dovecot: master: Dovecot v2.2.36 (1f10bfa63) starting up for pop3, imap, sieve, lmtp (core dumps disabled)
Feb  4 21:26:33 mail dovecot: auth-worker(4225): Error: mysql(127.0.0.1): Connect failed to database (vmail): Can't connect to MySQL server on '127.0.0.1' (111) - waiting for 1 seconds before retry
Feb  4 21:26:33 mail dovecot: auth-worker(4225): Error: mysql(127.0.0.1): Connect failed to database (vmail): Can't connect to MySQL server on '127.0.0.1' (111) - waiting for 1 seconds before retry
Feb  4 21:26:34 mail dovecot: auth-worker(4225): Error: mysql(127.0.0.1): Connect failed to database (vmail): Can't connect to MySQL server on '127.0.0.1' (111) - waiting for 5 seconds before retry
Feb  4 21:26:34 mail dovecot: auth-worker(4225): Error: mysql(127.0.0.1): Connect failed to database (vmail): Can't connect to MySQL server on '127.0.0.1' (111) - waiting for 5 seconds before retry
Feb  4 21:26:39 mail dovecot: auth: Warning: auth workers: Auth request was queued for 6 seconds, 16 left in queue (see auth_worker_max_count)
Feb  4 21:29:26 mail dovecot: master: Dovecot v2.2.36 (1f10bfa63) starting up for pop3, imap, sieve, lmtp (core dumps disabled)
Feb  4 21:29:26 mail dovecot: auth-worker(4220): Error: mysql(127.0.0.1): Connect failed to database (vmail): Can't connect to MySQL server on '127.0.0.1' (111) - waiting for 1 seconds before retry
Feb  4 21:29:26 mail dovecot: auth-worker(4220): Error: mysql(127.0.0.1): Connect failed to database (vmail): Can't connect to MySQL server on '127.0.0.1' (111) - waiting for 1 seconds before retry
Feb  4 21:29:26 mail dovecot: auth-worker(4251): Error: mysql(127.0.0.1): Connect failed to database (vmail): Can't connect to MySQL server on '127.0.0.1' (111) - waiting for 1 seconds before retry
Feb  4 21:29:26 mail dovecot: auth: Error: auth worker: Aborted PASSV request for urist@<domain>.ru: Internal auth worker failure

The "best" part is if you restart the server, the letters start to be sent and received. Not all emails at once, but all test emails reached the addressee after several reboots.

df -Th

Filesystem                          Type      Size  Used Avail Use% Mounted on
/dev/mapper/centos_mlsrv01--pg-root xfs        28G  3.5G   25G  13% /
devtmpfs                            devtmpfs  3.9G     0  3.9G   0% /dev
tmpfs                               tmpfs     3.9G     0  3.9G   0% /dev/shm
tmpfs                               tmpfs     3.9G  8.8M  3.9G   1% /run
tmpfs                               tmpfs     3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/sda1                           xfs      1014M  145M  870M  15% /boot
/dev/sdb1                           ext4      443G  335G   90G  79% /var/vmail
tmpfs                               tmpfs     782M     0  782M   0% /run/user/0

after unmount /dev/sdb1

[root@mail ~]# fsck /dev/sdb1
fsck from util-linux 2.23.2
e2fsck 1.42.9 (28-Dec-2013)
/dev/sdb1: clean, 324300/29491200 files, 89568689/117964544 blocks



Please help me to understand the work of the MySQL database and understand the essence of the problem.

----

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

2

Re: Emails are not sent or arrive in inbox until restart the server

- Is MySQL reaching max connections? Try to increase the max connections in mysql config file and try again.
- Besides softwares installed by iRedMail, do you have other application(s) perform a lot SQL operations?