question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

Describe the bug Coming from the issue https://github.com/opensearch-project/opensearch-build/issues/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

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
prudhvigodithicommented, May 20, 2022

@reta ideally since this works node.roles=master, data (passing as environment variable) and sets right master and data role, setting node.roles= to empty value should allow to set the coordinating role.

May be supporting [] notation to denote empty value would make sense? yes setting environment variable node.roles=[] should also set as coordinating role, adding this logic would be better

0reactions
dblockcommented, May 23, 2022

I think @prudhvigodithi’s suggestion of supporting [] as a value is the simplest one. I’d want to see that PR before judging whether there are other side effects.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node | Elasticsearch Guide [8.5] | Elastic
If you take away the ability to be able to handle master duties, to hold data, and pre-process documents, then you are left...
Read more >
Cluster formation - OpenSearch documentation
OpenSearch can operate as a single-node or multi-node cluster. ... so to make this node a dedicated coordinating node, set node.roles to an...
Read more >
Failed to get snapshot - how to solve related issues - Opster
How to troubleshoot Elasticsearch/OpenSearch log "Failed to get snapshot" a detailed ... Coordinating nodes are nodes that do not hold any configured role....
Read more >
Troubleshooting kubeadm | Kubernetes
As with any program, you might run into an error installing or ... Not possible to join a v1.18 Node to a v1.17...
Read more >
Troubleshooting Amazon OpenSearch Service
A red cluster status means that at least one primary shard and its replicas are not allocated to a node. OpenSearch Service keeps...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found