Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-12859

Backup & Restore failure while using Bitbucket DIY script for MYSQL DB

    XMLWordPrintable

Details

    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

      1. Step 1: Clone the DIY script repository and fill the variables in the bitbucket.diy-backup.vars.sh for Bitbucket Mysql instance
      2. 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

          Activity

            People

              681995654583 Rajesh (Inactive)
              681995654583 Rajesh (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Backbone Issue Sync