Bitbucket fails to start with UnsatisfiedLinkError, failed to map segment from shared object.

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

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:

1 2 3 4 5 6 7 8 9 10 11 12 13 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

  1. The directory exists in a subdirectory that is mounted

  2. The user running Bitbucket doesn't have proper permissions

  3. Security hardening (such as via AppArmor) is enabled

Solution

  1. Ensure the mounted directory has "exec" permissions

  2. The BITBUCKET_HOME directory (and all subdirectories) are owned by the user running Bitbucket and have read, write, and execute permissions.

  3. Disable security hardening (or re-configure it in such a way it doesn't affect Bitbucket Server)

Updated on March 19, 2025

Still need help?

The Atlassian Community is here for you.