Skip to content

[Bug] ES 7.10 cannot pass environment variable to setup a coordinating only node #65577

@kunisen

Description

@kunisen

Elasticsearch version (bin/elasticsearch --version):

ES 7.10

Plugins installed:

N/A

JVM version (java -version):

Bundled JDK

OS version (uname -a if on a Unix-like system):

MacOS

Description of the problem including expected versus actual behavior:

I have this setting.
I want to pass $ENV_VAR to start it as coordinate only node.

node.roles: ${ENV_VAR}

When I set $ENV_VAR to "", I get node start with full set of roles.

$ curl localhost:9200/_cat/nodes
127.0.0.1 31 100 29 2.23   cdhilmrstw * senmac

When I set $ENV_VAR to " " (with one space inside), I get this error message.

java.lang.IllegalArgumentException: unknown role []

When I set $ENV_VAR to [], I get this error message.

java.lang.IllegalArgumentException: unknown role [[]]

Even if I don't set ENV_VAR (I used an undefined env I_DIDNOT_SET_THIS_ENV), I will also get error.

Exception in thread "main" java.lang.IllegalArgumentException: Could not resolve placeholder 'I_DIDNOT_SET_THIS_ENV'

Steps to reproduce:

  1. Download ES 7.10
  2. Set environment variable and put it to node.roles in elasticsearch.yml
  3. Start ES

Provide logs (if relevant):

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions