-
Notifications
You must be signed in to change notification settings - Fork 222
[BUG] code works with local opensearch but not AOSS #1068
Description
What is the bug?
Using OpenSearchClient.get() to retrieve document. Works with a local opensearch (docker opensearch:2.13.0) but same code fails AOSS (amazon serverless) with 404.
How can one reproduce the bug?
Have example class that can be provided if this is the correct forum.
What is the expected behavior?
I except the same OpenSearchClient.get() to pass or fail independent of local opensearch or AOSS.
What is your host/environment?
Local: docker opensearch 2.13.0
AOSS: unknown
Do you have any screenshots?
No. Would not make sense without seeing the code. Here is the output from the test:
local: Index already exists so delete it first
local: Created the testing index
local: Found expected document
local: Found expected document
local: Test complete
aoss: Index already exists so delete it first
aoss: Created the testing index
aoss: Found expected document
Exception in thread "main" org.opensearch.client.opensearch._types.OpenSearchException: Request failed: [http_exception] server returned 404
at org.opensearch.client.transport.aws.AwsSdk2Transport.parseResponse(AwsSdk2Transport.java:498)
at org.opensearch.client.transport.aws.AwsSdk2Transport.executeSync(AwsSdk2Transport.java:396)
at org.opensearch.client.transport.aws.AwsSdk2Transport.performRequest(AwsSdk2Transport.java:193)
at org.opensearch.client.opensearch.OpenSearchClient.get(OpenSearchClient.java:737)
at example.ComparisonLocalVsServerless.doTest(ComparisonLocalVsServerless.java:110)
at example.ComparisonLocalVsServerless.main(ComparisonLocalVsServerless.java:79)
Do you have any additional context?
We use cognito to exchange general username/password for access keys. We then use a lambda to convert those keys to AWS credentials because Java SDK does (did not) support cognito at the time of our testing. This lookup is included in the test code.
It seems that the failure seems to be related to the local opensearch using httpclient5 while the AOSS uses httpclient. The document ID that cannot be found contains many : in its name, like a:b:c:d:e::1.0.