Solved Got an error writing communication packets

gate2vn

Verified User
Joined
Nov 9, 2004
Messages
508
Location
Oslo
Have one database, which mysqldump cannot complete its job. The error:
mysqldump: Error 2013: Lost connection to server during query when dumping table `xxxxx_options` at row: 399
In /var/log/messages, the error was recorded:
[Warning] Aborted connection 179 to db: 'xxxx_db1' user: 'da_admin' host: 'localhost' (Got an error writing communication packets)

I tried to increase max_allowed_packets, net_write_timeout, net_read_timeout, time_wait... but error is still appearing. Meanwhile, the db can be exported with phpMyAdmin, so the MariaDB server config should be fine, and the table is not corrupted. Error happens with DA backup, and running mysqldump manually from SSH.

Any idea? Thanks.
 
I found this on the Plesk support site for solution.

In /etc/my.cnf add this under [mysqld]
innodb_buffer_pool_size=100M
max_allowed_packet=1024M
net_read_timeout=3600
net_write_timeout=3600
And restart mysql/mariadb

Seems you have them all, except the innodb_buffer_pool_size so maybe if you raise that value and restart it will be good?

If that does not help either, it might be usefull to state your OS Distro and version and if you use mariadb or mysql and the version number, so others might be able to help you in a better way.
 
Thanks for replying. I do have innodb_buffer_pool_size already, and the size value depends on the size of databases and the memory. So it's not only 100M :) The backup was fine, the problem just happened from last 2 days, and the server has no update except DirectAdmin updated yesterday (so the problem was happening before DA update).

The server is running CloudLinux 8 with MariaDB 10.6.11.

Anyway, even I can still export the table with phpMyAdmin, I used phpMyAdmin for analyzing data rows, and found one corrupted. Delete that one, and mysqldump is working fine now.
 
So it's not only 100M :)
That was just an example value on that site, one can ofcourse use other values if needed.

and the table is not corrupted.
So that was not quite correct. You did find a corrupted table. Good to read you have found and fixed that and mysqldump is working fine now too.
As for my reply, you're welcome.

Thank you for sharing your solution! (y)
 
Thanks for replying. I do have innodb_buffer_pool_size already, and the size value depends on the size of databases and the memory. So it's not only 100M :) The backup was fine, the problem just happened from last 2 days, and the server has no update except DirectAdmin updated yesterday (so the problem was happening before DA update).

The server is running CloudLinux 8 with MariaDB 10.6.11.

Anyway, even I can still export the table with phpMyAdmin, I used phpMyAdmin for analyzing data rows, and found one corrupted. Delete that one, and mysqldump is working fine now.
Hello,

I am encountering a similar issue on a similar configuration: CloudLinux 8 and MariaDB 10.6.

Every 30 seconds, my MySQL logs record an error of this nature:

Code:
Nov 12 10:41:26 calamansi.easyhoster.com mariadbd[72547]: 2023-11-12 10:41:26 55 [Warning] Aborted connection 55 to db: 'mysql' user: 'da_admin' host: 'localhost' (Got an error reading communication packets)
Nov 12 10:41:56 calamansi.easyhoster.com mariadbd[72547]: 2023-11-12 10:41:56 59 [Warning] Aborted connection 59 to db: 'mysql' user: 'da_admin' host: 'localhost' (Got an error reading communication packets)
Nov 12 10:42:26 calamansi.easyhoster.com mariadbd[72547]: 2023-11-12 10:42:26 64 [Warning] Aborted connection 64 to db: 'mysql' user: 'da_admin' host: 'localhost' (Got an error reading communication packets)
Nov 12 10:42:56 calamansi.easyhoster.com mariadbd[72547]: 2023-11-12 10:42:56 69 [Warning] Aborted connection 69 to db: 'mysql' user: 'da_admin' host: 'localhost' (Got an error reading communication packets)
Nov 12 10:43:26 calamansi.easyhoster.com mariadbd[72547]: 2023-11-12 10:43:26 73 [Warning] Aborted connection 73 to db: 'mysql' user: 'da_admin' host: 'localhost' (Got an error reading communication packets)
Nov 12 10:43:56 calamansi.easyhoster.com mariadbd[72547]: 2023-11-12 10:43:56 75 [Warning] Aborted connection 75 to db: 'mysql' user: 'da_admin' host: 'localhost' (Got an error reading communication packets)

Because @gate2vn have the same issue with the same config (CloudLinux 8 / MariaDB 10.6), I suspect there is a compatibility issue between DirectAdmin and CloudLinux (perhaps the SQL Governor?) with the MySQL database "mysql" which need to be regularly accessed by da_admin.

I've attempted to tweak my /etc/my.cnf in response to this issue, following guidance from here and from this good article.

I'm not sure what task DirectAdmin is trying to accomplish every 30 seconds with this "mysql" database, but I suspect that this problem is causing my "System Backup" feature (DA Sysbk) to fail.
Whenever the System Backup Cron runs, it returns an error
(Stage 3 MySQL backup: MySQL could not be started, aborting...) which causes Sysbk to fail and prevents my backups from being transported via FTP when "MySQL Databases backups" are enabled.

Unlike @gate2vn, it doesn't appear that I have any corrupted tables. The mysql.user table has the type of "view", but it seems to be normal, and I am able to properly mysqldump and/or phpMyAdmin export the "mysql" database.

I'm concerned that this error (Aborted connection … to db: 'mysql' user: 'da_admin' host: 'localhost' (Got an error reading communication packets)) might disrupt other essential features of DirectAdmin?

I plan to contact CloudLinux about this issue to see if it could be related to their components, and to determine if there are any missing things related to this DirectAdmin native mysql table that needs to be accessed by the user "da_admin".

I will update you with their response, but in the meantime, if any DirectAdmin enthusiasts here have suggestions for a solution or workaround to prevent these Connections from being Aborted and to fix my DA Sysbk with CloudLinux 8 / MariaDB 10.6, I would greatly appreciate reading them. Thank you!
 
We have de same configuration:

CloudLinux 8 and MariaDB 10.6 with the same error each 30 seconds
 
CloudLinux 8 and MariaDB 10.6 with the same error each 30 seconds
Did you contact CL support? Give them cldiag result and maybe they help, because MariaDB and governor managed by their repo.
I have few servers with same config - no issues.
 
I had the same an issue with "mysqldump error output: mysqldump: Error 2013: Lost connection to server during query when dumping table " on configruation Alma Linux 9 and MariaDB 10.6 but I added below parametr and it work.

[mysqldump]
max_allowed_packet=1024M
 
Last edited:
Back
Top