Hi,
I am trying to set up diy backup for my bitbucket server instance. I am a newbie, so please be gentle....
I have set up a test bitbucket instance with some users which appears to be working fine. I have created a diy-backup script as per the instructions and it appears to run, but the diagnostic output says Elasticsearch succeeded, but then backup failed; Note that I am not using any of the elasticsearch variables as it is a standard installation, so I am assuming that it shold be calling the no_op version of the Elasticsearch backups. (my example is based upon the postgres-rsync example script)
Running the command ./bitbucket-diy-backup.sh reports;
[common.ls /bitbucket-sh:17 -> source][bb] DEBUG: Using vars file ; './bitbucket.diy-backup.vars.sh'
(rsync stuff - works)
[common.sh:114 -> lock_bitbucket][bb] DEBUG: Running curl -L -s -f -u ******:****** http://localhost:7990/mvc/maintenance.lock
[common.sh:114 -> lock_bitbucket][bb] INFO: Bitbucket has been locked for maintenance. It can be unlocked with:
(etc.)
[bitbcket-diy-backup.sh:118 -> run_in_bg][bb] DEBUG: Started Elasticsearch backup (PID=2823)
[common.sh:120 -> backup_wait][bb] INFO: Waiting for Bitbucket to become ready to be backed up
[bitbcket-diy-backup.sh:0 -> main][bb] INFO: Backing up the database and filesystem in parallel
rm: cannot remove '/backup-root/bitbucket-db/': No such file or directory
[bitbucket-diy-backup.sh:123 -> run_in_bg][bb] DEBUG: Started Database backup (PID=2852)
[bitbucket-diy-backup.sh:124 -> run_in_bg][bb] DEBUG: Started Disk backup (PID=2858)
[disk-rsync.sh:23 -> perform_rsync_home_directory][bb] DEBUG: Running rsync -avh --delete --delete-excluded --exclude=/caches/ --exclude=/data/db.* --exclude=/shared/data/db.* --exclude=/search/data/ --exclude=/shared/search/data/ --exclude=/export/ --exclude=/log/ --exclude=/plugins/.*/ --exclude=/tmp --exclude=/.lock --exclude=/shared/.lock /home/bbuser/bbdata/ /backup-root/bitbucket-home
[bitbucket-diy-backup.sh:127 -> wait_for_bg_jobs][bb] DEBUG: Waiting for Databse backup (PID=2852)
sending incremental file list
[bitbucket-diy-backup.sh:127 -> wait_for_bg_jobs][bb] DEBUG: Waiting for Disk backup (PID=2858)
analytics-logs/16588fa71a97d9104d1549704b342b16.090b4a5c-a7df-430f-afdf-80d2edc0eeac.atlassian-analytics.log
sent 10.76K bytes received 151 bytes 21.81K bytes/sec
total size is 279.91K speedup is 25.67
[bitbucket-diy-backup.sh:127 -> wait_for_bg_jobs][bb] DEBUG: Disk backup finished successfully (PID=2858)
[bitbucket-diy-backup.sh:127 -> wait_for_bg_jobs][bb] DEBUG: Waiting for Elasticsearch backup (PID=2823)
[bitbucket-diy-backup.sh:127 -> wait_for_bg_jobs][bb] DEBUG: Elasticsearch backup finished successfully (PID=2823)
[bitbucket-diy-backup.sh:127 -> wait_for_bg_jobs][bb] ERROR: Database Backup failed with status 1 (PID=2823)
[common.sh:129 -> unlock_bitbucket][bb] DEBUG: running curl -L -s -f - u ******:****** http://loclahost:7990/mvc/maintenance/lock?token=214e9737d46b09adefda6668367458c7fa9abb3a
[bitbucket-diy-backup.sh:130 -> cleanup_incomplete_backup][bb] DEBUG: Cleaning up after failed backup
[bitbucket-diy-backup.sh:0 -> main][bb] ERROR: Backing up bitbucket failed
[common.sh:1 -> run_cleanup][bb] DEBUG: Running cleanup jobs...
(no further output!)
....but it doesnt cleanup properly either. I have to reboot the machine to get out of this one as even entering the correct backup token to unlock it still leaves the backup hung.
My major problem which I can;t get my head around is if the backup succedded why is it reporting an exit code of 1 and what can I do to fix it?