Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#1,783 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
48/100
Tipo di issue
Documentazione
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
aws, java
Ambito
documentation

Direzione di ricerca

Iniziare verificando nel README la dipendenza AwsSdk2Transport o la documentazione sulla compatibilità, quindi esaminare AwsSdk2Transport.prepareRequest e la versione indicata del metodo ContentStreamProvider. Documentare le versioni supportate di AWS SDK, inclusa la versione minima che fornisce fromByteArrayUnsafe, e confermare che il README avverta chiaramente gli utenti delle versioni precedenti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Java
Stelle
165
Fork
256
Merge medio
1g 6h
PR unite (30g)
37

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di opensearch-project/opensearch-java

Tutte le issue di opensearch-project/opensearch-java

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.