Error on database backup


I’m using the following script to backup which is based on

if [ $UID -eq 0 ]; then
	exec su ubuntu "$0" -- "$@"
tutor local exec -e MYSQL_ROOT_PASSWORD="$(tutor config printvalue MYSQL_ROOT_PASSWORD)" mysql \
    sh -c 'mysqldump --all-databases --password=$MYSQL_ROOT_PASSWORD > /var/lib/mysql/dump.sql'
tutor local exec mongodb mongodump --out=/data/db/dump.mongodb

However I’m getting the following error:

docker-compose -f /home/ubuntu/.local/share/tutor/env/local/docker-compose.yml -f /home/ubuntu/.local/share/tutor/env/local/ --project-name tutor_local exec -e MYSQL_ROOT_PASSWORD=mErpRtPK mysql sh -c mysqldump --all-databases --password=$MYSQL_ROOT_PASSWORD > /var/lib/mysql/dump.sql
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Got error: 1146: Table 'openedx.shoppingcart_certificateitem' doesn't exist when using LOCK TABLES
Error: Command failed with status 2: docker-compose -f /home/ubuntu/.local/share/tutor/env/local/docker-compose.yml -f /home/ubuntu/.local/share/tutor/env/local/ --project-name tutor_local exec -e MYSQL_ROOT_PASSWORD=mErpRtPK mysql sh -c mysqldump --all-databases --password=$MYSQL_ROOT_PASSWORD > /var/lib/mysql/dump.sql

I’m guessing there was an issue on a migration? Any help gratefully received as this is affecting my backup strategy!


The command you posted works fine in my environment. I have no idea what could cause this issue. Based on some cursory googling, are you quite sure that you database is not corrupted in some way?

Thank you for looking at this.

I think there’s a possibility something went wrong on a recent upgrade which may have led to this. Is there a recommended way of resetting the database and restoring without losing essential data?


You need to try to repair the table maybe with that you will solve it.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.