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] Clear scroll request fails with sigv4 signature mismatch for java client 2.8.0 #712

Open
mschmie opened this issue Nov 6, 2023 · 5 comments · Fixed by #1333
Open
Labels
bug Something isn't working

Comments

@mschmie
Copy link

mschmie commented Nov 6, 2023

What is the bug?

clearScroll request to opensearch client fails with sigv4 signing mismatch:

org.opensearch.client.opensearch._types.OpenSearchException: Request failed: [security_exception] The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.

The Canonical String for this request should have been
'DELETE
/_search/scroll

... remaining request info...

How can one reproduce the bug?

How can one reproduce the bug?

Create an OpenSearchClient following instructions from here (https://opensearch.org/docs/2.7/clients/java/#connecting-to-amazon-opensearch-service) and then attempt to use the client's clearScroll API.

I believe this is because it is a DELETE request with a body. The search/scroll method works as intended. Sending the request results in a sigv4 error

What is the expected behavior?

The clearScroll API call does not have a signature mismatch

What is your host/environment?

Ubuntu 22.04
implementation 'org.opensearch.client:opensearch-java:2.8.0'

Do you have any screenshots?

If applicable, add screenshots to help explain your problem.

Do you have any additional context?

Add any other context about the problem.

@mschmie mschmie added bug Something isn't working untriaged labels Nov 6, 2023
@houssain-barouni
Copy link

Hello,

any updates or hints about this issue ? We have got the same issue when using Opensearch in AWS

Best regards,

@dblock
Copy link
Member

dblock commented Dec 4, 2023

AFAIK nobody is working on this. Want to help?

  1. Double check whether this is/not reproduced with curl against the Amazon managed service and serverless, https://code.dblock.org/2022/07/11/making-sigv4-authenticated-requests-to-managed-opensearch.html can help.
  2. Expand the existing POST tests for Sigv4 to DELETE and let's see if it's as trivial as always signing the body on a DELETE.

@dblock
Copy link
Member

dblock commented Dec 4, 2023

Is this a dup of #521? There's a failing integration test in #712 if you want to fix this and include it.

@houssain-barouni
Copy link

Replacing ApacheHttpClient by NettyNioAsyncHttpClient solves the issue.
cf opensearch-project/data-prepper#3338

@dblock
Copy link
Member

dblock commented Dec 9, 2024

[Catch All Triage - 1, 2, 3, 4]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants