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

Fix opensearch sink #5450

Merged
merged 1 commit into from
Feb 20, 2025
Merged

Conversation

oeyh
Copy link
Collaborator

@oeyh oeyh commented Feb 20, 2025

Description

After updating opensearch-java to 2.20 in #5426, we start to see this error in opensearch sink when writing to AWS OpenSearch domain:

org.opensearch.dataprepper.core.pipeline.common.FutureHelper - FutureTask failed due to: 
java.util.concurrent.ExecutionException: java.lang.NoSuchMethodError: 'software.amazon.awssdk.http.ContentStreamProvider software.amazon.awssdk.http.ContentStreamProvider.fromByteArrayUnsafe(byte[])'
...
Caused by: java.lang.NoSuchMethodError: 'software.amazon.awssdk.http.ContentStreamProvider software.amazon.awssdk.http.ContentStreamProvider.fromByteArrayUnsafe(byte[])'
	at org.opensearch.client.transport.aws.AwsSdk2Transport.prepareRequest(AwsSdk2Transport.java:347) ~[opensearch-java-2.20.0.jar:?]
	at org.opensearch.client.transport.aws.AwsSdk2Transport.performRequest(AwsSdk2Transport.java:214) ~[opensearch-java-2.20.0.jar:?]
	at org.opensearch.client.opensearch.OpenSearchClient.bulk(OpenSearchClient.java:224) ~[opensearch-java-2.20.0.jar:?]
	at org.opensearch.dataprepper.plugins.sink.opensearch.bulk.OpenSearchDefaultBulkApiWrapper.bulk(OpenSearchDefaultBulkApiWrapper.java:19) ~[opensearch-2.x.451.jar:?]

The SDK version we use currently, 2.25.11, doesn't support the method mentioned in the error message.
This PR updates SDK to latest version. I was able to reproduce the error and confirm the fix locally.

Issues Resolved

N/A

Check List

  • New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
    • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Hai Yan <oeyh@amazon.com>
@oeyh oeyh merged commit 70ceda1 into opensearch-project:main Feb 20, 2025
70 of 74 checks passed
divbok pushed a commit to divbok/data-prepper that referenced this pull request Feb 24, 2025
Signed-off-by: Hai Yan <oeyh@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants