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

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:

[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?

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.

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:

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

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.

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