Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Elasticsearch Version 5.1.2 Fails to Start because of the xpack.ml.enabled setting #406

Closed
bowlesns opened this issue Dec 19, 2017 · 3 comments
Assignees

Comments

@bowlesns
Copy link

bowlesns commented Dec 19, 2017

Elasticsearch version
5.1.2

Role version
Master

JVM version
1.8.0_151

OS version
Darwin Kernel Version 15.6.0

Description of the problem including expected versus actual behavior
When attempting to start Elasticsearch from the Ansible playbook, startup fails because of the below error. It appears the elasticsearch.yml.j2 tries to set xpack.ml.enabled to false, but because the machine learning plugin wasn't present in earlier versions, the startup fails because of the unknown setting. Removing the following entry from /templates/elasticsearch.yml.j2 allows for successful startup.

{% if not "ml" in es_xpack_features %}
xpack.ml.enabled: false
{% endif %}

I'm guessing there needs to be a way for that setting to be set conditionally upon if the es_version is 5.4 or greater and that would allow the playbook to successfully execute and start Elasticsearch with xpack on earlier versions.

Playbook (removed IP addresses)

  • hosts: es-master
    user: ubuntu
    become: true
    roles:
    • role: elastic.elasticsearch
      es_instance_name: "{{inventory_hostname}}"
      es_heap_size: "25g"
      es_version: 5.1.2
      es_enable_xpack: true
      es_xpack_license: "{{ lookup('file', 'files/' + 'esXpackLicense.json') }}"
      es_api_basic_auth_username: es_admin
      es_api_basic_auth_password: password123
      es_api_host: xx.x.x.xxx
      es_api_port: 9200
      es_config:
      cluster.name: "elasticsearch"
      discovery.zen.ping.unicast.hosts:
      - xx.x.x.xxx:9300
      http.port: 9200
      transport.tcp.port: 9300
      node.data: false
      node.master: true
      bootstrap.memory_lock: false
      network.host: 0.0.0.0
      es_xpack_features:
      • security
      • alerting
        es_message_auth_file: system_key
        es_users:
        file:
        es_admin:
        password: password123
        roles:
        - admin
        es_roles:
        file:
        admin:
        cluster:
        - all
        indices:
        - names: '*'
        privileges:
        - all

Provide logs from Ansible:
Playbook times out on the
TASK [elastic.elasticsearch : Wait for elasticsearch to startup] step.

ES Log
[2017-12-19T00:25:00,138][ERROR][o.e.b.Bootstrap ] Exception
java.lang.IllegalArgumentException: unknown setting [xpack.ml.enabled] did you mean [xpack.graph.enabled]?
at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:278) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:246) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.common.settings.SettingsModule.(SettingsModule.java:138) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.node.Node.(Node.java:325) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.node.Node.(Node.java:229) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Bootstrap$6.(Bootstrap.java:214) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:214) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:306) [elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) [elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) [elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54) [elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) [elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.cli.Command.main(Command.java:88) [elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:89) [elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:82) [elasticsearch-5.1.2.jar:5.1.2]

[2017-12-19T00:25:00,142][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [x.x.x.xxxx-Node-x.x.x.xxxx] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: unknown setting [xpack.ml.enabled] did you mean [xpack.graph.enabled]?
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:125) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.cli.Command.main(Command.java:88) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:89) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:82) ~[elasticsearch-5.1.2.jar:5.1.2]
Caused by: java.lang.IllegalArgumentException: unknown setting [xpack.ml.enabled] did you mean [xpack.graph.enabled]?
at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:278) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:246) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.common.settings.SettingsModule.(SettingsModule.java:138) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.node.Node.(Node.java:325) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.node.Node.(Node.java:229) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Bootstrap$6.(Bootstrap.java:214) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:214) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:306) ~[elasticsearch-5.1.2.jar:5.1.2]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-5.1.2.jar:5.1.2]

@pemontto
Copy link
Contributor

pemontto commented Jan 2, 2018

You'll want to use version_compare, something like es_version | version_compare('5.4', '>')

@jmlrt jmlrt self-assigned this May 29, 2019
@jmlrt
Copy link
Member

jmlrt commented May 29, 2019

I think this should be fixed by #560

@jmlrt jmlrt closed this as completed May 29, 2019
@jmlrt jmlrt reopened this May 29, 2019
@jmlrt
Copy link
Member

jmlrt commented May 29, 2019

I'm closing the issue, don't hesitate to reopen it if you have any question.

@jmlrt jmlrt closed this as completed May 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants