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

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

    

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

  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)

Last modified on Feb 28, 2022

Was this helpful?

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