Skip to content

AmazonClientException #7

Open
Open

Description

@timbog

I've got some troubles with running this sample.
I've followed instructions on http://aws.amazon.com/ru/developers/getting-started/java/, and after running mvn clean compile exec:java I've got AmazonClientException(Unable to execute HTTP request: peer not authenticated) followed by "Unable to execute HTTP request: peer not authenticated". This things happen when I am trying to create bucket, so I've got "Creating bucket my-first-s3-bucket-865cc23b-7f73-4e09-a9d9-c38382d72e2b" and then an error.
I've looked throw https://forums.aws.amazon.com/message.jspa?messageID=429971, but unfortunately I don't completely understand how to use suggested solution (http://javaskeleton.blogspot.ie/2010/07/avoiding-peer-not-authenticated-with.html) here.

Activity

  1. fulghum commented on Nov 18, 2014

    @fulghum

    What JVM version are you running? It sounds like you might be using an older version without up to date CA certs in your keystore.

  2. kiran1920 commented on Dec 10, 2014

    @kiran1920

    I am getting the following error while running Could you please help on this

    Creating bucket my-first-s3-bucket-3c2698bd-a429-4b9d-ae73-046fcbed0e66

    com.amazonaws.AmazonClientException: Unable to calculate a request signature: null
    at com.amazonaws.auth.AbstractAWSSigner.signAndBase64Encode(AbstractAWSSigner.java:71)
    at com.amazonaws.auth.AbstractAWSSigner.signAndBase64Encode(AbstractAWSSigner.java:58)
    at com.amazonaws.services.s3.internal.S3Signer.sign(S3Signer.java:127)
    at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:652)
    at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:460)
    at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:295)
    at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:3699)
    at com.amazonaws.services.s3.AmazonS3Client.createBucket(AmazonS3Client.java:788)
    at com.amazonaws.services.s3.AmazonS3Client.createBucket(AmazonS3Client.java:713)
    at main.java.com.amazonaws.samples.S3Sample.main(S3Sample.java:100)
    Caused by: java.lang.NullPointerException
    at javax.xml.bind.DatatypeConverter.printBase64Binary(Unknown Source)
    at com.amazonaws.util.Base64.encodeAsString(Base64.java:36)
    at com.amazonaws.auth.AbstractAWSSigner.signAndBase64Encode(AbstractAWSSigner.java:69)
    ... 9 more
    Caught an AmazonClientException, which means the client encountered a serious internal problem while trying to communicate with S3, such as not being able to access the network.
    Error Message: Unable to calculate a request signature: null

  3. fulghum commented on Dec 10, 2014

    @fulghum

    Hey @kiran1920, it sounds like you might need to double-check your AWS security credentials and make sure this sample code is picking them up correctly.

    Have you created the .aws/credentials file in your home directory? It should look something like this:

    [default]
    aws_access_key_id = YOUR_ACCESS_KEY_ID
    aws_secret_access_key = YOUR_SECRET_ACCESS_KEY
    
  4. lcfarrington commented on Jun 9, 2015

    @lcfarrington

    I am trying to run this and am getting the following error Caught an AmazonServiceException, which means your request made it to Amazon S3, but was rejected with an error response for some reason.
    Error Message: Access Denied (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: 3FC6FAECDE3A19A1). I checked my access keys and believe that they are correct. How can I go about researching this further?

  5. lcfarrington commented on Jun 9, 2015

    @lcfarrington

    Answering my own question. My permissions were not correct. I needed to give full access to S3.

  6. SharathDharmala commented on Jun 7, 2020

    @SharathDharmala

    While iam trying to create a bucket, below exception i got..

    Caught an AmazonClientException, which means the client encountered a serious internal problem while trying to communicate with S3, such as not being able to access the network.

    Error Message: Unable to execute HTTP request:....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions