# Fetching artifacts from s3 backed repository fails with jdk8u60

**URL:** <https://discuss.gradle.org/t/fetching-artifacts-from-s3-backed-repository-fails-with-jdk8u60/11298>\
**Category:** Bugs\
**Tags:** gradle-3338, issue-acknowledged\
**Created:** [August 23, 2015, 4:06pm UTC](https://discuss.gradle.org/t/fetching-artifacts-from-s3-backed-repository-fails-with-jdk8u60/11298 "2015-08-23T16:06:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ikikko](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/ikikko/32/2816_2.png) [@ikikko](https://discuss.gradle.org/u/ikikko)\
**Post date:** [August 23, 2015, 4:06pm UTC](https://discuss.gradle.org/t/fetching-artifacts-from-s3-backed-repository-fails-with-jdk8u60/11298/1 "2015-08-23T16:06:42Z")

</div>

I’m using s3 backed repositories as a [document](https://docs.gradle.org/2.4/release-notes#support-for-amazon-web-services-s3-backed-repositories).  
After updating oracle jdk to version 8u60, I met a following error below.

```gradle
AWS authentication requires a valid Date or x-amz-date header (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: D5BEFCA132123ECE)

```

As a result of investigating the problem, I guess that this problem is same as an [issue](https://github.com/aws/aws-sdk-java/issues/484) and due to version of joda-time.  
The report says we can use joda-time 2.8.1 with jdk 8u60, but I found Gradle uses an old version 2.7 of joda-time as a [source](https://github.com/gradle/gradle/blob/master/gradle/dependencies.gradle#L163), and Gradle doesn’t use a latest vesion of aws-java-sdk which [AWS released](http://aws.amazon.com/releasenotes/8143039639694253).

As workarround, I downgraded jdk I’m using. However, I would like gradle to support latest jdk8.

Finally, I reported successful and failed stacktraces. I have executed them in a docker container, and I have masked private information.

- successful stacktrace

```gradle
root@a46fec7aaeb5:~/app# ./gradlew --version

------------------------------------------------------------
Gradle 2.4
------------------------------------------------------------

Build time: 2015-05-05 08:09:24 UTC
Build number: none
Revision: 5c9c3bc20ca1c281ac7972643f1e2d190f2c943c

Groovy: 2.3.10
Ant: Apache Ant(TM) version 1.9.4 compiled on April 29 2014
JVM: 1.8.0_51 (Oracle Corporation 25.51-b03)
OS: Linux 4.0.9-boot2docker amd64

root@a46fec7aaeb5:~/app# ./gradlew clean compileJava
...
:clean
:compileJava
Download s3://xxx//xxx/xxx/xxx-xxx.jar

BUILD SUCCESSFUL

```

- failed stacktrace

```gradle
root@65ea2f079d3a:~/app# ./gradlew --version

------------------------------------------------------------
Gradle 2.4
------------------------------------------------------------

Build time: 2015-05-05 08:09:24 UTC
Build number: none
Revision: 5c9c3bc20ca1c281ac7972643f1e2d190f2c943c

Groovy: 2.3.10
Ant: Apache Ant(TM) version 1.9.4 compiled on April 29 2014
JVM: 1.8.0_60 (Oracle Corporation 25.60-b23)
OS: Linux 4.0.9-boot2docker amd64

root@65ea2f079d3a:~/app# ./gradlew clean compileJava
...
:clean
:compileJava

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all dependencies for configuration ':compile'.
> Could not download xxx.jar (xxx:xxx:xxx)
   > Could not get resource 's3://xxx/xxx/xxx/xxx-xxx.jar'.
      > AWS authentication requires a valid Date or x-amz-date header (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: D5BEFCA132123ECE)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

```

---

<div class="post-metadata">

**Author:** ![sterling](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/sterling/32/5395_2.png) [@sterling](https://discuss.gradle.org/u/sterling)\
**Post date:** [August 23, 2015, 8:04pm UTC](https://discuss.gradle.org/t/fetching-artifacts-from-s3-backed-repository-fails-with-jdk8u60/11298/2 "2015-08-23T20:04:13Z")

</div>

Thanks for the detailed report. I’ve raised GRADLE-3338.
