Wednesday, September 14, 2016

Job fails with "AWS authentication requires a valid Date or x-amz-date header"

Symptom:

Job fails with error "AWS authentication requires a valid Date or x-amz-date header".
For example:
# java UploadObjectSingleOperation
Uploading a new object to S3 from a file

Caught an AmazonServiceException, which means your request made it to Amazon S3, but was rejected with an error response for some reason.
Error Message:    AWS authentication requires a valid Date or x-amz-date header (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: 6XXXXXXXXXXXXXX)
HTTP Status Code: 403
AWS Error Code:   AccessDenied
Error Type:       Client
Request ID:       6XXXXXXXXXXXXXX

Root Cause:

https://github.com/aws/aws-sdk-java/issues/484

Solution:

Make sure you are using joda-time jar >= version 2.8.1.
For example:
export CLASSPATH=/root/hao/sdk/aws-java-sdk-1.7.15.jar:.:/opt/mapr/hadoop/hadoop-2.7.0/share/hadoop/common/lib/*:/opt/mapr/hadoop/hadoop-2.7.0/share/hadoop/tools/lib/joda-time-2.9.2.jar

No comments:

Post a Comment

Popular Posts