Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Bitbucket restore client unable to restore from backup

Andrei Stoicescu July 4, 2019

Hello

I have a problem with the backup client (https://confluence.atlassian.com/bitbucketserver/using-the-bitbucket-server-backup-client-776640064.html)

I can't restore the bitbucket data because of this error:

2019-07-05 00:04:43,673 ERROR        Unable to insert into table cwd_user_attribute data [id=163843, user_id=131073, directory_id=32769, attribute_name=lastAuthenticationTimestamp, attribute_value=1553691165395, attribute_lower_value=1553691165395, attribute_numeric_value=1553689908679] with statement insert into PUBLIC.cwd_user_attribute (id, user_id, directory_id, attribute_name, attribute_value, attribute_lower_value, attribute_numeric_value) values (?, ?, ?, ?, ?, ?, ?)

2019-07-05 00:04:43,808 ERROR        bitbucket-20190327-145310-295.tar could not be restored

com.atlassian.stash.internal.backup.liquibase.LiquibaseChangeExecutionException: Failed to execute change: Inserts data into an existing table; nested exception is java.sql.SQLSyntaxErrorException: user lacks privilege or object not found: ATTRIBUTE_NUMERIC_VALUE

at com.atlassian.stash.internal.backup.liquibase.DefaultLiquibaseDao.insert(DefaultLiquibaseDao.java:306)

at com.atlassian.stash.internal.backup.liquibase.DatabaseUpdater.onChangesetContent(DatabaseUpdater.java:63)

 

It seems that in the back-up archive i have an insert with that column but when the table is created the column is missing. If i start a new instance of bitbucket i have that column.

I've tried to edit the backup archive and remove that insert but after i created the archive again i get this error:

Caused by: java.lang.IllegalArgumentException: Invalid byte 86 at offset 7 in '6nFVNvV' len=8

at org.apache.commons.compress.archivers.tar.TarUtils.parseOctal(TarUtils.java:130)

at org.apache.commons.compress.archivers.tar.TarUtils.parseOctalOrBinary(TarUtils.java:175)

at org.apache.commons.compress.archivers.tar.TarArchiveEntry.parseTarHeader(TarArchiveEntry.java:942)

at org.apache.commons.compress.archivers.tar.TarArchiveEntry.parseTarHeader(TarArchiveEntry.java:931)

at org.apache.commons.compress.archivers.tar.TarArchiveEntry.<init>(TarArchiveEntry.java:324)

at org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:242)

and i'm guessing that is because i created the archive manually.

 

Can you help me with a solution for this.

This is my only backup and it worked like a charm 2 months ago, but i encountered a problem and i lost the database, so when i try to restore the data i encounter those problems.

Thanks

1 answer

0 votes
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 8, 2019

Hello Andrei and welcome to the Community!

Thank you for providing the log output from attempt restore and the steps you’ve taken to get to this point in the restore. From the article you sent, there are a few steps required to restore from the backup client. Please confirm you’ve completed these steps prior to and during your restore process;

Follow this process:

  1. Stop your Bitbucket Server instance.
  2. Delete the content of the current home directory, so that it is empty.
  3. Drop the existing tables in your database so it is empty. The database still needs to exist with the same user/password, and it should have the configuration described in the 'Create the Bitbucket Server database' section of the relevant page here: 
  4. Run the Restore Client using the following command (replacing 'path/to/bitbucket/home' and '/path/to/original/backup/file' with your own values):
    java -Dbitbucket.home="path/to/bitbucket/home" -jar bitbucket-restore-client.jar /path/to/original/backup/file

If you are restoring Bitbucket Server to fix a corrupted installation, now follow Steps 4 to 6 of the Bitbucket Server upgrade guide. Note that you should use the same version of Bitbucket Server that was used to back up Bitbucket Server.

Source documentation: Restoring Bitbucket Server to use a newly created DB 

We look forward to hearing back to help find the issue with your Bitbucket restore.

Regards,
Stephen Sifers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events