# Elasticsearch is failing to start on Docker since 7.13

**URL:** <https://discuss.elastic.co/t/elasticsearch-is-failing-to-start-on-docker-since-7-13/282546>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [August 26, 2021, 7:56am UTC](https://discuss.elastic.co/t/elasticsearch-is-failing-to-start-on-docker-since-7-13/282546 "2021-08-26T07:56:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![widhalmt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/widhalmt/32/8237_2.png) [@widhalmt](https://discuss.elastic.co/u/widhalmt)\
**Post date:** [August 26, 2021, 7:56am UTC](https://discuss.elastic.co/t/elasticsearch-is-failing-to-start-on-docker-since-7-13/282546/1 "2021-08-26T07:56:06Z")

</div>

Hi,

I'm seeing problems to start Elasticsearch in Docker containers since 7.13. I can't find anything related in the release notes or breaking changes.

Background: I'm using custom roles to install and handle Elasticsearch search and they usually work like a charm. My problem ist, I'm using Molecule to test the roles and these tests break since 7.13 is available (same with 7.14).

For those unfamiliar with Molecule: It's a simple and powerful way to test Ansible roles. Molecule fires up a Container and uses the role to configure the container like it was a real host (in this case an Elasticsearch node). It has some peculiarities, especially when it comes to testing systemd services but I'm quite confident I found a way around these.

Why I'm asking is, that Elasticseach is failing with `Error: Could not find or load main class [0.001s][warning][os,container]`. When I seach for that error I find threads about running Elasticsearch on Windows or from custom installations from tarballs with broken `$JAVA_HOME` from times where Elasticsearch didn't bring it's own JRE.

Here's the full output:

```auto
  TASK [ansible-role-elasticsearch : Show logs] **********************************
  ok: [elasticsearch_default] => {
      "es_output.stdout_lines": [
          "● elasticsearch.service - Elasticsearch",
          " Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: disabled)",
          " Active: failed (Result: exit-code) since Wed 2021-08-25 17:17:04 UTC; 1s ago",
          " Docs: https://www.elastic.co",
          " Process: 2065 ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)",
          " Main PID: 2065 (code=exited, status=1/FAILURE)",
          "",
  Warning: Aug 25 17:17:02 elasticsearch_default systemd-entrypoint[2065]: [0.001s][warning][os,container] Duplicate cpuset controllers detected. Picking /sys/fs/cgroup/cpuset, skipping /sys/fs/cgroup/cpuset.",
  Warning: Aug 25 17:17:02 elasticsearch_default systemd-entrypoint[2065]: [0.001s][warning][os,container] Duplicate cpuset controllers detected. Picking /sys/fs/cgroup/cpuset, skipping /sys/fs/cgroup/cpuset.",
  Warning: Aug 25 17:17:03 elasticsearch_default systemd-entrypoint[2065]: [0.001s][warning][os,container] Duplicate cpuset controllers detected. Picking /sys/fs/cgroup/cpuset, skipping /sys/fs/cgroup/cpuset.",
  Warning: Aug 25 17:17:03 elasticsearch_default systemd-entrypoint[2065]: [0.001s][warning][os,container] Duplicate cpuset controllers detected. Picking /sys/fs/cgroup/cpuset, skipping /sys/fs/cgroup/cpuset.",
  Warning: Aug 25 17:17:04 elasticsearch_default systemd-entrypoint[2065]: Error: Could not find or load main class [0.001s][warning][os,container]",
  Warning: Aug 25 17:17:04 elasticsearch_default systemd-entrypoint[2065]: Caused by: java.lang.ClassNotFoundException: [0/001s][warning][os,container]",
          "Aug 25 17:17:04 elasticsearch_default systemd[1]: elasticsearch.service: main process exited, code=exited, status=1/FAILURE",
          "Aug 25 17:17:04 elasticsearch_default systemd[1]: Failed to start Elasticsearch.",
          "Aug 25 17:17:04 elasticsearch_default systemd[1]: Unit elasticsearch.service entered failed state.",
          "Aug 25 17:17:04 elasticsearch_default systemd[1]: elasticsearch.service failed."
      ]
  }

```

If you want to have a look at the details, the repository where I'm trying to work around that is on [GitHub](https://github.com/NETWAYS/ansible-role-elasticsearch/runs/3424655620) . Please don't mind all the weird output tasks I added but my problem is that the role works on VMs or "real" hosts but fails only within this setup.

Cheers,  
Thomas

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 29, 2021, 11:46pm UTC](https://discuss.elastic.co/t/elasticsearch-is-failing-to-start-on-docker-since-7-13/282546/2 "2021-08-29T23:46:30Z")

</div>

Can you grab the actual logs from the Elasticsearch process from the container?

---

<div class="post-metadata">

**Author:** ![widhalmt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/widhalmt/32/8237_2.png) [@widhalmt](https://discuss.elastic.co/u/widhalmt)\
**Post date:** [August 30, 2021, 8:05am UTC](https://discuss.elastic.co/t/elasticsearch-is-failing-to-start-on-docker-since-7-13/282546/3 "2021-08-30T08:05:48Z")

</div>

Not easily. I'll try. The problem is, Molecule is starting the container and the service. And when it fails, it destroys the container right after. With this setup, the container runs on a runner at GitHub, so no shell access.

I know, I could run it locally but I had some issues with that. I'll try and come back.

---

<div class="post-metadata">

**Author:** ![widhalmt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/widhalmt/32/8237_2.png) [@widhalmt](https://discuss.elastic.co/u/widhalmt)\
**Post date:** [August 30, 2021, 12:32pm UTC](https://discuss.elastic.co/t/elasticsearch-is-failing-to-start-on-docker-since-7-13/282546/4 "2021-08-30T12:32:17Z")

</div>

I changed the tasks and I can tell you the following new information:

- `elasticsearch.log` is empty
- The whole role works when I switch from `elasticsearch` to `elasticsearach-oss` (I'm running tests for both versions and with the same code, just changing to the OSS variant makes the role work

(Of course I'm not just changing the package name but the repository, too 😉 )

---

<div class="post-metadata">

**Author:** ![widhalmt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/widhalmt/32/8237_2.png) [@widhalmt](https://discuss.elastic.co/u/widhalmt)\
**Post date:** [August 30, 2021, 8:09pm UTC](https://discuss.elastic.co/t/elasticsearch-is-failing-to-start-on-docker-since-7-13/282546/5 "2021-08-30T20:09:04Z")

</div>

Sorry. The OSS version working was just me not realizing that, if you install the latest `elasticsearch-oss` package you get `7.10`. So it's still `7.13` not working, earlier versions working.

---

<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:** [September 27, 2021, 8:10pm UTC](https://discuss.elastic.co/t/elasticsearch-is-failing-to-start-on-docker-since-7-13/282546/6 "2021-09-27T20:10:04Z")

</div>

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