<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Getting an UnknownHostException when trying to do a createBucket or putObject in Software Development Kit (SDK) and API Discussions</title>
    <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Getting-an-UnknownHostException-when-trying-to-do-a-createBucket-or-putObject/m-p/458778#M3299</link>
    <description>&lt;PRE&gt;&lt;SPAN class=""&gt;UnknownHostException ==== JAva can not resolve hostname due to DNS resolution issue.&lt;BR /&gt;&lt;BR /&gt;pl try nslookup from java host for &lt;BR /&gt;nslookup testbucket11.theendpointurltomynetappstoragegrid&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;also, try adding following to S3Client&lt;BR /&gt;forcePathStyle(true) &lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 21 Feb 2025 01:50:33 GMT</pubDate>
    <dc:creator>AmitKerkar</dc:creator>
    <dc:date>2025-02-21T01:50:33Z</dc:date>
    <item>
      <title>Getting an UnknownHostException when trying to do a createBucket or putObject</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Getting-an-UnknownHostException-when-trying-to-do-a-createBucket-or-putObject/m-p/458624#M3298</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have a java app in which I'm trying to interface with a NetApp S3 API gateway in order to store large files there.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It was pretty straightforward to make a connection with an S3Client.&lt;BR /&gt;&lt;BR /&gt;And I know that I set things up correctly because I'm able to do a listBuckets and it correctly lists all of the existing buckets.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;&amp;nbsp;   String&lt;/SPAN&gt; &lt;SPAN class=""&gt;accessKeyId&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;"MyAccessKeyID"&lt;/SPAN&gt;;
    &lt;SPAN class=""&gt;String&lt;/SPAN&gt; &lt;SPAN class=""&gt;secretAccesskey&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;"MySecretAccessKey"&lt;/SPAN&gt;;
    &lt;SPAN class=""&gt;String&lt;/SPAN&gt; &lt;SPAN class=""&gt;endpointUrl&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;"https://theendpointurltomynetappstoragegrid:10444"&lt;/SPAN&gt;;

    &lt;SPAN class=""&gt;StaticCredentialsProvider&lt;/SPAN&gt; &lt;SPAN class=""&gt;credentialsProvider&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; StaticCredentialsProvider.create(
                AwsBasicCredentials.create(accessKeyId, secretAccesskey));
        
    &lt;SPAN class=""&gt;// Create S3 client&lt;/SPAN&gt;
    &lt;SPAN class=""&gt;S3Client&lt;/SPAN&gt; &lt;SPAN class=""&gt;s3Client&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; S3Client.builder()
            .credentialsProvider(credentialsProvider)
            .region(Region.US_EAST_1)
            .endpointOverride(URI.create(endpointUrl))
            .overrideConfiguration(ClientOverrideConfiguration.builder()
            .build())
        .build();

    &lt;SPAN class=""&gt;//This actually works fine to list the buckets - indicating I am connecting fine&lt;/SPAN&gt;
    &lt;SPAN class=""&gt;ListBucketsResponse&lt;/SPAN&gt; &lt;SPAN class=""&gt;listBucketsResponse&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; s3Client.listBuckets();&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;However it crashes with the&amp;nbsp;UnknownHostException when I try to do a createBucket or postObject.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;&amp;nbsp;   CreateBucketRequest&lt;/SPAN&gt; &lt;SPAN class=""&gt;createBucketRequest&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; CreateBucketRequest.builder()
                            .bucket(&lt;SPAN class=""&gt;"testbucket11"&lt;/SPAN&gt;)
                            .build();

    &lt;SPAN class=""&gt;//However this always crashes with a SdkClientException: Received an UnknownHostException&lt;/SPAN&gt;
    s3Client.createBucket(createBucketRequest);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BTW I am able to do a create-bucket through the aws command-line interface.&lt;BR /&gt;&lt;BR /&gt;This actually does create a bucket.&lt;/P&gt;&lt;PRE&gt;aws --endpoint-url https:&lt;SPAN class=""&gt;//theendpointurltomynetappstoragegrid:10444 s3api create-bucket --bucket testbucket11&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions?&amp;nbsp; Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2025 22:19:09 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Getting-an-UnknownHostException-when-trying-to-do-a-createBucket-or-putObject/m-p/458624#M3298</guid>
      <dc:creator>tlmitch</dc:creator>
      <dc:date>2025-02-14T22:19:09Z</dc:date>
    </item>
    <item>
      <title>Re: Getting an UnknownHostException when trying to do a createBucket or putObject</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Getting-an-UnknownHostException-when-trying-to-do-a-createBucket-or-putObject/m-p/458778#M3299</link>
      <description>&lt;PRE&gt;&lt;SPAN class=""&gt;UnknownHostException ==== JAva can not resolve hostname due to DNS resolution issue.&lt;BR /&gt;&lt;BR /&gt;pl try nslookup from java host for &lt;BR /&gt;nslookup testbucket11.theendpointurltomynetappstoragegrid&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;also, try adding following to S3Client&lt;BR /&gt;forcePathStyle(true) &lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Feb 2025 01:50:33 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Getting-an-UnknownHostException-when-trying-to-do-a-createBucket-or-putObject/m-p/458778#M3299</guid>
      <dc:creator>AmitKerkar</dc:creator>
      <dc:date>2025-02-21T01:50:33Z</dc:date>
    </item>
  </channel>
</rss>

