-
-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mariadb-dump: Error 2013: Lost connection to server #398
Comments
How big is your database and maybe in more detail, the table in question? It also could be that your database table is corrupted as well. Rebuilding the table with mysqlcheck might be a good place to start as well... |
I was able to solve it today. I set Playing around with Anyway, the problem stays that db-backup does not inform about a bad backup. Can this be fixed somehow? |
I think with some significant effort we could trap the output of mysqldump and watch for keywords like you had identified and then at least throw some warnings that something happened. Right now it is very basic.. Trapping the exit code of the dump application which returns a limited amount of detail and is really a Pass or Fail. I suppose there could be some options to set in mysqldump that fail upon first issue as well as opposed to persisting with the backup as well. It's an enhancement to investigate in future releases. |
I was thinking that it is impossible that mysqldump does not throw an error when something like this happens. Pass or fail is okay, because with a fail and a notification you can look into it. You have to look into it. But if nothing happens in this kind of szenario you think that everything is okay and that your backup is allright. |
If you have a copy of your old database you could use maybe you could try it out with mysql dump manually and then report back. We can certainly work in command line arguments into the dump process. |
I have a dump from the old version of the database. It should contain the error/problem, but I did not check. What I did: I dumped this database inside a Debian virtual machine and restored it to a MariaDB container on Unraid. As I needed backup there, too, I installed the db-backup container as well. I did daily backups inside the VM, which never was a problem. Interesting is that none of the mentioned settings where changed for the MariaDB inside the VM. So max_allowed_packet is 16M (for mysqld and mysqldump) innodb_force_recovery is not set. The MariaDB version differs. Inside the VM it is 10.3.39-0+deb10u2, the container should be 11.4.4-r1-ls171, according to the Github page. |
Summary
When backing up a huge MariaDB database (for openHAB) I get the following error:
mariadb-dump: Error 2013: Lost connection to server during query when dumping table Item144 at row: 331906
The error is not the problem. The problem is that there are no notifications. Also a file is in the backup directory, everything looks normal - except the file size.
Steps to reproduce
See above.
What is the expected correct behavior?
Triggered notifications which bring this error to the attention of the user.
Relevant logs and/or screenshots
I only see this error in the Docker logs:
mariadb-dump: Error 2013: Lost connection to server during query when dumping table
Item144at row: 331906
Interesting is that it cannot be seen in /var/log/container.container.log inside the container. There I only see this:
As I see an exit code 0 it looks like the error is not catched. It only shows in Docker errors and before other "interesting" logs:
As mentioned, the error is not the problem, but that it is not reported and there might be backups not working or incomplete. For myself, I have mail and Matrix notifications configured, at least mail should work as I sent some test mails out of the container.
I wil also try to get around the error - also because this more likely seems to be a server problem, and not so much of the client (db-backup). Google says, I shoud put max_allowed_packet from 16MB to 1G in
[mysqld]
and[mysqldump]
sections, which I will try.max_allowed_packet = 1G
Others write that I should play with timeout values. I will also try, but one after the other.
Environment
The text was updated successfully, but these errors were encountered: