ES 6.8.2 on Mac OS 14.0.6 and Java JDK 12.0.2 ERROR

I installed on my Mac OS 14.0.6 Elasticsearch with brew. It must be ES V 6 - not 7. But I tied to install 7 too - same error. So must be problem with the jdk? After installation was running well, I start with command elasticsearch and I get the following error in console:

JAVA VERSION: java -version java version "12.0.2" 2019-07-16 Java(TM) SE Runtime Environment (build 12.0.2+10) Java HotSpot(TM) 64-Bit Server VM (build 12.0.2+10, mixed mode, sharing)

2019-08-19 20:19:13,173 main ERROR Unable to locate plugin type for ESJsonLayout
2019-08-19 20:19:13,173 main ERROR Unable to locate plugin type for ESJsonLayout
2019-08-19 20:19:13,174 main ERROR Unable to locate plugin type for ESJsonLayout
2019-08-19 20:19:13,202 main ERROR Unable to locate plugin for ESJsonLayout
2019-08-19 20:19:13,219 main ERROR Could not create plugin of type class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFile: java.lang.NullPointerException java.lang.NullPointerException
at org.apache.logging.log4j.core.config.plugins.visitors.PluginElementVisitor.findNamedNode(PluginElementVisitor.java:103)
at org.apache.logging.log4j.core.config.plugins.visitors.PluginElementVisitor.visit(PluginElementVisitor.java:87)
at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.injectFields(PluginBuilder.java:181)
at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:122)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:959)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:899)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:891)
at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:514)
at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:238)
at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:250)
at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:547)
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:263)
at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:234)
at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:127)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:302)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)
at org.elasticsearch.cli.Command.main(Command.java:90)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93)

2019-08-19 20:19:13,222 main ERROR Unable to invoke factory method in class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFile: java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.RollingFileAppender java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.RollingFileAppender
.......and on .... ```

I tried different reinstalls, but nothing works. Some help will be nice.

Hey,

can you check /usr/local/etc/elasticsearch - is it possible, that you have mixed configuration files in there (some are suffixed with .default) from several versions? one possibility would be to remove your elasticsearch brew, then remove that config directory and install your desired version again or to sort those configurations out manually, in case you did any changes.

--Alex

O.K. - was working. But now I get the error:

OpenJDK 64-Bit Server VM warning: Cannot open file logs/gc.log due to No such file or directory

I was reading for win to create the log folder manually - must I do this on Mac ox too? If yes, where?

this looks to me as if there are still old files lingering around. Did you delete the whole folder or just some files? Can you run grep gc.log /usr/local/etc/elasticsearch -r and paste the output?

/usr/local/etc/elasticsearch/jvm.options:8:-Xloggc:logs/gc.log
/usr/local/etc/elasticsearch/jvm.options:9-:-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m

try replacing those with

8:-Xloggc:/usr/local/var/log/elasticsearch/gc.log
9-:-Xlog:gc*,gc+age=trace,safepoint:file=/usr/local/var/log/elasticsearch/gc.log:utctime,pid,tags:filecount=32,filesize=64m

This is from my local config (even though that is a 7.x version).

so fare no log error.
but still this:

elasticsearch

[2019-08-20T16:40:03,461][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [unknown] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: ElasticsearchException[java.io.IOException: failed to read [id:6, file:/usr/local/var/lib/elasticsearch/nodes/0/_state/node-6.st]]; nested: IOException[failed to read [id:6, file:/usr/local/var/lib/elasticsearch/nodes/0/_state/node-6.st]]; nested: XContentParseException[[-1:36] [node_meta_data] unknown field [node_version], parser not found];
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:163) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.8.2.jar:6.8.2]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) ~[elasticsearch-6.8.2.jar:6.8.2]
Caused by: org.elasticsearch.ElasticsearchException: java.io.IOException: failed to read [id:6, file:/usr/local/var/lib/elasticsearch/nodes/0/_state/node-6.st]
at org.elasticsearch.ExceptionsHelper.maybeThrowRuntimeAndSuppress(ExceptionsHelper.java:165) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.gateway.MetaDataStateFormat.loadLatestStateWithGeneration(MetaDataStateFormat.java:306) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.gateway.MetaDataStateFormat.loadLatestState(MetaDataStateFormat.java:324) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.env.NodeEnvironment.loadOrCreateNodeMetaData(NodeEnvironment.java:417) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:305) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.node.Node.(Node.java:296) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.node.Node.(Node.java:266) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:212) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:212) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.8.2.jar:6.8.2]
... 6 more
Caused by: java.io.IOException: failed to read [id:6, file:/usr/local/var/lib/elasticsearch/nodes/0/_state/node-6.st]
at org.elasticsearch.gateway.MetaDataStateFormat.loadLatestStateWithGeneration(MetaDataStateFormat.java:300) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.gateway.MetaDataStateFormat.loadLatestState(MetaDataStateFormat.java:324) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.env.NodeEnvironment.loadOrCreateNodeMetaData(NodeEnvironment.java:417) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:305) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.node.Node.(Node.java:296) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.node.Node.(Node.java:266) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:212) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:212) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.8.2.jar:6.8.2]
... 6 more
Caused by: org.elasticsearch.common.xcontent.XContentParseException: [-1:36] [node_meta_data] unknown field [node_version], parser not found
at org.elasticsearch.common.xcontent.ObjectParser.getParser(ObjectParser.java:369) ~[elasticsearch-x-content-6.8.2.jar:6.8.2]
at org.elasticsearch.common.xcontent.ObjectParser.parse(ObjectParser.java:158) ~[elasticsearch-x-content-6.8.2.jar:6.8.2]
at org.elasticsearch.common.xcontent.ObjectParser.apply(ObjectParser.java:182) ~[elasticsearch-x-content-6.8.2.jar:6.8.2]
at org.elasticsearch.env.NodeMetaData$1.fromXContent(NodeMetaData.java:110) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.env.NodeMetaData$1.fromXContent(NodeMetaData.java:94) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.gateway.MetaDataStateFormat.read(MetaDataStateFormat.java:197) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.gateway.MetaDataStateFormat.loadLatestStateWithGeneration(MetaDataStateFormat.java:296) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.gateway.MetaDataStateFormat.loadLatestState(MetaDataStateFormat.java:324) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.env.NodeEnvironment.loadOrCreateNodeMetaData(NodeEnvironment.java:417) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:305) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.node.Node.(Node.java:296) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.node.Node.(Node.java:266) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:212) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:212) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.8.2.jar:6.8.2]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.8.2.jar:6.8.2]
... 6 more

is it possible, that you already ran another, newer or older version of elasticsearch on that system? Like 7.x or 2.x? If so, you might just delete your data directory in /usr/local/var/lib/elasticsearch/ (which might mean dataloss from previous runs) or configure another cluster name.

--Alex

No. I did fresh installation on Mac. I also deleted the folder - or all folders - to try new installation. I get the error. I can not get it run.
Your code before was fixing the log problem. But the rest still there.

have you deleted the above data folder before trying to start elasticsearch? You said you deleted 'all folders'. can you be more specific?

After it was not working, I removed with brew and then I deleted all folders I found with name Elasticsearch and tried to install again.

can you be more specific which ones and its locations?

usr/local/etc/elasticsearch

and

usr/local/var/elasticsearch

but its was same already before and also just now I reinstalled ES - same error.

the data path is /usr/local/var/lib/elasticsearch on my osx system

1 Like

there is nothing on my mac. I guess there is something wrong with the brew installation. Is there a way to clean up and install different way?

Just now i installed the same way on different mac mojave. And same issues. I changed the 8 and 9 and get now the same warning message.

I guess i have to brew remove all this and install different way

Or can this be Anproben with MAMP Pro?

OK - I found the solution. I removed all Elasticsearch files - total cleanup. Than I shut down the MAMP PRO server and installed with brew fresh. Than I start my MAMP PRO server. All fine. Nothing to change or do. Looks like if there is the MAMP PRO Server running in the installation process, its creating incorrect path or files.

glad you found the culprit. can you explain what MAMP pro is, and why is it tinkering with ES? I'd be curious to know for the future.

Its a local developing solution. It creates apache, mysql and on on your machine.
https://www.mamp.info/en/mamp-pro/
I was reading in some stackoverflow questions about this. Guess the virtual server is the problem? I don't know...