Restore fails with FileNotFoundException - Permission denied
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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
Restore can't be executed after running the following command:
1
$ java -Dbitbucket.home="<path/to/new_bitbucket_home>" -Djdbc.override="false" -jar <path/to/backup/client>/bitbucket-restore-client.jar <path/to/backup/file>/bitbucket-20140107-024714-807.tar
The following appears in the <path/to/backup/client>/log/atlassian-sbc-YYYY-MM-DD-HHMM.log:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
18:14:27,759 |-ERROR in ch.qos.logback.core.FileAppender[log] - openFile(/home/bitbucket_admin/log/atlassian-sbc-2014-01-08-1814.log,true) call failed. java.io.FileNotFoundException: /home/bitbucket_admin/log/atlassian-sbc-2014-01-08-1814.log (Permission denied)
at java.io.FileNotFoundException: /home/bitbucket_admin/log/atlassian-sbc-2014-01-08-1814.log (Permission denied)
at at java.io.FileOutputStream.openAppend(Native Method)
at at java.io.FileOutputStream.<init>(FileOutputStream.java:210)
at at ch.qos.logback.core.recovery.ResilientFileOutputStream.<init>(ResilientFileOutputStream.java:28)
at at ch.qos.logback.core.FileAppender.openFile(FileAppender.java:149)
at at ch.qos.logback.core.FileAppender.start(FileAppender.java:108)
at at ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:96)
at at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:317)
at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:196)
at at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:182)
at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
at at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
at at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:148)
at at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
at at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
at at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
at at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107)
at at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269)
at at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)
at at org.slf4j.LoggerFactory$getLogger.call(Unknown Source)
at at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at at com.atlassian.bitbucket.internal.backup.client.RestoreMain.<clinit>(RestoreMain.groovy:23)
Cause
Please review the permissions of the directory indicated in the exception thrown. In that case, the user executing the restore didn't have write permission to the <path/to/backup/client>/log
directory.
Resolution
Fix the permission of the referred directory and re-run the restore.
For more details on the restore procedure, please refer to the 2023-10-24_01-30-41_Bitbucket Server Backup Client document.
Was this helpful?