# org.elasticsearch.bootstrap.StartupException: ElasticsearchException \[Failure running machine learning native code

**URL:** https://discuss.elastic.co/t/org-elasticsearch-bootstrap-startupexception-elasticsearchexception-failure-running-machine-learning-native-code/280865
**Category:** Elasticsearch
**Tags:** elastic-stack-machine-learning
**Created:** [August 10, 2021, 4:13am UTC](https://discuss.elastic.co/t/org-elasticsearch-bootstrap-startupexception-elasticsearchexception-failure-running-machine-learning-native-code/280865 "2021-08-10T04:13:08Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Logenleedev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/logenleedev/32/92731_2.png) [@Logenleedev](https://discuss.elastic.co/u/Logenleedev)
#### Post date: [August 10, 2021, 4:13am UTC](https://discuss.elastic.co/t/org-elasticsearch-bootstrap-startupexception-elasticsearchexception-failure-running-machine-learning-native-code/280865/1 "2021-08-10T04:13:08Z")

</div>

Hi I am new to elastic search. Currently, I am doing a project that requires machine learning functionality in elasticsearch. Here is the error I get:

```auto
[2021-08-10T12:09:08,266][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [JiatongLee] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: ElasticsearchException[Failure running machine learning native code. This could be due to running on an unsupported OS or distribution, missing OS libraries, or a problem with the temp directory. To bypass this problem by running Elasticsearch without machine learning functionality set [xpack.ml.enabled: false].]
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:174) ~[elasticsearch-7.8.0.jar:7.8.0]
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161) ~[elasticsearch-7.8.0.jar:7.8.0]
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-7.8.0.jar:7.8.0]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127) ~[elasticsearch-cli-7.8.0.jar:7.8.0]
	at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-7.8.0.jar:7.8.0]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126) ~[elasticsearch-7.8.0.jar:7.8.0]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-7.8.0.jar:7.8.0]
Caused by: org.elasticsearch.ElasticsearchException: Failure running machine learning native code. This could be due to running on an unsupported OS or distribution, missing OS libraries, or a problem with the temp directory. To bypass this problem by running Elasticsearch without machine learning functionality set [xpack.ml.enabled: false].
	at org.elasticsearch.xpack.ml.MachineLearning.createComponents(MachineLearning.java:618) ~[?:?]
	at org.elasticsearch.node.Node.lambda$new$11(Node.java:484) ~[elasticsearch-7.8.0.jar:7.8.0]
	at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:271) ~[?:?]
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1621) ~[?:?]
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[?:?]
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[?:?]
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) ~[?:?]
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) ~[?:?]
	at org.elasticsearch.node.Node.<init>(Node.java:488) ~[elasticsearch-7.8.0.jar:7.8.0]
	at org.elasticsearch.node.Node.<init>(Node.java:266) ~[elasticsearch-7.8.0.jar:7.8.0]
	at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:227) ~[elasticsearch-7.8.0.jar:7.8.0]
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:227) ~[elasticsearch-7.8.0.jar:7.8.0]
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393) ~[elasticsearch-7.8.0.jar:7.8.0]
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) ~[elasticsearch-7.8.0.jar:7.8.0]

```

Does anyone know how to resolve it?

---

<div class="post-metadata">

### Author: ![droberts195](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/droberts195/32/17692_2.png) [@droberts195](https://discuss.elastic.co/u/droberts195)
#### Post date: [August 10, 2021, 9:19am UTC](https://discuss.elastic.co/t/org-elasticsearch-bootstrap-startupexception-elasticsearchexception-failure-running-machine-learning-native-code/280865/2 "2021-08-10T09:19:38Z")

</div>

It could be due to running on an unsupported OS or distribution, missing OS libraries, or a problem with the temp directory.

What OS are you running on?

If you do not want to spend any time on troubleshooting then you can run Elasticsearch without machine learning functionality by setting `xpack.ml.enabled: false` in your `elasticsearch.yml`.

---

<div class="post-metadata">

### Author: ![Logenleedev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/logenleedev/32/92731_2.png) [@Logenleedev](https://discuss.elastic.co/u/Logenleedev)
#### Post date: [August 10, 2021, 10:10am UTC](https://discuss.elastic.co/t/org-elasticsearch-bootstrap-startupexception-elasticsearchexception-failure-running-machine-learning-native-code/280865/4 "2021-08-10T10:10:06Z")

</div>

In terms of your suggestions, I actually tried `xpack.ml.enabled: false ` before. Although the error no longer exist, the project I work on actually needs the machin learning functionality. So I guess we have to figure out another way to make it work.

Here is my system config:

```auto
Hardware Overview:

  Model Name:	MacBook Pro
  Model Identifier:	MacBookPro16,1
  Processor Name:	6-Core Intel Core i7
  Processor Speed:	2.6 GHz
  Number of Processors:	1
  Total Number of Cores:	6
  L2 Cache (per Core):	256 KB
  L3 Cache:	12 MB
  Hyper-Threading Technology:	Enabled
  Memory:	16 GB
  System Firmware Version:	1554.120.19.0.0 (iBridge: 18.16.14663.0.0,0)
  Serial Number (system):	C02ZQ9F9MD6M
  Hardware UUID:	6439B42E-BDFE-5A81-AE7F-ABB8452BCDCF
  Provisioning UDID:	6439B42E-BDFE-5A81-AE7F-ABB8452BCDCF
  Activation Lock Status:	Enabled

```

---

<div class="post-metadata">

### Author: ![droberts195](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/droberts195/32/17692_2.png) [@droberts195](https://discuss.elastic.co/u/droberts195)
#### Post date: [August 10, 2021, 11:11am UTC](https://discuss.elastic.co/t/org-elasticsearch-bootstrap-startupexception-elasticsearchexception-failure-running-machine-learning-native-code/280865/5 "2021-08-10T11:11:05Z")

</div>

Oh, you're on a Mac.

I suspect this may be something related to Apple's notarization requirements - any program downloaded from the internet that's not signed by Apple will be instantly killed when it runs.

If that's the problem you can try this from the top level of the install:

`find . -exec xattr -d com.apple.quarantine '{}' ';'`

That will remove the attribute that remembers that the install was downloaded from the internet.

If that doesn't fix it, try `find . -name autodetect` from the top level of your install, then change to the directory where the `autodetect` program is found and run `./autodetect --version`. Does that print the version or crash with some OS error? If it crashes then the error will give a good idea what to do next.

---

<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 7, 2021, 11:11am UTC](https://discuss.elastic.co/t/org-elasticsearch-bootstrap-startupexception-elasticsearchexception-failure-running-machine-learning-native-code/280865/6 "2021-09-07T11:11:41Z")

</div>

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