Errors on mysqldump during CB update of 1 site, reproducable

Richard G

Verified User
Joined
Jul 6, 2008
Messages
14,813
Location
Maastricht
Lately I've seen some errors when doing the custombuild update. Today I was able to scroll back almost enough and could see which database it was.
It has a ton of errors when doing the mysqldump and eventually fails.

This is part of the error code which I could retrieve from my SSH screen.
Code:
Dumping database user_wp979
mysqldump: Error 2013: Lost connection to server during query when dumping table `wp_wfconfig` at row: 226
mysqldump: Couldn't execute 'SELECT engine, table_type FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = DATABASE() AND table_name = 'wp_wfcrawlers'': Server has gone away (2006)
mysqldump: Couldn't execute 'SET SQL_QUOTE_SHOW_CREATE=1': Server has gone away (2006)
and a lot more of these, but if I try to put them in the post here, I get a forum error, odd enough.

Anyway much more of the same and this is at the end:
Code:
mysqldump: Got error: 2006: "Server has gone away" when selecting the database
mysqldump: Couldn't execute 'UNLOCK TABLES': Server has gone away (2006)
BACKUP OF user_wp979 FAILED!

Last time also the error was "server has gone away" while mysql was not stopped yet and other databases are dumped correctly after this error, so it does not seem a server issue.

It seems only this database. I tried the check option from within DA on this database which says OK on all tables except this one:
Code:
user_wp979.wp_wfls_role_counts    check    note    The storage engine for the table doesn't support check
so that does not support check.

When trying the repair option it does this:
The storage engine for the table doesn't support repair

I do see the database has 2 users, but I think one isn't used anymore (I checked the wp-config file).

When trying to reproduce the error using da_admin and the da_admin password for mysql via commandline mysqldump, this error appears:
Code:
mysqldump: Error 2013: Lost connection to server during query when dumping table `wp_wfconfig` at row: 226

When checking a dump of 13mb is created, however, most likely not complete.
Same happens when using the user credentials.

How can I fix this issue?
 
Last edited:
Hello Richard,

I do see the database has 2 users, but I think one isn't used anymore (I checked the wp-config file).

One is "dauser_db" another user is "dauser". Every DB created in DA has at least 2 users.

When trying the repair option it does this:

InnoDB does **NOT** support either repair or check operations.

Got error: 2006: "Server has gone away" when selecting the database

The error message might occur in numerous cases, there is no single reason for it. Since that solutions might differ.
Basic information about the error can be found in official docs of MySQL: https://dev.mysql.com/doc/refman/8.4/en/gone-away.html

You might try and dump the specific DB in DirectAdmin at a user level and/or phpMyAdmin. And see whether the error persists.
 
Last edited:
I assume it is a table in WordPress from WordFence? Since WordFence often uses hardcoded files and such in the database. I am almost certain that if you completely remove the plugin and check the option to include remove all database tables from wf and then reinstall it, the issue will be resolved.
 
One is "dauser_db" another user is "dauser". Every DB created in DA has at least 2 users.
Yes I've read this is since some version, couple of years ago this user wasn't visible, it's a bit confusing. I'm going to check if the double one can be made invisible somehow from within DA.

InnoDB does support either repair or check operations.
Does or doesn't? At least it does not from within DA.

You might try and dump the specific DB in DirectAdmin at a user level and/or phpMyAdmin. And see whether the error persists.
I didn't expect this to be any different than using a mysqldump from commandline with the user's credentials. However, when creating a backup at user level by using the backup/restore option and then only selecting the database, it does seem to work ok.
At least the message system said "Backup created" and it did not mention anything else like "with errors" for example.
Which strucks me as odd, because I used this mysql command, this is the example line:
mysqldump -uusername -ppassword databasename >/backup/dump.sql
with the user's credentials and ofcourse correct path to backup to.

So this makes it look as if the database is not corrupt. But I don't understand the difference, unless indeed WordFence is blocking some things some way.
Any clue on this why it does work at userlevel, but not from mysqldump, neither as da_admin (so mysql root) nore as user?

Edit: Just tried by using the admin backup/restore and there also is not a problem, backup is done successfully.
So why doesn't it work from mysqldump when upgrading MariaDB? I'm really confused now. Is that Wordfence blocking things or something?
 
Any clue on this why it does work at userlevel

