Fork me on GitHub
#aws
<
2020-01-17
>
grounded_sage17:01:01

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

ghadi18:01:44

Paste a full trace in a snippet please @grounded_sage

grounded_sage18:01:49

@ghadi updated the snippet.

ghadi18:01:24

need a full stacktrace please

ghadi18:01:37

or the output of *e

ghadi18:01:02

also, what was called to create a client?

grounded_sage18:01:21

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

grounded_sage18:01:52

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

ghadi18:01:06

in the repl when you get an error

ghadi18:01:13

you can get the full trace with *e

ghadi18:01:21

or (prn *e)

ghadi18:01:45

need versions of api + endpoints + kms dep

grounded_sage18:01:00

#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 .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_sage18:01:26

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.

ghadi18:01:53

need the versions please

ghadi18:01:07

service.edn should come from the maven dependency automatically

grounded_sage18:01:27

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"}

ghadi18:01:35

no kms dependency?

ghadi18:01:01

you're creating a client for kms

grounded_sage18:01:28

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

ghadi18:01:16

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

grounded_sage18:01:19

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.

ghadi18:01:29

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

ghadi18:01:32

in this case /kms

ghadi18:01:09

the readme is more of an overview than a walkthrough guide

ghadi18:01:23

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

ghadi18:01:51

has all the latest versions of each api

grounded_sage18:01:53

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

grounded_sage18:01:08

Was wondering if it needed to actually be ec2 ?

ghadi18:01:49

it could be any service you have a dependency to

ghadi18:01:23

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

ghadi18:01:32

we can make it clearer

grounded_sage18:01:59

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

ghadi18:01:10

just run what you were running before

grounded_sage18:01:56

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

grounded_sage18:01:58

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_sage18:01:42

Do I have to provide a :user-name ?

ghadi18:01:16

Check for a typo in your credentials

grounded_sage18:01:47

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

grounded_sage19:01:21

Thank you for your help @ghadi !