Unable to connect using Spring Data library

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
OS 1.0.0
Spring Data OS 1.3.0

Describe the issue:
I’m getting a 400 response on application startup which makes it fail to do so.
The request being performed a HEAD request to check if an index exists, which is done on startup when declaring a OS Repository, which is what I expect. The index does not exist, but such response is docuemente as 404 response

Configuration:

Relevant Logs or Screenshots:

Caused by: org.springframework.data.elasticsearch.UncategorizedElasticsearchException: method [HEAD], host [http://vpc-search-trx-api-ufiwzrpmi5ng7nyd4tbbzu534q.us-east-1.es.amazonaws.com:443], URI [/transactions?ignore_throttled=false&ignore_unavailable=false&expand_wildcards=open%2Cclosed&allow_no_indices=false], status line [HTTP/1.1 400 Bad Request]

I was able to test the connection using ElasticSearchOperations, and perfoming the same requests, to check if the index exists, gave me a 200 response. Could this be related to an issue when starting up the repository? Is there a different behaviour when creating a Repository?

Let me know how can I contribute and help fix this!

Hi @germanflighel , could you please run the same URL using curl ? Wondering where the problem is …

Unfortunately, the endpoint is behind a VPC, and I’m not able to curl it. It is only accesible to the deployed applications. FYI, its using Kubernetes on EKS

Gotcha, I will try to reproduce the problem and get back to you

@germanflighel I am unfortunately unable to reproduce the issue using standalone Docker server (opensearchproject/opensearch:1.0.0) and Spring Data Opensearch 1.3.0. If you could reproduce the issue locally, please share the steps. Thank you.

I’ll try to do it, but I had some trouble doing so.
Just to give you an idea: Since the error is only happening when using the repository, my guess is that the setup of such beans might not use exactly the same configuration for requests as the ElasticSearchOperations object. Could this be the case?

Just to give you an idea: Since the error is only happening when using the repository, my guess is that the setup of such beans might not use exactly the same configuration for requests as the ElasticSearchOperations object. Could this be the case?

Apologies, I am not following what configuration you mean, the ElasticSearchOperations is provided by Spring Data OpenSearch for OpenSearch the same way it is provided by Spring Data Elasticsearch for Elasticsearch. The configuration (at large) is used to connect to the right cluster and it seems like you don’t have connection issues.