java.io.FileNotFoundException when loading server.xml
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
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.
*Fisheye および Crucible は除く
問題
Bitbucket Server fails to load the server.xml
and the following appears in the catalina.out:
28-Jul-2016 19:00:00.000 SEVERE [main] com.atlassian.stash.internal.catalina.startup.Bootstrap.logError Copying fallback default-server.xml to shared home; no other server.xml file was found
28-Jul-2016 19:00:00.001 SEVERE [main] com.atlassian.stash.internal.catalina.startup.Bootstrap.logException Failed to copy /opt/atlassian/bitbucket/4.5.2/conf/.default-server.xml to /var/atlassian/application-data/bitbucket/shared/server.xml
java.io.FileNotFoundException: /var/atlassian/application-data/bitbucket/shared/server.xml (Permission denied)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
at com.atlassian.stash.internal.catalina.startup.Bootstrap$ArgumentDecorator.copyFallbackServerXmlTo(Bootstrap.java:196)
at com.atlassian.stash.internal.catalina.startup.Bootstrap$ArgumentDecorator.apply(Bootstrap.java:131)
at com.atlassian.stash.internal.catalina.startup.Bootstrap.main(Bootstrap.java:79)
診断
Diagnostic Steps
Check the permissions and ownership over the
server.xml
file by running:ls -l /var/atlassian/application-data/bitbucket/shared
原因
The ownership over the
server.xml
file isn't not properly set. In the case above, it was set as follows:-rw------- 1 atlbitbucket root 7662 Jul 28 12:00 server.xml
The user is properly set as "
atlbitbucket
" as this is the user running the application, but it's related to the group "root
".
ソリューション
Adjust the ownership over the
server.xml
file according to the user running the application, then restart Bitbucket Server:chown atlbitbucket:atlbitbucket server.xml