1

Topic: Roundcube very often timeouts and Database Aborted connections

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.7.1
- Deployed with iRedMail Easy or the downloadable installer? downloadable installer
- Linux/BSD distribution name and version: Ubuntu 20.04.6 server
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL (MariaDB)
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No I have the open source installed
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Dear Sirs,
A few months ago I started to have quite often Roundcube webmail timeouts when I update messages list, compose email, change to a different mail folder etc
Searching for the route cause of the problem, I firstly found errors on /var/log/php-fpm/php-fpm.log these errors have the form:
127.0.0.1 -  20/Dec/2024:07:39:02 +0200 "GET /status" 200
Dec 20 07:39:05 mx php-fpm[612]: [WARNING] [pool inet] child 312120, script '/opt/www/roundcubemail/index.php' (request: "POST /mail/index.php?_task=mail&_action=refresh") executing too slow (6.209691 sec), logging
Dec 20 07:39:05 mx php-fpm[612]: [NOTICE] child 312120 stopped for tracing
Dec 20 07:39:05 mx php-fpm[612]: [NOTICE] about to trace 312120
Dec 20 07:39:05 mx php-fpm[612]: [NOTICE] finished trace of 312120

Looking further I found possible related problems on the MySQL (MariaDB) log on /var/log/mysql/error.log these errors have the form:
2024-12-20  7:39:23 21881 [Warning] Aborted connection 21881 to db: 'vmail' user: 'vmailadmin' host: 'localhost' (Got an error reading communication packets).
The problem doesn't seem to be related to my VPS server that is very capable having 60 GB RAM 10 CPU Cores, SSD Disk etc and I have no other problems. Also I use this VPS solely for iRedMail

I think these problems was started when upgraded iRedMail from 1.6.8 to 1.7.0 possible is related to "enabled jail names in SQL database" ? I don't know
Also, looking at amavisd mysql database found quarantine table very big 49,872,896 I don't know if this cause the problem, as I don't use iRedAdmin-Pro I am thinking how to stop the database storage that is related solely to iRedAdmin-Pro. My server has excess of spam and hacking tries so the each incident to be stored on MySQL might be the problem (?).

I don't know what else to do or to look at so PLEASE help me to solve this very nasty problem.

Thank and Best Regards,
Mike Kranidis

----

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

2

Re: Roundcube very often timeouts and Database Aborted connections

Add "log_warnings = 1" in mysql server config file should fix this issue:

[mysqld]
log_warnings = 1

3

Re: Roundcube very often timeouts and Database Aborted connections

ZhangHuangbin wrote:

Add "log_warnings = 1" in mysql server config file should fix this issue:

[mysqld]
log_warnings = 1

Dear Sir,
as you instructed I put the above at /etc/mysql/my.cnf file and then I restarted systemctl restart mysqld.service 
Unfortunately this doesn't solve or improve the problem. Roundcube still very often timeouts. Please tell me what else to check? Just to mentioned that after the reported problem I installed a lighter webmail, rainloop and I observed the same problem but the timeout it is not so often as in roundcube case. Also if I use Thunderbird email client then all seems ok.
I think that the problem appeared when upgraded iRedMail from 1.6.8 to 1.7.0 , what do you think.

Many thanks.

4

Re: Roundcube very often timeouts and Database Aborted connections

mikekgr wrote:

I think that the problem appeared when upgraded iRedMail from 1.6.8 to 1.7.0 , what do you think.

Did you upgrade OS release before or after upgrading iRedMail?

5

Re: Roundcube very often timeouts and Database Aborted connections

ZhangHuangbin wrote:
mikekgr wrote:

I think that the problem appeared when upgraded iRedMail from 1.6.8 to 1.7.0 , what do you think.

Did you upgrade OS release before or after upgrading iRedMail?

OS release is still Ubuntu 20.04.6 LTS nothing change before or after upgrading iRedMail except all Ubuntu security and system's updates. See:
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.6 LTS

