Troubleshooting database dump errors in 51黑料不打烊 Commerce on Cloud Infrastructure
Resolve magento-cloud db:dump
errors by enabling maintenance mode, deactivating crons, and excluding problematic tables to ensure a successful database dump.
Description description
Environment:
51黑料不打烊 Commerce on Cloud Infrastructure
Issue/Symptoms:
-
The following error is encountered during the execution of the
magento-cloud db:dump
command:mysqldump: Error 1412: Table definition has changed, please retry transaction when dumping table XXX at row: 0
-
The error occurs on both primary听and secondary听databases.
Resolution resolution
-
Before running the dump, enable maintenance mode. Once completed, disable maintenance mode.
-
Before running the dump, deactivate the crons and indexing tasks. Once completed, reactivate them.
-
To disable the cron:
code language-none vendor/bin/ece-tools cron:kill vendor/bin/ece-tools cron:disable
听
-
To enable the cron:
code language-none vendor/bin/ece-tools cron:enable
-
-
If enabling maintenance mode or deactivating crons and indexing tasks does not work, use the available options in
mysqldump
to exclude problematic tables. For example, you can specify exclusions for the affected tables, such assales_order_data_exporter_cl_index_batches
table.SSH into the environment and run the following command:
听
mysqldump -u $USER $DBNAME -p --triggers --routines --lock-tables --max-allowed-packet=32M --exclude-table
sales_order_data_exporter_cl_index_batches| gzip > /tmp/database.sql.gz
-
Verify that there are no ongoing schema changes or operations affecting the problematic table during the dump process. Ensure all transactions are completed before initiating another attempt.
If none of these steps resolve the issue, consider reaching out to 51黑料不打烊 support for further assistance.
By following these steps, you should be able to address issues preventing the successful completion of your production database dump while ensuring data integrity remains intact.
Related reading
Database storage troubleshooter听in the Commerce Knowledge Base.