• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

Restore of customers/subscriptions/domains/databases fails if the customer or the subscription was disabled during backup

Bitpalast

Plesk addicted!
Plesk Guru
Username:

TITLE

Restore of customers/subscriptions/domains/databases fails if the customer or the subscription was disabled during backup

PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE

Obsidian 18.0.70 #3 and 18.0.71 #1
Alma 8
MariaDB 10.11

PROBLEM DESCRIPTION

When a disabled customer account is backed up with the Plesk Backup Manager, the databases in that account are backed up with an invalid SQL dump line. The dumps start with
Code:
/*M!999999\- enable the sandbox mode */
When the customer, the subscription, the domain or the database is restored from such a backup, the restore fails. It won't restore the database(s), because the syntax at the beginning of the dump files is not recognized by MariaDB.

STEPS TO REPRODUCE

1. Create a customer with a subscription
2. Create a database in that subscription
3. Suspend the customer
4. Do a full server backup using Plesk Backup Manager
5. Attempt to restore the customer from that backup.

ACTUAL RESULT

The database is created, but the content (the dump) is not imported into it. Backup manager shows warnings such as:

Warning: Restore domain "<mydomain.tld>"
Failed to restore the extension wp-toolkit: Error: The site you have requested is not installed.Run `wp core install` to create database tables.

Warning: Restore hosting "<mydomain.tld>"
Failed deployment of the database <mydatabase> (domain <mydomain.tld>)
Warning:
Errors occurred during deployment of the database content. Not all content may be restored. Resolve the errors if required or try to restore the content manually from the archive: databases/<mydatabase>[sqldump]: backup_sqldump_2507040153.tzst
Warning:
Execution of /usr/bin/mariadb --defaults-file=/etc/my.cnf -u backup_nCBf6Y4 -h localhost -P 3306 --default-character-set utf8 --abort-source-on-error <mydatabase> failed with return code 1.Stdin issource /tmp/pmm-ru-udb-dump-GPvvuS/backup_sqldump_2507040153;exitStderr isERROR at line 1 in file: '/tmp/pmm-ru-udb-dump-GPvvuS/backup_sqldump_2507040153': Unknown command '\-'.Last error isResource temporarily unavailable

EXPECTED RESULT

Error-free restore

ANY ADDITIONAL INFORMATION

The lines at the beginning of the SQL dump file in the backup archive look like this:

Code:
/*M!999999\- enable the sandbox mode */
-- MariaDB dump 10.19  Distrib 10.11.13-MariaDB, for Linux (x86_64)
--
-- Host: localhost    Database: <mydatabase>
-- ------------------------------------------------------
-- Server version       10.11.13-MariaDB

Workaround:
Extract the database dump from the tzst-file manually, then remove the first line and import the database manually.

YOUR EXPECTATIONS FROM PLESK SERVICE TEAM

Confirm bug
 
Thank you for the report, Peter. I am unable to replicate the issue on a test AlmaLinux 8.10 server, with MariaDB 10.11. I tried suspending the user before, after, and during the backup creation with no luck. The database is properly restored through the Customer, Subscription, and Database options. Could you please double-check /var/log/mariadb/mariadb.log and confirm if there are any errors related to the database there?
 
Just for reference:
It seems to have something to do with that. I'll try to reproduce it here on a test system once I find the time for it.
 
The backup exports on my test server also start with *M!999999\- enable the sandbox mode */, which is due to MariaDB bug that according to our team won't be fixed. I am still unable to reproduce the reported errors and the database import issue, so the root cause may be elsewhere.
 
I think the issue is caused because on that test server we are running MariaDB 10.11.7. According to to MariaDB Dump File Compatibility Change - MariaDB.org 10.11.7 is just one minor version short of the compatibility upgrade 10.11.8 from whereon the dump program recognizes the /*M!999999\- enable the sandbox mode */ sandbox line. The source mentions

Code:
The change is happening / has happened in MariaDB 10.5.25, 10.6.18, 10.11.8, 11.0.6, 11.1.5, 11.2.4 and 11.4.2. So, if you take a dump from these versions and try and import it into an unsupported version, such as 10.4, or an older bugfix version such as 10.5.24, you would hit this problem.

Could you please be so kind to verify that on your test environment, the MariaDB version fits one of these minor versions or is even newer? That would explain the issue and why you cannot reproduce it while it occurs on my test server here.
 
Back
Top