Jenkins fails to start with JNA error

Article ID:215281717
1 minute readKnowledge base


Attempting to start CloudBees Jenkins Enterprise or CloudBees Jenkins Operations Center results in a stacktrace similar to the one below:

Starting CloudBees Jenkins Enterprise Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at Main._main(
at Main.main(
Caused by: java.lang.UnsatisfiedLinkError: /tmp/jna--1712433994/jna7387046629130767794.tmp: /tmp/jna--1712433994/jna7387046629130767794.tmp: failed to map segment from shared object: Operation not permitted
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(
at java.lang.ClassLoader.loadLibrary(
at java.lang.Runtime.load0(
at java.lang.System.load(
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(
at com.sun.jna.Native.loadNativeDispatchLibrary(
at com.sun.jna.Native.<clinit>(
at com.sun.akuma.CLibrary.<clinit>(
at com.sun.akuma.JavaVMArguments.resolvePID(
at com.sun.akuma.JavaVMArguments.ofLinux(
at com.sun.akuma.JavaVMArguments.of(
at com.sun.akuma.JavaVMArguments.current(
at com.sun.akuma.Daemon.daemonize(
at com.sun.akuma.Daemon.all(
... 6 more


The issue is being caused by the noexec settings for the /tmp directory. These settings are preventing the Jenkins process to launch the JNA library from the /tmp directory.

To resolve the issue, please do either of the following.

Option 1: Change the temporary directory of Jenkins

To change the temporary directory that Jenkins uses, you need to:

  1. Create $JENKINS_HOME/tmp folder (e.g. /var/lib/jenkins/tmp for Jenkins LTS Red Hat distributions) using the Unix user that runs the Jenkins process (e.g. same $JENKINS_USER under /etc/sysconfig/jenkins for Jenkins LTS Red Hat distributions)

  2. Append$JENKINS_HOME/tmp into JENKINS_JAVA_OPTIONS variable (e.g. in the /etc/sysconfig/jenkins file for for Jenkins LTS Red Hat distributions

Option 2: Fix the mount option of /tmp

As root, edit /etc/fstab configuration file and remove noexec from the mount option of /tmp directory. Then run:

mount -o remount /tmp

to apply the modification.