# ES 6.5.1 FATAL error on launch with JDK 11; no error / runs OK with JDK 1.8

**URL:** https://discuss.elastic.co/t/es-6-5-1-fatal-error-on-launch-with-jdk-11-no-error-runs-ok-with-jdk-1-8/157944
**Category:** Elasticsearch
**Created:** [November 22, 2018, 9:57pm UTC](https://discuss.elastic.co/t/es-6-5-1-fatal-error-on-launch-with-jdk-11-no-error-runs-ok-with-jdk-1-8/157944 "2018-11-22T21:57:16Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![Jole](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@Jole](https://discuss.elastic.co/u/Jole)
#### Post date: [November 22, 2018, 9:57pm UTC](https://discuss.elastic.co/t/es-6-5-1-fatal-error-on-launch-with-jdk-11-no-error-runs-ok-with-jdk-1-8/157944/1 "2018-11-22T21:57:16Z")

</div>

I installed ES 6.5.1 RPM

```auto
rpm -q elasticsearch
  elasticsearch-6.5.1-1.noarch

```

If I config

```auto
/etc/sysconfig/elasticsearch 
	JAVA_HOME=/usr/lib64/jvm/java-1.8.0-openjdk
	...

/usr/lib64/jvm/java-1.8.0-openjdk/bin/java -version
	openjdk version "1.8.0_181"
	OpenJDK Runtime Environment (IcedTea 3.9.0) (build 1.8.0_181-b13 suse-lp150.314.1-x86_64)
	OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

```

Launch is OK, and ES runs stable

```auto
systemctl status -l elasticsearch gentics-mesh
● elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/elasticsearch.service.d
           └─override.conf
   Active: active (running) since Thu 2018-11-22 13:36:27 PST; 156ms ago
     Docs: http://www.elastic.co
 Main PID: 31252 (elasticsearch)
    Tasks: 12 (limit: 9830)
   CGroup: /system.slice/elasticsearch.service
           ├─31252 /bin/bash /usr/share/elasticsearch/bin/elasticsearch -p /var/run/elasticsearch/elasticsearch.pid --quiet
           └─31273 /usr/lib64/jvm/java-1.8.0-openjdk/bin/java -cp /usr/share/elasticsearch/lib/* org.elasticsearch.tools.java_version_checker.JavaVersionChecker

```

If I switch to JDK 11

```auto
/etc/sysconfig/elasticsearch 
-	JAVA_HOME=/usr/lib64/jvm/java-1.8.0-openjdk
+	JAVA_HOME=/usr/lib64/jvm/java-11-openjdk-11
	...

/usr/lib64/jvm/java-11-openjdk-11/bin/java -version
	openjdk version "11.0.1" 2018-10-16
	OpenJDK Runtime Environment (build 11.0.1+13-suse-lp150.101.2-x8664)
	OpenJDK 64-Bit Server VM (build 11.0.1+13-suse-lp150.101.2-x8664, mixed mode)

```

Launch fails

```auto
==> /var/log/elasticsearch/elasticsearch.log <==
...

```

_EDIT:_

since FORUM complains

> "Body is limited to 7000 characters; you entered 9530."

output's at ==\> [https://pastebin.com/raw/4vFe99tx](https://pastebin.com/raw/4vFe99tx)

---

<div class="post-metadata">

### Author: ![pgomulka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pgomulka/32/45766_2.png) [@pgomulka](https://discuss.elastic.co/u/pgomulka)
#### Post date: [November 30, 2018, 3:58pm UTC](https://discuss.elastic.co/t/es-6-5-1-fatal-error-on-launch-with-jdk-11-no-error-runs-ok-with-jdk-1-8/157944/2 "2018-11-30T15:58:57Z")

</div>

Hi Jole, thank you for reaching out.

Would you be able to show your plugin-security.policy for x-pack-watcher ?  
Most likely it would be in "/usr/share/elasticsearch/modules/x-pack-watcher"

Could you also point to a place where you got your JDK from?

Please add following line  
`-Djava.security.debug=access,failure`  
to your elasticsearch jvm.options `/etc/elasticsearch/jvm.options`  
And then provide us with logs from `sudo journalctl -u elasticsearch`

Possibly the problem described by a user here might be similar to yours:

> [@Failing start elasticsearch 6.2.2 on ubuntu due to java.security permission denied](https://discuss.elastic.co/t/failing-start-elasticsearch-6-2-2-on-ubuntu-due-to-java-security-permission-denied/123902):
>
> Dear sirs, I'm struggling at starting up Elastic search on Ubuntu. My Settings: Java\_HOME: /usr/lib/jvm/java-8-oracle Java version: java version "1.8.0\_161" Java(TM) SE Runtime Environment (build 1.8.0\_161-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode) I've installed it with dpkg: dpkg -i elasticsearch-6.2.2.deb I have add this java.policy inside /etc/elasticsearch: // Standard extensions get all permissions by default grant codeBase "file:${{java.ext.dirs}}/\*" …

---

<div class="post-metadata">

### Author: ![Jole](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@Jole](https://discuss.elastic.co/u/Jole)
#### Post date: [December 1, 2018, 5:47pm UTC](https://discuss.elastic.co/t/es-6-5-1-fatal-error-on-launch-with-jdk-11-no-error-runs-ok-with-jdk-1-8/157944/3 "2018-12-01T17:47:48Z")

</div>

@pgomulka

Again: "Body is limited to 7000 characters; you entered 10664."

Srsly, that's really annoying.

Detailed responses to your questions are at:

[https://pastebin.com/raw/ENUR8Ui6](https://pastebin.com/raw/ENUR8Ui6)

---

<div class="post-metadata">

### Author: ![pgomulka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pgomulka/32/45766_2.png) [@pgomulka](https://discuss.elastic.co/u/pgomulka)
#### Post date: [December 1, 2018, 6:59pm UTC](https://discuss.elastic.co/t/es-6-5-1-fatal-error-on-launch-with-jdk-11-no-error-runs-ok-with-jdk-1-8/157944/4 "2018-12-01T18:59:15Z")

</div>

@Jole  
Are you sure you got your service restarted? I guess you don't get your access logs in `/var/log/elasticsearch` as well ?  
I was hoping to see logs in a form like (successful startup):

```auto
Nov 30 19:49:29 opensuse-leap elasticsearch[12250]: access: access allowed ("java.io.FilePermission" "/home/vagrant/jdk-11.0.1/lib/security/cacerts" "read")

Nov 30 19:49:29 opensuse-leap elasticsearch[12250]: access: access allowed ("java.lang.reflect.ReflectPermission" "suppressAccessChecks")

Nov 30 19:49:29 opensuse-leap elasticsearch[12250]: access: access allowed ("java.lang.reflect.ReflectPermission" "suppressAccessChecks")

Nov 30 19:49:29 opensuse-leap elasticsearch[12250]: access: access allowed ("java.lang.reflect.ReflectPermission" "suppressAccessChecks")

Nov 30 19:49:29 opensuse-leap elasticsearch[12250]: access: access allowed ("java.lang.reflect.ReflectPermission" "suppressAccessChecks")

Nov 30 19:49:29 opensuse-leap elasticsearch[12250]: access: access allowed ("java.util.PropertyPermission" "com.sun.security.preserveOldDCEncoding" "read")

Nov 30 19:49:29 opensuse-leap elasticsearch[12250]: access: access allowed ("java.util.PropertyPermission" "sun.security.rsa.restrictRSAExponent" "read")

Nov 30 19:49:29 opensuse-leap elasticsearch[12250]: access: access allowed ("java.lang.RuntimePermission" "accessClassInPackage.sun.security.util")

Nov 30 19:49:29 opensuse-leap elasticsearch[12250]: access: access allowed ("java.lang.RuntimePermission" "accessClassInPackage.sun.security.x509")

```

---

<div class="post-metadata">

### Author: ![Jole](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@Jole](https://discuss.elastic.co/u/Jole)
#### Post date: [December 1, 2018, 7:43pm UTC](https://discuss.elastic.co/t/es-6-5-1-fatal-error-on-launch-with-jdk-11-no-error-runs-ok-with-jdk-1-8/157944/5 "2018-12-01T19:43:47Z")

</div>

@pgomulka

No, I didn't get it restarted. That's the problem -- it FAILS to start with jdk11:

```auto
systemctl status elasticsearch
	● elasticsearch.service - Elasticsearch
	   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
	  Drop-In: /etc/systemd/system/elasticsearch.service.d
	           └─override.conf
	   Active: failed (Result: exit-code) since Sat 2018-12-01 11:35:15 PST; 6min ago
	     Docs: http://www.elastic.co
	  Process: 1480 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
	 Main PID: 1480 (code=exited, status=1/FAILURE)
	    Tasks: 0 (limit: 9830)
	   CGroup: /system.slice/elasticsearch.service

```

Here's the **_full_** output from `journalctl -u`:

[https://paste.fedoraproject.org/paste/BmzXVU8HduniouBNUv17Og/raw](https://paste.fedoraproject.org/paste/BmzXVU8HduniouBNUv17Og/raw)

---

<div class="post-metadata">

### Author: ![pgomulka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pgomulka/32/45766_2.png) [@pgomulka](https://discuss.elastic.co/u/pgomulka)
#### Post date: [December 3, 2018, 9:23am UTC](https://discuss.elastic.co/t/es-6-5-1-fatal-error-on-launch-with-jdk-11-no-error-runs-ok-with-jdk-1-8/157944/6 "2018-12-03T09:23:49Z")

</div>

@Jole I have managed to reproduce your problem locally with the JDK you have used.  
`https://download.opensuse.org/repositories/Java:/Factory/openSUSE_Leap_15.0/x86_64/java-11-openjdk-headless-11.0.1.0-lp150.101.2.x86_64.rpm`

Interestingly enough I don't get that problem when I use a jdk downloaded from: `https://jdk.java.net/11/`  
`https://download.java.net/java/GA/jdk11/13/GPL/openjdk-11.0.1_linux-x64_bin.tar.gz`

Similarly I don't get that problem when running JDK11 and elasticsearch on ubuntu. `https://app.vagrantup.com/elastic/boxes/ubuntu-18.04-x86_64`

I need more time to investigate why the problem occurs with JDK from SUSE repository you have used.  
Bear in mind that the SUSE Leap 15 is not supported yet by elastic `https://www.elastic.co/support/matrix`

In meantime can you try to workaround with using the jdk from `https://jdk.java.net/11/` ?

Let me know if that works

---

<div class="post-metadata">

### Author: ![Jole](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@Jole](https://discuss.elastic.co/u/Jole)
#### Post date: [December 3, 2018, 7:44pm UTC](https://discuss.elastic.co/t/es-6-5-1-fatal-error-on-launch-with-jdk-11-no-error-runs-ok-with-jdk-1-8/157944/7 "2018-12-03T19:44:07Z")

</div>

> Body is limited to 7000 characters; you entered 10455.  
> (can someone 'there' pls consider addressing this?)

==\>  
[https://paste.fedoraproject.org/paste/DjhbSLG9nEVhBjUTSwbhdg](https://paste.fedoraproject.org/paste/DjhbSLG9nEVhBjUTSwbhdg)

Could security policy be relevant here?

In Opensuse-packaged JDK 1.8, there's one:

/usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/jre/lib/security/java.policy

for JDK 11, there's two:

/usr/lib64/jvm/java-11-openjdk-11/lib/security/default.policy  
/usr/lib64/jvm/java-11-openjdk-11/conf/security/java.policy

Their respective contents are

==\>  
[https://paste.fedoraproject.org/paste/SdV-3SYRkCxUY4Ew97oojQ](https://paste.fedoraproject.org/paste/SdV-3SYRkCxUY4Ew97oojQ)

comparing to Ubuntu's,

[https://git.launchpad.net/ubuntu/+source/openjdk-lts/tree/src/java.base/share/conf/security/java.policy](https://git.launchpad.net/ubuntu/+source/openjdk-lts/tree/src/java.base/share/conf/security/java.policy)

[https://git.launchpad.net/ubuntu/+source/openjdk-lts/tree/src/java.base/share/lib/security/default.policy](https://git.launchpad.net/ubuntu/+source/openjdk-lts/tree/src/java.base/share/lib/security/default.policy)

nothing different jumps out at me at 1st glance

---

<div class="post-metadata">

### Author: ![pgomulka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pgomulka/32/45766_2.png) [@pgomulka](https://discuss.elastic.co/u/pgomulka)
#### Post date: [December 5, 2018, 10:59am UTC](https://discuss.elastic.co/t/es-6-5-1-fatal-error-on-launch-with-jdk-11-no-error-runs-ok-with-jdk-1-8/157944/8 "2018-12-05T10:59:56Z")

</div>

@Jole  
Glad to hear that this helped.  
Thank you for tips and suggestions. These are very helpful and I will certainly check them.

The problem is on my list to fix, and I am sure we will be ready before the maintenance expires for 42

---

<div class="post-metadata">

### Author: ![pgomulka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pgomulka/32/45766_2.png) [@pgomulka](https://discuss.elastic.co/u/pgomulka)
#### Post date: [December 5, 2018, 6:10pm UTC](https://discuss.elastic.co/t/es-6-5-1-fatal-error-on-launch-with-jdk-11-no-error-runs-ok-with-jdk-1-8/157944/9 "2018-12-05T18:10:14Z")

</div>

@Jole  
would you be able to share with me your jvm.options file and the exact command you have used to get your access logs (the one with journalctl I guess) ?

---

<div class="post-metadata">

### Author: ![Jole](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@Jole](https://discuss.elastic.co/u/Jole)
#### Post date: [December 5, 2018, 7:25pm UTC](https://discuss.elastic.co/t/es-6-5-1-fatal-error-on-launch-with-jdk-11-no-error-runs-ok-with-jdk-1-8/157944/10 "2018-12-05T19:25:30Z")

</div>

> Glad to hear that this helped

Just to be clear, the launch with **_Opensuse Leap's JDK_** still is FAILing.

> share with me your jvm.options file

```
cat etc/elasticsearch/jvm.options
    ## JVM configuration

    ################################################################
    ## IMPORTANT: JVM heap size
    ################################################################
    ##
    ## You should always set the min and max JVM heap
    ## size to the same value. For example, to set
    ## the heap to 4 GB, set:
    ##
    ## -Xms4g
    ## -Xmx4g
    ##
    ## See https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html
    ## for more information
    ##
    ################################################################

    # Xms represents the initial size of total heap space
    # Xmx represents the maximum size of total heap space

    -Xms1g
    -Xmx1g

    ################################################################
    ## Expert settings
    ################################################################
    ##
    ## All settings below this section are considered
    ## expert settings. Don't tamper with them unless
    ## you understand what you are doing
    ##
    ################################################################

    ## GC configuration
    -XX:+UseConcMarkSweepGC
    -XX:CMSInitiatingOccupancyFraction=75
    -XX:+UseCMSInitiatingOccupancyOnly

    ## G1GC Configuration
    # NOTE: G1GC is only supported on JDK version 10 or later.
    # To use G1GC uncomment the lines below.
    # 10-:-XX:-UseConcMarkSweepGC
    # 10-:-XX:-UseCMSInitiatingOccupancyOnly
    # 10-:-XX:+UseG1GC
    # 10-:-XX:InitiatingHeapOccupancyPercent=75

    ## optimizations

    # pre-touch memory pages used by the JVM during initialization
    -XX:+AlwaysPreTouch

    ## basic

    # explicitly set the stack size
    -Xss1m

    # set to headless, just in case
    -Djava.awt.headless=true

    # ensure UTF-8 encoding by default (e.g. filenames)
    -Dfile.encoding=UTF-8

    # use our provided JNA always versus the system one
    -Djna.nosys=true

    # turn off a JDK optimization that throws away stack traces for common
    # exceptions because stack traces are important for debugging
    -XX:-OmitStackTraceInFastThrow

    # flags to configure Netty
    -Dio.netty.noUnsafe=true
    -Dio.netty.noKeySetOptimization=true
    -Dio.netty.recycler.maxCapacityPerThread=0

    # log4j 2
    -Dlog4j.shutdownHookEnabled=false
    -Dlog4j2.disable.jmx=true

    -Djava.io.tmpdir=${ES_TMPDIR}

    ## heap dumps

    # generate a heap dump when an allocation from the Java heap fails
    # heap dumps are created in the working directory of the JVM
    -XX:+HeapDumpOnOutOfMemoryError

    # specify an alternative path for heap dumps; ensure the directory exists and
    # has sufficient space
    -XX:HeapDumpPath=/data/elasticsearch

    # specify an alternative path for JVM fatal error logs
    -XX:ErrorFile=/var/log/elasticsearch/hs_err_pid%p.log

    ## JDK 8 GC logging

    8:-XX:+PrintGCDetails
    8:-XX:+PrintGCDateStamps
    8:-XX:+PrintTenuringDistribution
    8:-XX:+PrintGCApplicationStoppedTime
    8:-Xloggc:/var/log/elasticsearch/gc.log
    8:-XX:+UseGCLogFileRotation
    8:-XX:NumberOfGCLogFiles=32
    8:-XX:GCLogFileSize=64m

    # JDK 9+ GC logging
    9-:-Xlog:gc*,gc+age=trace,safepoint:file=/var/log/elasticsearch/gc.log:utctime,pid,tags:filecount=32,filesize=64m
    # due to internationalization enhancements in JDK 9 Elasticsearch need to set the provider to COMPAT otherwise
    # time/date parsing will break in an incompatible way for some date patterns and locals
    9-:-Djava.locale.providers=COMPAT

    # temporary workaround for C2 bug with JDK 10 on hardware with AVX-512
    10-:-XX:UseAVX=2

    ## TEMP
    -Djava.security.debug=access,failure

```

> the exact command you have used to get your access logs (the one with journalctl I guess)

```
journalctl -u elasticsearch

```

---

<div class="post-metadata">

### Author: ![Jole](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@Jole](https://discuss.elastic.co/u/Jole)
#### Post date: [December 10, 2018, 9:45pm UTC](https://discuss.elastic.co/t/es-6-5-1-fatal-error-on-launch-with-jdk-11-no-error-runs-ok-with-jdk-1-8/157944/11 "2018-12-10T21:45:05Z")

</div>

same for ES 6.5.2

---

<div class="post-metadata">

### Author: ![Jole](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@Jole](https://discuss.elastic.co/u/Jole)
#### Post date: [December 12, 2018, 5:06pm UTC](https://discuss.elastic.co/t/es-6-5-1-fatal-error-on-launch-with-jdk-11-no-error-runs-ok-with-jdk-1-8/157944/12 "2018-12-12T17:06:39Z")

</div>

same for 6.5.3

---

<div class="post-metadata">

### Author: ![Jole](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@Jole](https://discuss.elastic.co/u/Jole)
#### Post date: [January 3, 2019, 5:48pm UTC](https://discuss.elastic.co/t/es-6-5-1-fatal-error-on-launch-with-jdk-11-no-error-runs-ok-with-jdk-1-8/157944/13 "2019-01-03T17:48:39Z")

</div>

Switched to Solr. Feel free to close this.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [January 31, 2019, 5:54pm UTC](https://discuss.elastic.co/t/es-6-5-1-fatal-error-on-launch-with-jdk-11-no-error-runs-ok-with-jdk-1-8/157944/14 "2019-01-31T17:54:55Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
