最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

java - Unable to execute HTTP request error when trying to list buckets for an AmazonS3 client - Stack Overflow

programmeradmin1浏览0评论

I have a java 17 app in which I'm trying to connect to an S3 storage container that is hosted on a NetApp site.

At this point I'm just trying to verify the connection and do a simple listBuckets call.

And I'm just not certain if I'm getting anywhere or how to proceed.

I've created my bucket in the NetApp site.

And I've created an access key

Here is my code - which quite honestly is one of a number of things I've tried after going online and making a number of AI inquiries...

// Set up your AWS credentials  
String accessKey = "The Access Key I created in NetApp";
String secretKey = "The Secret Key I created in NetApp";

// Set up your S3 endpoint configuration
String endpoint = ";;  //This is the base url of the NetApp interface
String region = "us-east-1";

// Create an AWS credentials provider
BasicAWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey);
AWSStaticCredentialsProvider credentialsProvider = new AWSStaticCredentialsProvider(credentials);

// Create an endpoint configuration for the S3-compatible storage service
AwsClientBuilder.EndpointConfiguration endpointConfiguration = new AwsClientBuilder.EndpointConfiguration(endpoint, region);


// Create an Amazon S3 client with the specified endpoint configuration
AmazonS3 s3Client = AmazonS3ClientBuilder.standard()
            .withEndpointConfiguration(endpointConfiguration)
            .withCredentials(credentialsProvider)
            .build();

// You can now use your S3 client to perform operations
System.out.println("S3 client setup successfully.");


// Here's where it dies with a Unable to execute HTTP request: Connection reset error
s3Client.listBuckets();

At this point it fails at the listBuckets() call with a Unable to execute HTTP request error.

Thing is it's a little hard to tell where things are going wrong.

Any suggestions?

Thanks so much

I have a java 17 app in which I'm trying to connect to an S3 storage container that is hosted on a NetApp site.

At this point I'm just trying to verify the connection and do a simple listBuckets call.

And I'm just not certain if I'm getting anywhere or how to proceed.

I've created my bucket in the NetApp site.

And I've created an access key

Here is my code - which quite honestly is one of a number of things I've tried after going online and making a number of AI inquiries...

// Set up your AWS credentials  
String accessKey = "The Access Key I created in NetApp";
String secretKey = "The Secret Key I created in NetApp";

// Set up your S3 endpoint configuration
String endpoint = "https://cee-sgaadm.bhinc.gov";  //This is the base url of the NetApp interface
String region = "us-east-1";

// Create an AWS credentials provider
BasicAWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey);
AWSStaticCredentialsProvider credentialsProvider = new AWSStaticCredentialsProvider(credentials);

// Create an endpoint configuration for the S3-compatible storage service
AwsClientBuilder.EndpointConfiguration endpointConfiguration = new AwsClientBuilder.EndpointConfiguration(endpoint, region);


// Create an Amazon S3 client with the specified endpoint configuration
AmazonS3 s3Client = AmazonS3ClientBuilder.standard()
            .withEndpointConfiguration(endpointConfiguration)
            .withCredentials(credentialsProvider)
            .build();

// You can now use your S3 client to perform operations
System.out.println("S3 client setup successfully.");


// Here's where it dies with a Unable to execute HTTP request: Connection reset error
s3Client.listBuckets();

At this point it fails at the listBuckets() call with a Unable to execute HTTP request error.

Thing is it's a little hard to tell where things are going wrong.

Any suggestions?

Thanks so much

Share Improve this question asked 20 hours ago TimTim 7952 gold badges10 silver badges19 bronze badges 1
  • Are you sure this is the good endpoint? Is the following documentation related to the endpoint configuration? docs.netapp.com/us-en/storagegrid-115/s3/… – fa44 Commented 17 hours ago
Add a comment  | 

1 Answer 1

Reset to default 0

I've encountered a similar problem on Huawei's OBS, and my solution was to configure the domain with a corresponding SSL certificate to ensure that he could access https content. And, I noticed that there seems to be a corresponding depiction in the official netapp documentation?

Client communications with the Load Balancer service use HTTPS if HTTPS is configured for the load balancer endpoint.

When you configure a load balancer endpoint, HTTP can optionally be enabled. For example, you might want to use HTTP for testing or other non-production purposes. See the instructions for administering StorageGRID for more information.

By default, StorageGRID uses HTTPS for client communications with Storage Nodes and the CLB service on Gateway Nodes.

HTTP can optionally be enabled for these connections. For example, you might want to use HTTP for testing or other non-production purposes. See the instructions for administering StorageGRID for more information.

发布评论

评论列表(0)

  1. 暂无评论