Synchrony startup fails with "Failed to get mem_unit from sysinfo" error
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 upgrading Confluence to 7.x, Synchrony is not getting start and throwing below error in the logs
The following is found in atlassian-confluence.log
2020-03-20 14:30:29,874 WARN [lifecycle:thread-16] [plugins.synchrony.bootstrap.SynchronyInteropBootstrap] onStart An exception occurred while waiting for Synchrony to start: java.lang.UnsatisfiedLinkError: /home/confluence/.cache/JNA/temp/jna12881934674336678335.tmp: /home/confluence/.cache/JNA/temp/jna12881934674336678335.tmp: failed to map segment from shared object: Operation not permitted
2020-03-20 14:47:11,572 ERROR [Long running task: EnableTask] [confluence.util.longrunning.ConfluenceAbstractLongRunningTask] run Long running task "EnableTask" failed to run.
-- url: /confluence/rest/synchrony-interop/enable | referer: https://t-conflu-app0.bnppua.net.intra/confluence/admin/confluence-collaborative-editor-plugin/configure.action | traceId: 20f1129098170d20 | userName: admin2
java.lang.NoClassDefFoundError: Could not initialize class oshi.jna.platform.linux.Libc
at oshi.software.os.linux.LinuxOperatingSystem.getProcessId(LinuxOperatingSystem.java:344)
at com.atlassian.confluence.plugins.synchrony.bootstrap.DefaultSynchronyProcessManager.getConfluenceProcessId(DefaultSynchronyProcessManager.java:702)
at com.atlassian.confluence.plugins.synchrony.bootstrap.DefaultSynchronyProcessManager.setupEnvironment(DefaultSynchronyProcessManager.java:391)
at com.atlassian.confluence.plugins.synchrony.bootstrap.DefaultSynchronyProcessManager.trySetup(DefaultSynchronyProcessManager.java:709)
at com.atlassian.confluence.plugins.synchrony.bootstrap.DefaultSynchronyProcessManager.lambda$startProcess$1(DefaultSynchronyProcessManager.java:603)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
2020-03-20 14:49:09,179 ERROR [diagnostics-os-thread] [hardware.platform.linux.LinuxGlobalMemory] <init> Failed to get mem_unit from sysinfo. {}
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.platform.linux.LibC$Sysinfo
at oshi.hardware.platform.linux.LinuxGlobalMemory.<init>(LinuxGlobalMemory.java:62)
at oshi.hardware.platform.linux.LinuxHardwareAbstractionLayer.getMemory(LinuxHardwareAbstractionLayer.java:59)
at com.atlassian.confluence.internal.diagnostics.OperatingSystemMonitor.getAvailableMemory(OperatingSystemMonitor.java:211)
at com.atlassian.confluence.internal.diagnostics.OperatingSystemMonitor.checkFreeMemory(OperatingSystemMonitor.java:158)
at com.atlassian.confluence.internal.diagnostics.OperatingSystemMonitor.lambda$startMonitorThread$1(OperatingSystemMonitor.java:122)
at java.base/java.lang.Thread.run(Unknown Source)
2020-03-20 14:51:09,182 ERROR [diagnostics-os-thread] [hardware.platform.linux.LinuxGlobalMemory] <init> Failed to get mem_unit from sysinfo. {}
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.platform.linux.LibC$Sysinfo
at oshi.hardware.platform.linux.LinuxGlobalMemory.<init>(LinuxGlobalMemory.java:62)
at oshi.hardware.platform.linux.LinuxHardwareAbstractionLayer.getMemory(LinuxHardwareAbstractionLayer.java:59)
at com.atlassian.confluence.internal.diagnostics.OperatingSystemMonitor.getAvailableMemory(OperatingSystemMonitor.java:211)
at com.atlassian.confluence.internal.diagnostics.OperatingSystemMonitor.checkFreeMemory(OperatingSystemMonitor.java:158)
at com.atlassian.confluence.internal.diagnostics.OperatingSystemMonitor.lambda$startMonitorThread$1(OperatingSystemMonitor.java:122)
at java.base/java.lang.Thread.run(Unknown Source)
2020-03-20 14:53:09,183 ERROR [diagnostics-os-thread] [hardware.platform.linux.LinuxGlobalMemory] <init> Failed to get mem_unit from sysinfo. {}
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.platform.linux.LibC$Sysinfo
at oshi.hardware.platform.linux.LinuxGlobalMemory.<init>(LinuxGlobalMemory.java:62)
at oshi.hardware.platform.linux.LinuxHardwareAbstractionLayer.getMemory(LinuxHardwareAbstractionLayer.java:59)
at com.atlassian.confluence.internal.diagnostics.OperatingSystemMonitor.getAvailableMemory(OperatingSystemMonitor.java:211)
at com.atlassian.confluence.internal.diagnostics.OperatingSystemMonitor.checkFreeMemory(OperatingSystemMonitor.java:158)
at com.atlassian.confluence.internal.diagnostics.OperatingSystemMonitor.lambda$startMonitorThread$1(OperatingSystemMonitor.java:122)
at java.base/java.lang.Thread.run(Unknown Source)
Environment
Confluence version 7.x onwards
Linux / Unix like Operating system
Step to Reproduce
Install Confluence for ex: 7.x in the Linux OS where Confluence home is in /home and Confluence install is in /dev .
Mount /home to exec permission using below command and check the permission after that
$ mount --bind /home /home
$ mount -o remount,exec /home
- With this Configuration, Synchrony get started properly
- Now let’s Change /home to noexec using below command, Stop Confluence and execute below command,
$ mount -o remount,noexec /home
- After this change, restart the Confluence,
- Confluence started but Synchrony failed to start with below error,
2020-04-04 18:13:12,561 ERROR [StartEventPublisher:thread-1] [hardware.platform.linux.LinuxGlobalMemory] <init> Failed to get mem_unit from sysinfo. {}
java.lang.UnsatisfiedLinkError: /home/hemant/.cache/JNA/temp/jna40762817292981485.tmp: /home/hemant/.cache/JNA/temp/jna40762817292981485.tmp: failed to map segment from shared object
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1946)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1828)
at java.lang.Runtime.load0(Runtime.java:810)
at java.lang.System.load(System.java:1088)
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1018)
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:988)
at com.sun.jna.Native.<clinit>(Native.java:195)
at com.sun.jna.NativeLong.<clinit>(NativeLong.java:35)
at com.sun.jna.platform.linux.LibC$Sysinfo.<clinit>(LibC.java:48)
2020-04-04 18:14:59,078 ERROR [Long running task: EnableTask] [confluence.util.longrunning.ConfluenceAbstractLongRunningTask] run Long running task "EnableTask" failed to run.
-- url: /rest/synchrony-interop/enable | referer: http://192.168.1.8:8090/admin/confluence-collaborative-editor-plugin/configure.action | traceId: 80bbe0e1a4d102dd | userName: admin
java.lang.NoClassDefFoundError: Could not initialize class oshi.jna.platform.linux.Libc
at oshi.software.os.linux.LinuxOperatingSystem.getProcessId(LinuxOperatingSystem.java:344)
at com.atlassian.confluence.plugins.synchrony.bootstrap.DefaultSynchronyProcessManager.getConfluenceProcessId(DefaultSynchronyProcessManager.java:702)
at com.atlassian.confluence.plugins.synchrony.bootstrap.DefaultSynchronyProcessManager.setupEnvironment(DefaultSynchronyProcessManager.java:391)
at com.atlassian.confluence.plugins.synchrony.bootstrap.DefaultSynchronyProcessManager.trySetup(DefaultSynchronyProcessManager.java:709)
at com.atlassian.confluence.plugins.synchrony.bootstrap.DefaultSynchronyProcessManager.lambda$startProcess$1(DefaultSynchronyProcessManager.java:603)
2020-04-04 18:16:07,990 ERROR [diagnostics-os-thread] [hardware.platform.linux.LinuxGlobalMemory] <init> Failed to get mem_unit from sysinfo. {}
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.platform.linux.LibC$Sysinfo
at oshi.hardware.platform.linux.LinuxGlobalMemory.<init>(LinuxGlobalMemory.java:62)
at oshi.hardware.platform.linux.LinuxHardwareAbstractionLayer.getMemory(LinuxHardwareAbstractionLayer.java:59)
at com.atlassian.confluence.internal.diagnostics.OperatingSystemMonitor.getAvailableMemory(OperatingSystemMonitor.java:211)
at com.atlassian.confluence.internal.diagnostics.OperatingSystemMonitor.checkFreeMemory(OperatingSystemMonitor.java:158)
at com.atlassian.confluence.internal.diagnostics.OperatingSystemMonitor.lambda$startMonitorThread$1(OperatingSystemMonitor.java:122)
at java.lang.Thread.run(Thread.java:748)
Expected Result
Synchrony should start properly without checking mount point permission. Before Confluence 7.1.x , the issue is not reproducible. If the mount has noexec, Synchrony is getting started without any problem.
Actual Result
User is unable to start the Synchrony and getting below error with Confluence version 7.x.x
2020-04-04 18:13:12,561 ERROR [StartEventPublisher:thread-1] [hardware.platform.linux.LinuxGlobalMemory] <init> Failed to get mem_unit from sysinfo. {}
java.lang.UnsatisfiedLinkError: /home/hemant/.cache/JNA/temp/jna40762817292981485.tmp: /home/hemant/.cache/JNA/temp/jna40762817292981485.tmp: failed to map segment from shared object
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1946)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1828)
at java.lang.Runtime.load0(Runtime.java:810)
at java.lang.System.load(System.java:1088)
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1018)
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:988)
at com.sun.jna.Native.<clinit>(Native.java:195)
at com.sun.jna.NativeLong.<clinit>(NativeLong.java:35)
at com.sun.jna.platform.linux.LibC$Sysinfo.<clinit>(LibC.java:48)
at java.lang.Thread.run(Thread.java:748)
2020-04-04 18:14:59,078 ERROR [Long running task: EnableTask] [confluence.util.longrunning.ConfluenceAbstractLongRunningTask] run Long running task "EnableTask" failed to run.
-- url: /rest/synchrony-interop/enable | referer: http://192.168.1.8:8090/admin/confluence-collaborative-editor-plugin/configure.action | traceId: 80bbe0e1a4d102dd | userName: admin
java.lang.NoClassDefFoundError: Could not initialize class oshi.jna.platform.linux.Libc
at oshi.software.os.linux.LinuxOperatingSystem.getProcessId(LinuxOperatingSystem.java:344)
at com.atlassian.confluence.plugins.synchrony.bootstrap.DefaultSynchronyProcessManager.getConfluenceProcessId(DefaultSynchronyProcessManager.java:702)
at com.atlassian.confluence.plugins.synchrony.bootstrap.DefaultSynchronyProcessManager.setupEnvironment(DefaultSynchronyProcessManager.java:391)
at com.atlassian.confluence.plugins.synchrony.bootstrap.DefaultSynchronyProcessManager.trySetup(DefaultSynchronyProcessManager.java:709)
at com.atlassian.confluence.plugins.synchrony.bootstrap.DefaultSynchronyProcessManager.lambda$startProcess$1(DefaultSynchronyProcessManager.java:603)
2020-04-04 18:16:07,990 ERROR [diagnostics-os-thread] [hardware.platform.linux.LinuxGlobalMemory] <init> Failed to get mem_unit from sysinfo. {}
java.lang.NoClassDefFoundError: Could not initialize class com.sun.jna.platform.linux.LibC$Sysinfo
at oshi.hardware.platform.linux.LinuxGlobalMemory.<init>(LinuxGlobalMemory.java:62)
at oshi.hardware.platform.linux.LinuxHardwareAbstractionLayer.getMemory(LinuxHardwareAbstractionLayer.java:59)
at com.atlassian.confluence.internal.diagnostics.OperatingSystemMonitor.getAvailableMemory(OperatingSystemMonitor.java:211)
at com.atlassian.confluence.internal.diagnostics.OperatingSystemMonitor.checkFreeMemory(OperatingSystemMonitor.java:158)
at com.atlassian.confluence.internal.diagnostics.OperatingSystemMonitor.lambda$startMonitorThread$1(OperatingSystemMonitor.java:122)
at java.lang.Thread.run(Thread.java:748)
Cause
This error seems to be Confluence User Home is mounted on noexec permission mount point.
Workaround
Confluence Bug for the same issue:
CONFSERVER-59815 - Getting issue details... STATUS
There are 3 workarounds to fix this issue,
Remount /home as exec permission with the following command:
$ mount -o remount,exec /home
- Transfer Confluence Home directory to another File system that has exec permission.
- Or, change the JNA temp dir with the following system property:
-Djna.tmpdir=<path>