Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[BUG] AwsSdk2Transport doesn't work with AwsSdk below 2.25.0

オープン
#1,783 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
48/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
aws, java
領域
documentation

調査の方向性

まず README で AwsSdk2Transport の依存関係または互換性に関するドキュメントを確認し、次に AwsSdk2Transport.prepareRequest と、報告されている ContentStreamProvider メソッドのバージョンを確認します。サポートされている AWS SDK のバージョン(fromByteArrayUnsafe を提供する最小バージョンを含む)を文書化し、README が古いバージョンのユーザーに明確に警告していることを確認します。

索引モデルが issue の本文から書いたものです。

説明

bug
What is the bug?

Actually, it’s not really a bug. I think it’s an intended behavior that AwsSdk2Transport doesn’t work with AwsSdk below version 2.25.0, since that version is already quite old.

In the prepareRequest method of the AwsSdk2Transport class, the ContentStreamProvider interface calls the fromByteArrayUnsafe method. However, this method was introduced in AwsSdk2 after version 2.26.0.

Therefore, when using AwsSdk below 2.25.0, a NoSuchMethodError will occur when AwsSdk2Transport executes the prepareRequest method.

For clarification, it would be better to mention in the README which versions of AwsSdk2 are supported, so that users with older versions (below 2.25.0) can be aware of this limitation.

How can one reproduce the bug?

Inject SdkHttpClient of AwsSdk 2.25.0 into AwsSdk2Transport and then, call prepareRequest method.

SdkHttpClient httpClient =
        ApacheHttpClient.builder()
            .buildWithDefaults(
                AttributeMap.builder()
                    .put(SdkHttpConfigurationOption.TRUST_ALL_CERTIFICATES, true)
                    .build());

    AwsSdk2Transport transport =
        new AwsSdk2Transport(
            httpClient,
            server.httpsUri().toString().replace("https://", ""),
            Region.AP_NORTHEAST_1,
            AwsSdk2TransportOptions.builder().setCredentials(CREDENTIALS_PROVIDER).build());
What is the expected behavior?

Mentioning which versions of AwsSdk2 are supported in README.

What is your host/environment?

Mac OS 15.3.1

Do you have any screenshots?
'software.amazon.awssdk.http.ContentStreamProvider software.amazon.awssdk.http.ContentStreamProvider.fromByteArrayUnsafe(byte[])'
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:348)
	at org.opensearch.client.transport.aws.AwsSdk2Transport.performRequest(AwsSdk2Transport.java:215)

Image
Do you have any additional context?

Add any other context about the problem.

主要言語
Java
スター
165
フォーク
257
平均マージ
1日 1時間
マージ済み PR(30日)
44

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

opensearch-project/opensearch-java のほかの issue

opensearch-project/opensearch-java の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。