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

AmazonClientException #7

Open
timbog opened this issue Nov 7, 2014 · 7 comments
Open

AmazonClientException #7

timbog opened this issue Nov 7, 2014 · 7 comments

Comments

@timbog
Copy link

timbog commented Nov 7, 2014

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.

@ghost
Copy link

ghost commented Nov 18, 2014

Hi @timbog,

There are many things that could be causing the "peer not authenticated" error. Can you try adding -Djavax.net.debug=ssl when running the app to see what might be happening?

@fulghum
Copy link

fulghum commented Nov 18, 2014

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.

@kiran1920
Copy link

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

@fulghum
Copy link

fulghum commented Dec 10, 2014

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

@lcfarrington
Copy link

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?

@lcfarrington
Copy link

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

@SharathDharmala
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants