Skip to content

[BUG] OpenSearch app is not able to pick up empty node.roles= environment variable to run as coordinating node. #3412

Closed
@prudhvigodithi

Description

@prudhvigodithi

Describe the bug
Coming from the issue opensearch-project/opensearch-build#2129, OpenSearch app is not able to pick up empty node.roles= environment values, to allow to run as coordinating node. This works fine when added to opensearch.yml as node.roles: [], but not able to pick when passed as environment variable. However when passed a specific role as node.roles=master OpenSearch app is able to pick up and pass the role as master.

docker run -e 'node.roles=master,data' opensearchproject/opensearch:1.3.2 |grep role
[2022-05-20T01:31:30,027][INFO ][o.o.n.Node               ] [9a683cb05664] node name [9a683cb05664], node ID [vgu0pnrgQRytmfj2ZC6siw], cluster name [docker-cluster], roles [master, data]

As per the document https://opensearch.org/docs/latest/opensearch/cluster/, passing empty listnode.roles: [] should allow the node to run with coordinating role.

To Reproduce

docker run -e 'node.roles=' opensearchproject/opensearch:1.3.2 |grep role
[2022-05-20T01:26:25,169][INFO ][o.o.n.Node               ] [5e7b9fa617b3] node name [5e7b9fa617b3], node ID [pEkc98u4Q-SdZLr4ojZ-QQ], cluster name [docker-cluster], roles [master, remote_cluster_client, data, ingest]
docker run -e 'node.roles=[]' opensearchproject/opensearch:1.3.2 |grep role
uncaught exception in thread [main]
org.opensearch.bootstrap.StartupException: java.lang.IllegalArgumentException: unknown role [[]]
Caused by: java.lang.IllegalArgumentException: unknown role [[]]
java.lang.IllegalArgumentException: unknown role [[]]
docker run -e 'node.roles=" "' opensearchproject/opensearch:1.3.2 |grep role
uncaught exception in thread [main]
org.opensearch.bootstrap.StartupException: java.lang.IllegalArgumentException: unknown role [" "]
Caused by: java.lang.IllegalArgumentException: unknown role [" "]
java.lang.IllegalArgumentException: unknown role [" "]

Expected behavior
docker run -e 'node.roles=' should allow to run the node as coordinating node.

Host/Environment (please complete the following information):

  • OS: docker

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    >breakingIdentifies a breaking change.bugSomething isn't workingv3.0.0Issues and PRs related to version 3.0.0

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions