-
Notifications
You must be signed in to change notification settings - Fork 187
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] code works with local opensearch but not AOSS #1068
Comments
OpenSearch has a concept of refresh, but AOSS doesn't support that. You have to wait for a refresh cycle to complete to make the document searchable. To test, add a I am going to close this as I'm 99% sure this is not a client problem and the document ID is a red herring, but if you can show that it works with |
Hi @dblock , I am a colleague of @al-niessner who is working part-time for a couple of weeks. The sleep accounts for the issue that we are experiencing, but once being set aside, by adding sleep or by pushing the documents and getting them in different commands, we are still having the issue. What sounds to be the cause of the issue is the special characters that we are having in our OpenSearch document identifiers, for example I am guessing the reason why it does not work with the OpenSearch serverless AOSS but works with a local OpenSearch might be the underlying HTTP transport (AwsSdk2Transport) objects that are only used for AOSS connection. Could you re-open this bug since the issue related to the refresh is not the one we want to resolve here. |
Ok, I'll reopen. Help narrow it down? Show the underlying HTTP request/responses being made by the client? |
Thanks @dblock. Unfortunately we don t have the logs activated on our opensearch serverless. I will see how that can be done and I ´ll get back to you. |
I mean client-side logs of which actual HTTPs requests / responses are made. In https://github.com/dblock/opensearch-java-client-demo/ I have an example where you can turn on DEBUG wire logging and you'll see all the transport messages.
|
Hello, we also have the same issue. The bug appears to be in
|
@workmanw A (failing) unit test and maybe a fix would be great. |
…ct#1068) Signed-off-by: Wesley Workman <[email protected]>
@dblock I didn't see any existing test support for using
|
Yep, we have #503. Could use any help you can spare! |
Hi @dblock , Sorry for the delay, I was able to add the logs you asked for. Our test script is getting that:
|
Hello, any updates on that issue ? On my side I made a test with the Delete request and we are having the same 404 error. I tested this piece of code:
And I am getting similar errors as the one given for the
We have a workaround for the Thanks |
This could be related, #827. Someone still needs to debug, narrow this down to an incorrect request being made, and fix the issue. I can't promise to get to it quickly. |
FWIW I have debugged this already. Apologies if I wasn't clear above, the problem is that If you look here: ApacheHttpClient5Transport.java you'll see an exception handler for Notice that that is missing from AwsSdk2Transport.java. So I would be happy to fix this issue if you would accept it as having an integration test instead of a unit test. I would be happy to try to write a unit test, but to be honest I don't have to expertise to take on a large test refactor like you mentioned with #503. |
@workmanw Yes, would definitely merge with just the integration test. |
Signed-off-by: Wesley Workman <[email protected]>
Signed-off-by: Wesley Workman <[email protected]>
Signed-off-by: Wesley Workman <[email protected]>
Signed-off-by: Wesley Workman <[email protected]>
Signed-off-by: Wesley Workman <[email protected]>
Signed-off-by: Wesley Workman <[email protected]>
Signed-off-by: Wesley Workman <[email protected]>
Signed-off-by: Wesley Workman <[email protected]> (cherry picked from commit 5ec233d) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
(cherry picked from commit 5ec233d) Signed-off-by: Wesley Workman <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
I think this issue can be closed now. Happy searching! |
@workmanw is there a specific version or SNAPSHOT we should be using to get these latest updates? |
What maven artifact will contain these changes?
…On Wed, Jul 17, 2024, 08:38 Daniel (dB.) Doubrovkine < ***@***.***> wrote:
Closed #1068
<#1068> as
completed.
—
Reply to this email directly, view it on GitHub
<#1068 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIUBIU6UEDZZCQWMTE5KIDZMZXWTAVCNFSM6AAAAABKNSH3JCVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJTGUZTMOJXGE4TONY>
.
You are receiving this because you were mentioned.Message ID:
<opensearch-project/opensearch-java/issue/1068/issue_event/13536971977@
github.com>
|
👋 @jordanpadams @al-niessner I'm not sure, I'm just a consumer of of OpenSearch like you all. I can poke around and see if there are snapshot artifacts that get published anywhere. At Zillow we have our own artifactory instance and I just published a local build there for the time being. |
Released builds go to https://mvnrepository.com/artifact/org.opensearch.client/opensearch-java and daily SNAPSHOTS go to https://aws.oss.sonatype.org/content/repositories/snapshots/org/opensearch/client/opensearch-java/, so 2.11-SNAPSHOT should be good. I include it in a pom here as an example. However, looks like the snapshot publication has been intermittently failing, so I am not sure this particular change made it yet, would grok through these builds and see if there's a successful one after the backport into the 2.x branch. I'd appreciate if someone trying this out could add a section to DEVELOPER_GUIDE or expand https://github.com/opensearch-project/opensearch-java/blob/main/README.md#snapshot-builds on how to use SNAPSHOT builds and where they are per above. |
Thanks very much @workmanw I was able to test the latest code with our failing cases on @dblock, for integrating the latest code in our maven project, I manually build the opensearch-java jar with For the code to work though, I had to add 2 additional dependencies of opensearch-java which were missing in your proposed pom:
I guess you should add them somewhere on your side. At last, Ideally, we would like to have a stable version of opensearch-java with the fix to integrate in our own tool stable version. But I guess you will start solving the issue with the SNAPSHOT publication. Thanks, Thomas |
@tloubrieu-jpl Awesome. Thanks for confirming it's fixed 🎉 |
@tloubrieu-jpl open an issue to get a release for v. next, we’ll get on it |
On the #1093 ticket we are discussing the fact that the bug was fixed on Do the integration tests run successfully on this branch ? |
@tloubrieu-jpl Everything is possible, please help dig. @Xtansia or I will also do the same shortly. |
@tloubrieu-jpl I think the difference in behaviour you're experiencing between |
@Xtansia is this a bug/unexpected? |
Thanks @Xtansia , @dblock , our bug was indeed related to the presence of ':' in the document IDs. So do you mean, for me to better understand:
This bug is critical for our usage of the library. If this can not be fixed within a few days in a stable version 2.x, we might look into using the main branch. Do you have 3.x release candidates that we could use ? Thanks |
The fact that this works on main and does not work on 2.x branch means one of the branches has a bug and doesn't have a test for the bug. #1012 was backported to 2.x so the code should be the same in both branches. I am guessing there's a bug in 2.x that doesn't exist in main. The best way to find out is to write a failing test that mimics your scenario and contribute it to the 2.x branch @tloubrieu-jpl and ensure it passes on main. Want to give it a shot? |
I tried to make it clear in the original statement for this ticket that the difference between localhost and AOSS is httpclient5 and that it does a "better" job at handling the URLs as given. httpclient (4 I guess) requires a lot more help with the URL encoding. I just wrote a test using ':' in PathEncoderTest and it correctly converts ':' to |
Have noted on #1103 that I'm working on a fix for this difference in behaviour |
A fix/feature to support this has been released as part of v2.13.0. For safety/backwards-compatibility reasons we couldn't change the default behavior in |
Tanks @Xtansia , we will try that: stable version 2.13.0 with the system property |
@tloubrieu-jpl That's correct |
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, likea:b:c:d:e::1.0
.@jordanpadams @tloubrieu-jpl
The text was updated successfully, but these errors were encountered: