julius_am
julius_am

Reputation: 1527

AWS authentication requires a valid Date or x-amz-date header

I'm trying to deploy my project to amazon AWS Elastic Beanstalk (with eclipse) but I'm getting the following error:

com.amazonaws.services.s3.model.AmazonS3Exception: AWS authentication requires a valid Date or x-amz-date header (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: 649FE9210F6B7758), S3 Extended Request ID: rPaO3PhaiVUP3Nwt6ORehaZUICUJ0nh+Ij8od3Aiq9RoTZtwaZipVyDRI+Hr6qa67A1vwgjpbJo=
at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1077)
at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:725)
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.putObject(AmazonS3Client.java:1434)
at com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1294)
at com.amazonaws.eclipse.elasticbeanstalk.ElasticBeanstalkPublishingUtils.publishApplicationToElasticBeanstalk(ElasticBeanstalkPublishingUtils.java:123)
at com.amazonaws.eclipse.elasticbeanstalk.jobs.UpdateEnvironmentJob.run(UpdateEnvironmentJob.java:189)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)


eclipse.buildId=4.3.2.M20140221-1700
java.version=1.8.0_66
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US

I tried the following:

  1. Added joda-time 1.8.1 to WebContent\WEB-INF\lib and also added the jar to my dynamic web project.
  2. verified the version with

    new DateTime().getClass().getProtectionDomain().getCodeSource()

but I'm still getting this error. I tried to search for additional solutions but with no luck.

Upvotes: 1

Views: 3905

Answers (3)

Avinash Singh
Avinash Singh

Reputation: 1016

The problem is with java version jdk1.8.0_60 greater downgrade it to jdk1.8.0_45 will solve the problem

Upvotes: 1

julius_am
julius_am

Reputation: 1527

So I managed to fix this problem with the help of this question In addition to re-installing the aws toolkit I also re-installed eclipse.

Upvotes: 0

Semih Eker
Semih Eker

Reputation: 2409

Do you have Java 1.8u60?

As specified here, JodaTime has problems with formatting time zones starting with Java 1.8u60.

Upgrading to JodaTime version 2.8.1 or later solves the issue.

They have created pull request for this: JodaOrg/joda-time#291.

I hope this helps you.

Upvotes: 2

Related Questions