aws

http://status.aws.amazon.com/ https://www.expeditedssl.com/aws-in-plain-english
grounded_sage 2020-01-17T17:52:01.000700Z

Execution error (FileNotFoundException) at cognitect.aws.dynaload/load-ns (dynaload.clj:8).
Could not locate cognitect/aws/protocols/__init.class, cognitect/aws/protocols/.clj or cognitect/aws/protocols/.cljc on classpath.
class clojure.lang.Compiler$CompilerException
I'm getting this error from aws-api

ghadi 2020-01-17T18:03:44.001500Z

Paste a full trace in a snippet please @grounded_sage

grounded_sage 2020-01-17T18:04:49.002100Z

@ghadi updated the snippet.

ghadi 2020-01-17T18:05:24.002400Z

need a full stacktrace please

ghadi 2020-01-17T18:05:37.002700Z

or the output of *e

ghadi 2020-01-17T18:07:02.003400Z

also, what was called to create a client?

grounded_sage 2020-01-17T18:10:21.004800Z

(def kms (aws/client {:api                   :kms
                      :region               ""
                      :credentials-provider (credentials/basic-credentials-provider
                                               {:access-key-id     ""
                                                :secret-access-key ""})}))

grounded_sage 2020-01-17T18:10:52.005500Z

I'm doing stuff in the REPL. Where do I put *e ?

ghadi 2020-01-17T18:11:06.005900Z

in the repl when you get an error

ghadi 2020-01-17T18:11:13.006200Z

you can get the full trace with *e

ghadi 2020-01-17T18:11:21.006500Z

or (prn *e)

ghadi 2020-01-17T18:11:45.006900Z

need versions of api + endpoints + kms dep

grounded_sage 2020-01-17T18:13:00.007100Z

#error {
 :cause "Could not locate cognitect/aws/protocols/__init.class, cognitect/aws/protocols/.clj or cognitect/aws/protocols/.cljc on classpath."
 :via
 [{:type clojure.lang.Compiler$CompilerException
   :message "Syntax error macroexpanding at (NO_SOURCE_FILE:1:10)."
   :data #:clojure.error{:phase :execution, :line 1, :column 10, :source "NO_SOURCE_FILE"}
   :at [clojure.lang.Compiler$InvokeExpr eval "Compiler.java" 3707]}
  {:type <http://java.io|java.io>.FileNotFoundException
   :message "Could not locate cognitect/aws/protocols/__init.class, cognitect/aws/protocols/.clj or cognitect/aws/protocols/.cljc on classpath."
   :at [clojure.lang.RT load "RT.java" 462]}]
 :trace
 [[clojure.lang.RT load "RT.java" 462]
  [clojure.lang.RT load "RT.java" 424]
  [clojure.core$load$fn__6839 invoke "core.clj" 6126]
  [clojure.core$load invokeStatic "core.clj" 6125]
  [clojure.core$load doInvoke "core.clj" 6109]
  [clojure.lang.RestFn invoke "RestFn.java" 408]
  [clojure.core$load_one invokeStatic "core.clj" 5908]
  [clojure.core$loa
d_one invoke "core.clj" 5903]
  [clojure.core$load_lib$fn__6780 invoke "core.clj" 5948]
  [clojure.core$load_lib invokeStatic "core.clj" 5947]
  [clojure.core$load_lib doInvoke "core.clj" 5928]
  [clojure.lang.RestFn applyTo "RestFn.java" 142]
  [clojure.core$apply invokeStatic "core.clj" 667]
  [clojure.core$load_libs invokeStatic "core.clj" 5985]
  [clojure.core$load_libs doInvoke "core.clj" 5969]
  [clojure.lang.RestFn applyTo "RestFn.java" 137]
  [clojure.core$apply invokeStatic "core.clj" 667]
  [clojure.core$require invokeStatic "core.clj" 6007]
  [clojure.core$require doInvoke "core.clj" 6007]
  [clojure.lang.RestFn invoke "RestFn.java" 408]
  [cognitect.aws.dynaload$load_ns invokeStatic "dynaload.clj" 8]
  [cognitect.aws.dynaload$load_ns invoke "dynaload.clj" 5]
  [cognitect.aws.client.api$client invokeStatic "api.clj" 78]
  [cognitect.aws.client.api$client invoke "api.clj" 23]
  [clojure.lang.AFn applyToHelper "AFn.java" 154]
  [clojure.lang.AFn applyTo "AFn.java" 144]
  [clojure.lang.Compiler$Invoke
Expr eval "Compiler.java" 3702]
  [clojure.lang.Compiler$DefExpr eval "Compiler.java" 457]
  [clojure.lang.Compiler eval "Compiler.java" 7182]
  [clojure.lang.Compiler eval "Compiler.java" 7132]
  [clojure.core$eval invokeStatic "core.clj" 3214]
  [clojure.core$eval invoke "core.clj" 3210]
  [clojure.main$repl$read_eval_print__9086$fn__9089 invoke "main.clj" 437]
  [clojure.main$repl$read_eval_print__9086 invoke "main.clj" 437]
  [clojure.main$repl$fn__9095 invoke "main.clj" 458]
  [clojure.main$repl invokeStatic "main.clj" 458]
  [clojure.main$repl doInvoke "main.clj" 368]
  [clojure.lang.RestFn invoke "RestFn.java" 1523]
  [nrepl.middleware.interruptible_eval$evaluate invokeStatic "interruptible_eval.clj" 79]
  [nrepl.middleware.interruptible_eval$evaluate invoke "interruptible_eval.clj" 55]
  [nrepl.middleware.interruptible_eval$interruptible_eval$fn__935$fn__939 invoke "interruptible_eval.clj" 142]
  [clojure.lang.AFn run "AFn.java" 22]
  [nrepl.middleware.session$session_exec$main_loop__1036$fn__1040 inv
oke "session.clj" 171]
  [nrepl.middleware.session$session_exec$main_loop__1036 invoke "session.clj" 170]
  [clojure.lang.AFn run "AFn.java" 22]
  [java.lang.Thread run "Thread.java" 834]]}

grounded_sage 2020-01-17T18:14:26.008300Z

I've also got an empty service.edn file.. I don't know what is supposed to be in there. The documentation is a bit sparse for a beginner on AWS stuff.

ghadi 2020-01-17T18:14:53.008800Z

need the versions please

ghadi 2020-01-17T18:15:07.009100Z

service.edn should come from the maven dependency automatically

grounded_sage 2020-01-17T18:15:27.009300Z

com.cognitect.aws/api       {:mvn/version "0.8.408"}
  com.cognitect.aws/endpoints {:mvn/version "1.1.11.705"}
  com.cognitect.aws/s3        {:mvn/version "784.2.593.0"}

grounded_sage 2020-01-17T18:15:33.009600Z

It wasn't....

ghadi 2020-01-17T18:15:35.009700Z

no kms dependency?

ghadi 2020-01-17T18:16:01.010100Z

you're creating a client for kms

grounded_sage 2020-01-17T18:16:28.010500Z

I was just following this and just trying to get something running https://github.com/cognitect-labs/aws-api#credentials

ghadi 2020-01-17T18:17:16.012Z

so you need two dependencies for anything /api and /endpoints

grounded_sage 2020-01-17T18:17:19.012200Z

The repl runs fine on my machine where I have aws cli and set up the aws config . I was able to poke around at the buckets with the repl. Now I am trying to get it working on a remote server and am lost.

ghadi 2020-01-17T18:17:29.012500Z

then you need a dependency for the service you're trying to hit

ghadi 2020-01-17T18:17:32.012700Z

in this case /kms

ghadi 2020-01-17T18:18:09.013200Z

the readme is more of an overview than a walkthrough guide

ghadi 2020-01-17T18:18:23.013500Z

com.cognitect.aws/kms        {:mvn/version         "782.2.586.0"}
is what I used for the kms service

ghadi 2020-01-17T18:18:51.014200Z

has all the latest versions of each api

grounded_sage 2020-01-17T18:19:53.014600Z

Yea I don't even know what the kms was until recently.

grounded_sage 2020-01-17T18:20:08.015Z

Was wondering if it needed to actually be ec2 ?

ghadi 2020-01-17T18:20:49.015300Z

it could be any service you have a dependency to

ghadi 2020-01-17T18:21:23.016Z

that section of the readme is trying to show how to use create a client with credentials

ghadi 2020-01-17T18:21:32.016300Z

we can make it clearer

grounded_sage 2020-01-17T18:22:59.016900Z

Ok so I have the kms dependency now. Do I need to require it?

ghadi 2020-01-17T18:23:59.017100Z

no

ghadi 2020-01-17T18:24:10.017500Z

just run what you were running before

grounded_sage 2020-01-17T18:30:56.018300Z

Compiling now 🙂 Still got to test if it works but it's looking good so far

grounded_sage 2020-01-17T18:37:58.018900Z

I'm getting back this.

{:Error
 {:HostIdAttrs {},
  :Message "The AWS Access Key Id you provided does not exist in our records.",
  :CodeAttrs {},
  :RequestIdAttrs {},
  :HostId ".....",
  :MessageAttrs {},
  :RequestId ".....",
  :Code "InvalidAccessKeyId",
  :AWSAccessKeyIdAttrs {},
  :AWSAccessKeyId "null"},
 :ErrorAttrs {},
 :cognitect.anomalies/category :cognitect.anomalies/forbidden}

grounded_sage 2020-01-17T18:38:42.019300Z

Do I have to provide a :user-name ?

ghadi 2020-01-17T18:39:16.019700Z

Check for a typo in your credentials

grounded_sage 2020-01-17T18:39:47.020400Z

It's strange. I did a straight copy and paste from the same thing I have on my machine.

grounded_sage 2020-01-17T19:01:21.021Z

Thank you for your help @ghadi !