Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] BaseConnectionPool TypeError on 'http' ('publish_address' of undefined) #984

Open
jaco-smit opened this issue Feb 25, 2025 · 0 comments

Comments

@jaco-smit
Copy link
Contributor

jaco-smit commented Feb 25, 2025

What is the bug?

It looks like the property http is expected to be present at all times if you enable sniffing, but for some reason it is not there. My best guess is that it is due to the nodes not being available yet.
We are getting the following error:

“TypeError: Cannot read properties of undefined (reading ‘publish_address’)”,
   “ at ConnectionPool.nodesToHost (/opt/nodejs/node_modules/@opensearch-project/opensearch/lib/pool/BaseConnectionPool.js:232:31)”,“ at /opt/nodejs/node_modules/@opensearch-project/opensearch/lib/Transport.js:589:41”,
  “ at onBody (/opt/nodejs/node_modules/@opensearch-project/opensearch/lib/Transport.js:435:9)”,
  “ at IncomingMessage.onEnd (/opt/nodejs/node_modules/@opensearch-project/opensearch/lib/Transport.js:341:11)”

How can one reproduce the bug?

  1. Connect to the existing cluster from the node js client
  2. Onboard a new node to the cluster
  3. After some seconds the node js client will throw an error and the script will crash

What is the expected behavior?

The undefined error should not happen

What is your host/environment?

Running this on AWS Opensearch 1.0 and also Elasticsearch 7.1.

Do you have any screenshots?

Logs pasted above.

Do you have any additional context?

This was fixed in the elasticsearch client here: elastic/elasticsearch-js@9856dfc

I checked the code and seems like this guardrail is not in place here. This should just be a copy of the fix they made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants