Issue retrieving com.datomic/ion dependency from datomic-cloud maven repo

Playing around with the I am having an issue starting the Clojure REPL.

I followed the instructions on the Datomic Cloud web site

  1. Setting Up | Datomic
  2. User Access | Datomic
  3. Getting Started | Datomic

and everything works are described.

When I clone the Datomic/ion-starter project and try to start the clj REPL in the project folder I get :

Error building classpath. Failed to read artifact descriptor for com.datomic:ion:jar:0.9.7
org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for com.datomic:ion:jar:0.9.7
	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:276)
	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:192)
...
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact com.datomic:ion:pom:0.9.7 from/to datomic-cloud (s3://datomic-releases-1fc2183a/maven/releases): The request signature we calculated does not match the signature you provided. Check your key and signing method. (Service: Amazon S3; Status Code: 403; Error Code: SignatureDoesNotMatch; Request ID: E7ECBB8534175365; S3 Extended Request ID: JdbeFlXOjmjvOBCVh6kFG1lbDveby9QWge1jtIcDTi7AGeosTZ/oBHziljsgaV4hWbI1JjwS1/I=)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:422)
	... 
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact com.datomic:ion:pom:0.9.7 from/to datomic-cloud (s3://datomic-releases-1fc2183a/maven/releases): The request signature we calculated does not match the signature you provided. Check your key and signing method. (Service: Amazon S3; Status Code: 403; Error Code: SignatureDoesNotMatch; Request ID: E7ECBB8534175365; S3 Extended Request ID: JdbeFlXOjmjvOBCVh6kFG1lbDveby9QWge1jtIcDTi7AGeosTZ/oBHziljsgaV4hWbI1JjwS1/I=)
	at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:52)
	... 27 more
Caused by: com.amazonaws.services.s3.model.AmazonS3Exception: The request signature we calculated does not match the signature you provided. Check your key and signing method. (Service: Amazon S3; Status Code: 403; Error Code: SignatureDoesNotMatch; Request ID: E7ECBB8534175365; S3 Extended Request ID: JdbeFlXOjmjvOBCVh6kFG1lbDveby9QWge1jtIcDTi7AGeosTZ/oBHziljsgaV4hWbI1JjwS1/I=), S3 Extended Request ID: JdbeFlXOjmjvOBCVh6kFG1lbDveby9QWge1jtIcDTi7AGeosTZ/oBHziljsgaV4hWbI1JjwS1/I=
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1592)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1257)
	...

Looking at the deps.edn file:

;; Copyright (c) Cognitect, Inc.
;; All rights reserved.

{:paths ["src" "resources"]
 :deps {com.datomic/ion {:mvn/version "0.9.7"}
        org.clojure/data.json {:mvn/version "0.2.6"}
        org.clojure/clojure {:mvn/version "1.9.0"}}
 :mvn/repos {"datomic-cloud" {:url "s3://datomic-releases-1fc2183a/maven/releases"}}
 :aliases
 {:dev {:extra-deps {com.datomic/client-cloud {:mvn/version "0.8.54"}
                     com.datomic/ion-dev {:mvn/version "0.9.160"}}}}}

It seems I do not have access to the datomic-cloud maven repo.

Trying to list the files in the repo using the AWS Command Line tool also did not work:

$ aws s3 ls s3://datomic-releases-1fc2183a/maven/releases

An error occurred (NoSuchBucket) when calling the ListObjects operation: The specified bucket does not exist

Any help pointing me into the right direction is very much appreciated.

Thank you for your report. Could you run the following AWS CLI command:

aws s3 cp s3://datomic-releases-1fc2183a/maven/releases/com/datomic/ion/0.9.7/ion-0.9.7.jar .

Given the AWS error:

The request signature we calculated does not match the signature you provided. 

I want to confirm that you have appropriate AWS credentials.

Downloading the Ion library works:

$ aws s3 cp s3://datomic-releases-1fc2183a/maven/releases/com/datomic/ion/0.9.7/ion-0.9.7.jar .
download: s3://datomic-releases-1fc2183a/maven/releases/com/datomic/ion/0.9.7/ion-0.9.7.jar to ./ion-0.9.7.jar

Looks like the bucket list permission is not set:

$ aws s3 ls s3://datomic-releases-1fc2183a/maven/releases/
An error occurred (AccessDenied) when calling the ListObjects operation: Access Denied

$ aws s3 ls s3://datomic-releases-1fc2183a/maven/releases/com/datomic/ion/0.9.7/
An error occurred (AccessDenied) when calling the ListObjects operation: Access Denied

I was able to download the Ion POM as well (using the aws s3 cp command) and installing he JAR into my local maven repo using (after renaming it to pom.xml)

mvn install:install-file -DgroupId=com.datomic -DartifactId=ion -Dfile=ion-0.9.7.jar -DpomFile=pom.xml -DcreateChecksum=true

Unfortunately I still get the exception (see first post) when trying to start the clj REPL in the Datomic/ion-starter project, just for com.datomic:java-io:jar.

Tried the same direct-download workaround, but without luck:

$ aws s3 cp s3://datomic-releases-1fc2183a/maven/releases/com/datomic/java-io/0.1.12/java-io-0.1.12.jar .
fatal error: An error occurred (403) when calling the HeadObject operation: Forbidden

Could you put a sample project on Github or gist for us to try? ListObject is not required for this to work.

I put the exact steps in the following Gist:

If you have any additional questions in the meantime, please don’t hesitate to let me know.

PS: I should mention that this is the output after I manually downloaded and installed the Ion library into my local maven repo.

After spending more time looking into the issue I (finally) figured out it the root cause of the problem.

I set the AWS credentials manually in the terminal session via a resource file. That allowed the aws s3 sp command to work. But when starting the clojure REPL, it does not use the terminal session environment variable, but different ones set in an old, non-obvious resource file in my root folder.

After removing out the overriding environment variables, every worked.

Revisiting this: I’m seeing that the only way to get Clojure to recognize AWS creds is by putting them in ~/.m2/settings.xml, as described here. I have not been able to get it to recognize profiles in ~/.aws/credentials.