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] Getting error "error while sniffing nodes" while running docker compose opensearch #12431

Closed
lijie123bes opened this issue Feb 22, 2024 · 2 comments
Labels
bug Something isn't working Clients Clients within the Core repository such as High level Rest client and low level client untriaged

Comments

@lijie123bes
Copy link

Describe the bug

I am getting below error while using spring data opensearch. I am using docker compose to build the image:

2024-02-19T10:24:24.994Z ERROR 1 --- [nt_sniffer[T#1]] org.opensearch.client.sniff.Sniffer : error while sniffing nodes
os_project |
os_project | java.net.ConnectException: Connection refused
os_project | at org.opensearch.client.RestClient.extractAndWrapCause(RestClient.java:954) ~[opensearch-rest-client-2.11.0.jar:2.11.0]
os_project | at org.opensearch.client.RestClient.performRequest(RestClient.java:333) ~[opensearch-rest-client-2.11.0.jar:2.11.0]
os_project | at org.opensearch.client.RestClient.performRequest(RestClient.java:321) ~[opensearch-rest-client-2.11.0.jar:2.11.0]
os_project | at org.opensearch.client.sniff.OpenSearchNodesSniffer.sniff(OpenSearchNodesSniffer.java:122) ~[opensearch-rest-client-sniffer-2.11.0.jar:2.11.0]
os_project | at org.opensearch.client.sniff.Sniffer.sniff(Sniffer.java:223) ~[opensearch-rest-client-sniffer-2.11.0.jar:2.11.0]
os_project | at org.opensearch.client.sniff.Sniffer$Task.run(Sniffer.java:154) ~[opensearch-rest-client-sniffer-2.11.0.jar:2.11.0]
os_project | at org.opensearch.client.sniff.Sniffer$1.run(Sniffer.java:95) ~[opensearch-rest-client-sniffer-2.11.0.jar:2.11.0]
os_project | at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[na:na]
os_project | at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
os_project | at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[na:na]
os_project | at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[na:na]
os_project | at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]

os_project | 2024-02-19T10:24:25.182Z WARN 1 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchDataConfiguration$ReactiveRestClientConfiguration': Lookup method resolution failed
os_project | 2024-02-19T10:24:25.187Z INFO 1 --- [ main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'

Related component

Clients

To Reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

I want to run my springboot application with latest opensearch integration

Additional Details

Plugins
Please list all plugins currently enabled.

Screenshots
If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@lijie123bes lijie123bes added bug Something isn't working untriaged labels Feb 22, 2024
@github-actions github-actions bot added the Clients Clients within the Core repository such as High level Rest client and low level client label Feb 22, 2024
@tlfeng
Copy link
Collaborator

tlfeng commented Feb 27, 2024

Could you double check the OpenSearch cluster configuration in your code?
I searched for some similar problem, and saw that:

connection refused means that there is no cluster/server at the configured address

The error occurs in the very beginning step of the sniffer.

logger.error("error while sniffing nodes", e);

@peternied
Copy link
Member

[Triage - attendees 1 2 3 4 5]
@lijie123bes Thanks for filing this isssue - this looks related to the following issue [1], please use that issue/repository for follow up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Clients Clients within the Core repository such as High level Rest client and low level client untriaged
Projects
None yet
Development

No branches or pull requests

3 participants