Skip to content

Elasticsearch 7.X fails to start with jna tmp dir configured (CentOS8 - Hardened) #73309

@cyamal1b4

Description

@cyamal1b4

I am posting this as an open bug for the ES team to review, it is similar to other issues but this was the ONLY actual fix I found for my particular air gapped deployment.

Overview:

Elasticsearch 7.12,
Oracle JDK 1.8.0,
Noexec on /tmp,
Selinux in enforcing mode,
Explicitly defined path for jna.tmpdir without noexec,
CentOS 8
A fatal error has been detected by the Java Runtime Environment:

SIGSEGV (0xb) at pc=0x00007f9800b8d2ca, pid=21823, tid=0x00007f98f541f700

JRE version: Java(TM) SE Runtime Environment (8.0_112-b15) (build 1.8.0_112-b15)
Java VM: Java HotSpot(TM) 64-Bit Server VM (25.112-b15 mixed mode linux-amd64 compressed oops)
Problematic frame:
C [jna1247360738620499207.tmp+0x122ca] ffi_prep_closure_loc+0x1a

Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

If you would like to submit a bug report, please visit:
http://bugreport.java.com/bugreport/crash.jsp
The crash happened outside the Java Virtual Machine in native code.
See problematic frame for where to report the bug.

The reason of failure was that the system user with which ES was running did not have an existing home directory.

Once I created the homedir, it started as expected.
In the home directory, a directory ".oracle_jre_usage" is created which has a fd53b05c83802a42.timestamp file.

More about this file - https://community.oracle.com/thread/3783686.

This is a solution to a persistent problem I encountered but also through research all seemed to point to tmpdir issues, the logs seemed to suggest as well. But on deep examination and research it was discovered that on install there is no home directory provided to the elasticsearch user and thus causes this exact error with the JNA libraries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions