Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The URI scheme of endpointOverride must not be null AWS S3 SDK in Android

I am trying to use wasabi cloud storage using aws s3 sdk but I am getting The URI scheme of endpointOverride must not be null exception. Here is my code. How can I solve the issue?

private val AMAZON_S3_CLIENT: S3Client = S3Client.builder()
    .endpointOverride(URI(Config.SERVICE_END_POINT))
    .region(Region.US_EAST_1)
    .credentialsProvider(
        StaticCredentialsProvider.create(
            AwsBasicCredentials.create(
                Config.AWS_ACCESS_KEY,
                Config.AWS_SECRET_KEY
            )
        )
    )
    .build()
like image 233
md hasibul hasan Avatar asked Oct 26 '25 15:10

md hasibul hasan


2 Answers

I just encountered the same exception, using AWS Java SDK 2 with DynamoDB.

java.lang.NullPointerException: The URI scheme of endpointOverride must not be null

As the exception says the scheme in the URI of endpointOverride is missing.
I previously used "dynamodb.eu-central-1.amazonaws.com".
Adding the scheme solved the problem.

"https://dynamodb.eu-central-1.amazonaws.com"
like image 57
pscheid Avatar answered Oct 29 '25 04:10

pscheid


That is correct. you must prepend the endpoint with https://

We are using a Flink Kinesis Analytics app to read from a KDS and write to a Timestream instance.

In Flink when creating the required TimestreamSink object in Java to write to Timestream there is a property that needs bet set when using a VPC endpoint service.

TimestreamSinkConfig.builder().endpointOverride(endpointOverride)

initially I had endpointOverride as null when not using the VPC endpoint and that worked fine.

When we implemented the VPC endpoint with the endpoint

ingest-cell1.timestream.region.amazonaws.com

it did not work and it wasn't initially obvious why as the documentation didn't state that explicitly.

When I used https://ingest-cell1.timestream.region.amazonaws.com (where region is our AWS region and cell1 is the Timestream cell) the Flink process was able to write to Timestream as expected.

like image 41
Chopper Avatar answered Oct 29 '25 03:10

Chopper