Uploaded image for project: 'Confluence Server and Data Center'
  1. Confluence Server and Data Center
  2. CONFSERVER-59815

Synchrony not starting. Fails with error "Failed to get mem_unit from sysinfo."

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Gathering Impact (View Workflow)
    • Priority: Low
    • Resolution: Unresolved
    • Affects Version/s: 7.2.2, 7.4.0, 7.3.3, 7.4.4
    • Fix Version/s: None
    • Component/s: Editor - Synchrony
    • Labels:
      None

      Description

      Issue Summary

      After upgrading Confluence to 7.3.3, Synchrony is not getting started and throwing below error in the logs,

      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. {}
      

      Steps to Reproduce

      1. Install Confluence for ex: 7.3.3 in the Linux OS where Confluence home is in /home and Confluence install is in /dev .
      2. Mount /home to exec permission using the below command and check the permission after that.
        $ mount --bind /home /home
        $ mount -o remount,exec /home
        


      3. With this Configuration, Synchrony gets started properly.
      4. Now let’s Change /home to noexec using below command, Stop Confluence and execute below command,
        mount -o remount,noexec /home
        

      5. After this change, restart the Confluence

      Expected Results

      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 Results

      Users are 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)
      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)
      

      Similar issues can be caused if there is not enough space where the JNA temp dir exists:

      WARN [lifecycle:thread-27] [plugins.synchrony.bootstrap.SynchronyInteropBootstrap] onStart An exception occurred while waiting for Synchrony to start: java.lang.UnsatisfiedLinkError: Failed to create temporary file for /com/sun/jna/linux-x86-64/libjnidispatch.so library: No space left on device
      
      Caused by: java.lang.UnsatisfiedLinkError: Failed to create temporary file for /com/sun/jna/linux-x86-64/libjnidispatch.so library: No space left on device
      

      Environment

      • Confluence version 7.x onwards
      • Linux / Unix like Operating system

      Notes

      This issue does not usually occur before Confluence 7.1.x versions.

      The issue may happen even if Confluence is not installed under the home folder. This is because the jnidispatch.path is defined under the home folder of the user account that owns the Confluence process. This is where the JNA temp files are located, hence the error on the logs.

      Workaround

      There are 3 workarounds to fix this issue:

      1. Remount /home as exec permission. For this use below command,
        $ mount -o remount,exec /home
        
      1. Transfer Confluence Home directory to another File system which has exec permission.
      2. Or, change the JNA temp dir with the following system property:
        -Djna.tmpdir=<path>
        

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ahuzik Ales Huzik (Inactive)
              Reporter:
              hgupta@atlassian.com Hemant Gupta
              Votes:
              4 Vote for this issue
              Watchers:
              11 Start watching this issue

                Dates

                Created:
                Updated: