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

Getting 'java.lang.NullPointerException: Cannot invoke "software.amazon.awssdk.core.ClientEndpointProvider.isEndpointOverridden()" #5646

Closed
1 task done
munishchouhan opened this issue Oct 8, 2024 · 10 comments
Assignees
Labels
bug This issue is a bug. closing-soon This issue will close in 4 days unless further comments are made.

Comments

@munishchouhan
Copy link

munishchouhan commented Oct 8, 2024

Describe the bug

After updating aws sdk to 2.28.15, getting 'java.lang.NullPointerException: Cannot invoke "software.amazon.awssdk.core.ClientEndpointProvider.isEndpointOverridden()" because "ep" is null'

in software.amazon.awssdk.services.s3.presigner.S3Presigner

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

i should not throw the exception

Current Behavior

throwing exception

java.lang.NullPointerException: Cannot invoke "software.amazon.awssdk.core.ClientEndpointProvider.isEndpointOverridden()" because "ep" is null
	at software.amazon.awssdk.core.interceptor.SdkExecutionAttribute.lambda$static$3(SdkExecutionAttribute.java:122)
	at software.amazon.awssdk.core.interceptor.ExecutionAttribute$DerivationValueStorage.lambda$set$0(ExecutionAttribute.java:277)
	at java.base/java.util.HashMap.compute(HashMap.java:1324)
	at software.amazon.awssdk.core.interceptor.ExecutionAttribute$DerivationValueStorage.set(ExecutionAttribute.java:277)
	at software.amazon.awssdk.core.interceptor.ExecutionAttributes.putAttribute(ExecutionAttributes.java:75)
	at software.amazon.awssdk.services.s3.internal.signing.DefaultS3Presigner.invokeInterceptorsAndCreateExecutionContext(DefaultS3Presigner.java:341)
	at software.amazon.awssdk.services.s3.internal.signing.DefaultS3Presigner.presign(DefaultS3Presigner.java:308)
	at software.amazon.awssdk.services.s3.internal.signing.DefaultS3Presigner.presignGetObject(DefaultS3Presigner.java:230)

Reproduction Steps

you can check out this pr
seqeralabs/wave#667

Possible Solution

No response

Additional Information/Context

No response

AWS Java SDK version used

2.28.15

JDK version used

11

Operating System and version

linux

@munishchouhan munishchouhan added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 8, 2024
@munishchouhan munishchouhan changed the title After updating aws sdk to 2.28.15, getting 'java.lang.NullPointerException: Cannot invoke "software.amazon.awssdk.core.ClientEndpointProvider.isEndpointOverridden()" because "ep" is null' Getting 'java.lang.NullPointerException: Cannot invoke "software.amazon.awssdk.core.ClientEndpointProvider.isEndpointOverridden()" Oct 8, 2024
@munishchouhan
Copy link
Author

this error is related to this PR
#5562

@debora-ito
Copy link
Member

@munishchouhan can you provide a sample code I can use to repro the error?
Are you using service-specific endpoint overrides?

@debora-ito debora-ito added potential-regression Marking this issue as a potential regression to be checked by team member and removed needs-triage This issue or PR still needs to be triaged. labels Oct 8, 2024
@debora-ito debora-ito self-assigned this Oct 8, 2024
@munishchouhan
Copy link
Author

this is the code i am using

    S3Presigner s3presigner() {
        final builder = S3Presigner.builder()
                .region(Region.of(blobConfig.storageRegion))
                .credentialsProvider(DefaultCredentialsProvider.create())
        if ( blobConfig.storageEndpoint ) {
            builder.endpointOverride(URI.create(blobConfig.storageEndpoint))
        }
        return builder.build()
    }

you can find the class here:
https://github.com/seqeralabs/wave/blob/master/src/main/groovy/io/seqera/wave/service/blob/impl/AwsS3PresignerFactory.groovy

@munishchouhan
Copy link
Author

can it be a dependency issue?

I am adding these three in my project, do i need to add some extra?

implementation "software.amazon.awssdk:ecr:2.28.15"
    implementation "software.amazon.awssdk:ecrpublic:2.28.15"
    implementation 'software.amazon.awssdk:ses:2.28.15'

@munishchouhan
Copy link
Author

This turn out to be a missing dependency issue, when i dont mentioned any version, then i thnk micornaut provides teh whole sdk, but with version, i need to provide the depdency
adding this solves the issue
implementation 'software.amazon.awssdk:aws-sdk-java:2.28.17'

Copy link

github-actions bot commented Oct 9, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

@munishchouhan
Copy link
Author

but the whole sdk is too big, how to know which part is missing?

@munishchouhan munishchouhan reopened this Oct 9, 2024
@debora-ito
Copy link
Member

You need to add as a dependency the SDK modules that correspond to the service clients you want to use, plus any HTTP client if you want to customize its configurations - Apache and NettyNio are added automatically.

S3Presigner is in software.amazon.awssdk:s3, looks like s3 is missing from your list.

Another thing you can check is for version mismatches between SDK modules. Ideally all modules should be in the same version.

@debora-ito debora-ito added closing-soon This issue will close in 4 days unless further comments are made. and removed potential-regression Marking this issue as a potential regression to be checked by team member labels Oct 9, 2024
@munishchouhan
Copy link
Author

thank you
s3 fixed the error

Copy link

github-actions bot commented Oct 9, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. closing-soon This issue will close in 4 days unless further comments are made.
Projects
None yet
Development

No branches or pull requests

2 participants