Restore fails with unable to extract backup metadata error

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

 

Problem

Executing the backup client results in an error.

The following appears in the <backup.home>/log/atlassian-bitbucket-YYYY-MM-DD.log

2015-07-09 11:16:02,944 INFO         Initializing
2015-07-09 11:16:04,132 WARN         Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.support.PropertySourcesPlaceholderConfigurer#0' defined in class path resource [META-INF/spring/restore-spring.xml]: Cannot create inner bean 'com.atlassian.stash.internal.backup.client.spring.env.FlatteningPropertySources#1a9fda8f' of type [com.atlassian.stash.internal.backup.client.spring.env.FlatteningPropertySources] while setting bean property 'propertySources'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.atlassian.stash.internal.backup.client.spring.env.FlatteningPropertySources#1a9fda8f' defined in class path resource [META-INF/spring/restore-spring.xml]: Cannot create inner bean 'sharedHomePropertySource' of type [com.atlassian.stash.internal.backup.client.spring.env.SharedHomePropertySource] while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sharedHomePropertySource' defined in class path resource [META-INF/spring/restore-spring.xml]: Cannot resolve reference to bean 'sharedHomeLocator' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'restoreConfig' defined in class path resource [META-INF/spring/restore-spring.xml]: Invocation of init method failed; nested exception is com.atlassian.stash.internal.backup.client.RestoreException: Unable to extract the backup metadata from /var/atlassian/application-data/stash/export/backup-admin-20150707-045047-883Z.zip
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:313) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:122) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
        ... 14 more frames available in the log file
2015-07-09 11:16:04,199 ERROR        The application could not be started. An unexpected error prevented the Spring
ApplicationContext from being created. Details of the error follow.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.support.PropertySourcesPlaceholderConfigurer#0' defined in class path resource [META-INF/spring/restore-spring.xml]: Cannot create inner bean 'com.atlassian.stash.internal.backup.client.spring.env.FlatteningPropertySources#1a9fda8f' of type [com.atlassian.stash.internal.backup.client.spring.env.FlatteningPropertySources] while setting bean property 'propertySources'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.atlassian.stash.internal.backup.client.spring.env.FlatteningPropertySources#1a9fda8f' defined in class path resource [META-INF/spring/restore-spring.xml]: Cannot create inner bean 'sharedHomePropertySource' of type [com.atlassian.stash.internal.backup.client.spring.env.SharedHomePropertySource] while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sharedHomePropertySource' defined in class path resource [META-INF/spring/restore-spring.xml]: Cannot resolve reference to bean 'sharedHomeLocator' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'restoreConfig' defined in class path resource [META-INF/spring/restore-spring.xml]: Invocation of init method failed; nested exception is com.atlassian.stash.internal.backup.client.RestoreException: Unable to extract the backup metadata from /var/atlassian/application-data/stash/export/backup-admin-20150707-045047-883Z.zip
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:313) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:122) ~[spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
        ... 14 more frames available in the log file

Cause

You are running the backup client using the incorrect file as an input. For example:

/usr/bin/java -Dstash.home="/data/atlassian/application-data/stash" -jar stash-restore-client.jar "/var/atlassian/application-data/stash/export/backup-admin-20150707-045047-883Z.zip"

Notice that backup-admin-20150707-045047-883Z.zip is not a valid backup file.

 

Resolution

You should really be attempting to restore the file that is generated inside the backup.home as described on the table in Using the Bitbucket Server Backup Client - Backing up Bitbucket Server using the client.

If that parameter wasn't specified during the backup time, then the right file to be restored namely stash-YYYYMMDD-HHMMSS-ID.tar should be inside the <backup-tool>/backups directory.

If you attempted to restore the correct stash-YYYYMMDD-HHMMSS-ID.tar file, please try to generate a new backup and attempt a new restore.

Last modified on Apr 6, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.