You might check what options are used for creating dumps (I don't have any other way but to visually compare two dumps) and check size of SQL dumps created by directadmin in both cases.

Does or doesn't? At least it does not from within DA.

does NOT. Thanks for pointing to this typo.
 
You might check what options are used for creating dumps (I don't have any other way but to visually compare two dumps) and check size of SQL dumps created by directadmin in both cases.
I only checked both database options when creating the backup. Size of the SQL dumps are exactly the same in both cases.

systemd status might show the error.
What do you mean? Status of mysql server? No doesn't show anything, and database is working fine, only this one account has the issue, all other accounts, also which were backed-up after this account were doing fine.
 
I get the impression that the error is in the password.
The password uses a . and a ! so as example (i masked it) it looks like 8P!S3D.6DF in the wp-config.php file.
Now when I use this line:
mysqldump -uuser_wp979 -p8P!S3D.6DF user_wp979 >/home/user/backups/dump.sql
the result is:
-bash: 8P!S3D.6DF: event not found

So the only way to do this via commandline (which mysql upgrade also uses) is using the -p without the password and then fill in the password after pressing enter.
mysqldump -uuser_wp979 -p user_wp979 >/home/user/backups/dump.sql
then fill in password after pressing enter and then this error occurs.
Code:
Enter password:
mysqldump: Error 2013: Lost connection to server during query when dumping table `wp_wfconfig` at row: 226
however some dump is made anyway. I didn't test if it would be the same when I would pack it with .tar.zst like DA does.

So it seems as if the password is causing the issue, it shouldn't give that "event not found error" either so that might also be causing the issue with the mysqldump that the mysql upgrade uses. While DA probably uses a different method to provide the password, which makes things work correctly.

Maybe this sheds some more light on the issue? Unless when using DA the Wordfence doesn't care and so WF is the issue.
 
Last edited:
Maybe.... that table is still locked ?
Code:
--single-transaction --verbose
Try add this arg to dump command.
 
That also works well until line 226 as above.
Beginning:
Code:
Enter password:
-- Connecting to localhost...
-- Starting transaction...
-- Setting savepoint...
-- Retrieving table structure for table wp_actionscheduler_actions...
-- Sending SELECT query...
-- Retrieving rows...
-- Rolling back to savepoint sp...
-- Retrieving table structure for table wp_actionscheduler_claims...
-- Sending SELECT query...
-- Retrieving rows...
-- Rolling back to savepoint sp...
-- Retrieving table structure for table wp_actionscheduler_groups...
-- Sending SELECT query...
-- Retrieving rows...
-- Rolling back to savepoint sp...
-- Retrieving table structure for table wp_actionscheduler_logs...
-- Sending SELECT query...

and so on. And then a lot lower:
Code:
-- Retrieving rows...
-- Rolling back to savepoint sp...
-- Retrieving table structure for table wp_wfblocks7...
-- Sending SELECT query...
-- Retrieving rows...
-- Rolling back to savepoint sp...
-- Retrieving table structure for table wp_wfconfig...
-- Sending SELECT query...
-- Retrieving rows...
mysqldump: Error 2013: Lost connection to server during query when dumping table `wp_wfconfig` at row: 226
and then it ends.

Looks to me as if Wordfense is blocking somehow.

Just checked the backup made from within DA itself which went good, and there that table has no issues:
Code:
-- Table structure for table `wp_wfconfig`
--

DROP TABLE IF EXISTS `wp_wfconfig`;
I can't place the rest, forum error again, but that looks good.
 
Yes, look like wordfence lock read/write the table. That's bad.

Admin -> Database :: Should show the process list relate to that table.

try this.
Code:
--quick --single-transaction --max-allowed-packet=1G
 
I guest, during update/install mysql, it's still use legacy tool ???

Since normal admin backup still work normally, right ??
 
During update/install mysql it's using the same as any other license. Custombuild update. I use it via commandline but that makes no difference

Normal admin backup or user backup is working normally yes.
 
I don't get out put here:
Code:
select * from INFORMATION_SCHEMA.PROCESSLIST where db = 'user_wp979';

That's how I told "Legacy tools", like required some config, args, options.
Not sure what you mean, I don't do anything special, just like always.

da build update
da build update_versions
 
during mysql update, CB not using the command same as admin backup.

I'm so sleepy, good night.
 
Back
Top