Also I change accordingly the /etc/iredmail-release
1.7.1 MARIADB edition.

6 (edited by mikekgr 2025-01-06 17:00:22)

Re: Roundcube very often timeouts and Database Aborted connections

looking for further inconsistencies I observed something very strange and possible problematic: In some users (email boxes) the MariaDB used_quota number it is WRONG, let me explain, for the email box mikek@openforall.com both iredadmin and MariaDB has INCORRECT values (not between them), in iredadmin the figure is as it shows in first attachment.
In MariaDB the same figures as it shows in second attachment. The values from MariaDB was taken by the commands: USE vmail;  select * FROM used_quota ORDER BY bytes;  (I want to get the used_quota for all users)  then the values for mikek@openforall.com are:
mikek@openforall.com        | 14044228477 |   186786 | openforall.com
the same as in  iredadmin   but not correct.
If I run the below command:
find /var/vmail/vmail1/openforall.com/mikek/ -type f | wc -l
I got total files 92132 and NOT 186786  as it stated in MariaDB   and regarding the size that mikek account occupies for the emails:
du -sb /var/vmail/vmail1/openforall.com/mikek/
7642395353      /var/vmail/vmail1/openforall.com/mikek/
that is 7642395353 and NOT  14044228477  as it stated in MariaDB.

I am wondering why there are these inconsistencies and how can be corrected ?
Please @ZhangHuangbin have a look and tell me what to do and what is the proper way to resynchronize the email account with the db values .

Many thanks

Post's attachments

incorrect_files_number_size.png
incorrect_files_number_size.png 7.46 kb, file has never been downloaded. 

incorrect_files_number_size_db.png
incorrect_files_number_size_db.png 6.11 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

7

Re: Roundcube very often timeouts and Database Aborted connections

@ZhangHuangbin Please, can you see this problem?  @iRedMail

mikekgr wrote:

looking for further inconsistencies I observed something very strange and possible problematic: In some users (email boxes) the MariaDB used_quota number it is WRONG, let me explain, for the email box mikek@openforall.com both iredadmin and MariaDB has INCORRECT values (not between them), in iredadmin the figure is as it shows in first attachment.
In MariaDB the same figures as it shows in second attachment. The values from MariaDB was taken by the commands: USE vmail;  select * FROM used_quota ORDER BY bytes;  (I want to get the used_quota for all users)  then the values for mikek@openforall.com are:
mikek@openforall.com        | 14044228477 |   186786 | openforall.com
the same as in  iredadmin   but not correct.
If I run the below command:
find /var/vmail/vmail1/openforall.com/mikek/ -type f | wc -l
I got total files 92132 and NOT 186786  as it stated in MariaDB   and regarding the size that mikek account occupies for the emails:
du -sb /var/vmail/vmail1/openforall.com/mikek/
7642395353      /var/vmail/vmail1/openforall.com/mikek/
that is 7642395353 and NOT  14044228477  as it stated in MariaDB.

I am wondering why there are these inconsistencies and how can be corrected ?
Please @ZhangHuangbin have a look and tell me what to do and what is the proper way to resynchronize the email account with the db values .

Many thanks

8

Re: Roundcube very often timeouts and Database Aborted connections

mikekgr wrote:

I am wondering why there are these inconsistencies and how can be corrected ?

FYI https://docs.iredmail.org/recalculate.m … quota.html

I wonder why people don't read tutorials / guides ...

9

Re: Roundcube very often timeouts and Database Aborted connections

ZhangHuangbin wrote:
mikekgr wrote:

I am wondering why there are these inconsistencies and how can be corrected ?

FYI https://docs.iredmail.org/recalculate.m … quota.html

I wonder why people don't read tutorials / guides ...

Thanks for your reply. I didn't know what to search for, so that was the reason why I didn't read the proper tutorials / guides ...

Again thanks