0

I am using elasticsearch in a liferay portal (sidecar). Unfortunately, elasticsearch can only be startet as root user. Otherwise, I get a java native error in org.elasticsearch.bootstrap.JNANatives.trySetMaxNumberOfThreads on bootstrapping:

V  [libjvm.so+0x687142]  InterpreterRuntime::resolve_invoke(JavaThread*, Bytecodes::Code)+0x1b2
j  org.elasticsearch.bootstrap.JNANatives.trySetMaxNumberOfThreads()V+20
j  org.elasticsearch.bootstrap.Natives.trySetMaxNumberOfThreads()V+17
j  org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Ljava/nio/file/Path;ZZZ)V+75

I have checked/updated the ulimits for the current user, but it seems like JNANatives is not allowed to execute this methods. The service starts fine as root, but I want to avoid any root processes on the server. Does someone had a similar problem? How can I debug this? What could be the issue here?

Many thanks

Andre Albert
  • 1,386
  • 8
  • 17

1 Answers1

0

Now, I found the problem and want to share it here, so that anyone has a similar issues finds a possible hint. I figured out that some folders up the hierarchy, there was a mount involved causing some permission issues. This causes a hotspot JVM native error in org.elasticsearch.bootstrap.JNANatives.trySetMaxNumberOfThreads(). Liferay reports java.io.StreamCorruptedException: invalid type code: 23 for elasticsearch. I thought it was due to a ulimit, but it wasn't. Fixing mount/folder permissions on a top level folder, resolved the bootstrapping issues.

Andre Albert
  • 1,386
  • 8
  • 17