Details
-
Bug
-
Resolution: Fixed
-
Low
-
None
-
7.12.1
-
Severity 2 - Major
-
Description
Issue Summary
The Backup & Restore using Bitbucket DIY script for Mysql DB fails for below reasons:
- BITBUCKET_BACKUP_DB variable is a directory instead of file.
- The mysqldump command would throw 'Access Denied' error if the bitbucketuser credentials is used in the config file.
- The restore would fail if the user hasn't created the database before executing the restore script.
Steps to Reproduce
- Step 1: Clone the DIY script repository and fill the variables in the bitbucket.diy-backup.vars.sh for Bitbucket Mysql instance
- Step 2: Execute the Backup script - bitbucket.diy-backup.sh
Expected Results
The Backup to complete and generate the tar.gz file. The restore script should then use this tar.gz file to restore the instance in the new target.
Actual Results
The backup & restore fails with the following errors during execution. We can see the below errors in execution logs.
*./database-mysql.sh: line 24: /home/ubuntu/backup-mysql5/bitbucket-db/: Is a directory* [bitbucket.diy-backup.sh:0 -> main][ip-10-117-8-235] ERROR: Backing up Bitbucket failed
mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces
[database-mysql.sh:41 -> prepare_restore_db][ip-10-117-8-112] DEBUG: Running mysqlshow -h 127.0.0.1 -u bitbucketuser -pbItbucket@332 bitbucket mysqlshow: [Warning] Using a password on the command line interface can be insecure. mysqlshow: Unknown database 'bitbucket'
Workaround
The attached database-mysql.sh contains the fix for all the mentioned issues. The fix has been tested in both Mysql 5 & 8 versions and working correctly as expected.
Attachments
Issue Links
- relates to
-
BSERV-4823 DIY backup example script should fail fast if DB isn't postgress
- Gathering Impact
- mentioned in
-
Page Loading...