Bitbucket fails to start with UnsatisfiedLinkError, failed to map segment from shared object.
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
Summary
After patching your server or migrating, Bitbucket is unable to start.
Environment
- Bitbucket Server and Data Center - Any version
Diagnosis
From the logs you can see something similar to the following:
Caused by: java.lang.UnsatisfiedLinkError: /collections/bitbucket-home/tmp/jna5506300920731564261.tmp: /collections/bitbucket-home/tmp/jna5506300920731564261.tmp: failed to map segment from shared object: Operation not permitted
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1086)
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1012)
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:988)
at com.sun.jna.Native.<clinit>(Native.java:195)
at com.zaxxer.nuprocess.linux.LibEpoll.<clinit>(LibEpoll.java:29)
at com.zaxxer.nuprocess.linux.LinuxProcess.<clinit>(LinuxProcess.java:40)
at com.zaxxer.nuprocess.linux.LinProcessFactory.runProcess(LinProcessFactory.java:49)
at com.zaxxer.nuprocess.NuProcessBuilder.run(NuProcessBuilder.java:273)
at com.atlassian.bitbucket.internal.process.nu.NuNioProcessHelper.validate(NuNioProcessHelper.java:128)
... 5 common frames omitted
Cause
- The directory exists in a subdirectory that is mounted
- The user running Bitbucket doesn't have proper permissions
- Security hardening (such as via AppArmor) is enabled
Solution
- Ensure the mounted directory has "exec" permissions
- The BITBUCKET_HOME directory (and all subdirectories) are owned by the user running Bitbucket and have read, write, and execute permissions.
- Disable security hardening (or re-configure it in such a way it doesn't affect Bitbucket Server)
Last modified on Feb 28, 2022
Powered by Confluence and Scroll Viewport.