Fork me on GitHub
#aws
<
2020-02-25
>
kenny16:02:49

Oh wow. Just noticed a bunch of functions in cognitect.aws.credentials have been pulled out into nice helpers. This cleans up a ton of code. Thank you!

dchelimsky16:02:30

Just be sure to rely only on the documented functions 🙂

dchelimsky16:02:27

Functions with "For internal use. Do not call directly." may change without warning.

4
andrea.crotti16:02:08

the aws libraries don't seem to be on Clojars, is that correct?

andrea.crotti16:02:58

yeah ok cool, why if I may ask?

andrea.crotti16:02:03

easier to have just in one place?

dchelimsky16:02:29

Honestly, it was a decision made over a year ago. Don't remember why.

andrea.crotti16:02:03

yeah sure, the clojars badge saves some work imho for the readme

andrea.crotti17:02:52

this one for example

andrea.crotti17:02:12

you see it lots of libraries, just keeps track of the latest version automatically

ghadi17:02:04

aws-api uses at least three artifacts to do anything useful

ghadi17:02:21

the client, the endpoints, and N>=1 services that you're using

andrea.crotti17:02:37

kaocha does something similar, and with a nice table https://github.com/lambdaisland/kaocha

dchelimsky17:02:38

The problem with them, however, is that you can't copy and paste from them into your deps.edn 😉

ghadi17:02:52

i don't find this very useful unless it's copypastable, and I'd prefer it to be in deps.edn format

dchelimsky17:02:52

What we have on aws-api is less pretty, but more useful IMO.

4
dchelimsky17:02:35

What @ghadi said (after I said it) 😉

andrea.crotti17:02:37

I'm struggling again with the same error

{:cognitect.anomalies/category :cognitect.anomalies/fault,
 :cognitect.aws.client/throwable #error {
 :cause "Property null is not supported"
 :via

andrea.crotti17:02:54

but this time when I try to do a ListObjects operation like

(aws/invoke (s3-client) {:op :ListObjectsV2
                           :request {:Bucket "bucket"}})

andrea.crotti17:02:14

the returned XML seem to be something like

<?xml version="1.0" encoding="UTF-8"?>
<ListBucketResult xmlns=""><Name>bucket</Name><Prefix></Prefix><KeyCount>0</KeyCount><MaxKeys>10000</MaxKeys><Delimiter></Delimiter><IsTruncated>false</IsTruncated></ListBucketResult>

andrea.crotti17:02:47

with the same client/config putting and fetching an object works fine

ghadi17:02:56

do you have the full :via stacktrace?

andrea.crotti17:02:29

[{:type java.lang.IllegalArgumentException
   :message "Property null is not supported"
   :at [com.sun.xml.internal.stream.XMLInputFactoryImpl setProperty "XMLInputFactoryImpl.java" 246]}]
 :trace
 [[com.sun.xml.internal.stream.XMLInputFactoryImpl setProperty "XMLInputFactoryImpl.java" 246]
  [clojure.data.xml$new_xml_input_factory invokeStatic "xml.clj" 323]
  [clojure.data.xml$new_xml_input_factory invoke "xml.clj" 319]
  [clojure.data.xml$source_seq invokeStatic "xml.clj" 332]
  [clojure.data.xml$source_seq doInvoke "xml.clj" 326]
  [clojure.lang.RestFn applyTo "RestFn.java" 139]
  [clojure.core$apply invokeStatic "core.clj" 667]
  [clojure.core$apply invoke "core.clj" 660]
  [clojure.data.xml$parse invokeStatic "xml.clj" 346]
  [clojure.data.xml$parse doInvoke "xml.clj" 340]
  [clojure.lang.RestFn invoke "RestFn.java" 486]
  [cognitect.aws.util$xml_read invokeStatic "util.clj" 137]
  [cognitect.aws.util$xml_read invoke "util.clj" 134]
  [cognitect.aws.shape$xml_parse invokeStatic "shape.clj" 217]
  [cognitect.aws.shape$xml_parse invoke "shape.clj" 214]
  [cognitect.aws.protocols.rest$parse_body invokeStatic "rest.clj" 247]
  [cognitect.aws.protocols.rest$parse_body invoke "rest.clj" 235]
  [cognitect.aws.protocols.rest$parse_http_response invokeStatic "rest.clj" 260]
  [cognitect.aws.protocols.rest$parse_http_response invoke "rest.clj" 249]
  [cognitect.aws.protocols.rest_xml$eval17611$fn__17612 invoke "rest_xml.clj" 23]
  [clojure.lang.MultiFn invoke "MultiFn.java" 239]
  [cognitect.aws.client$handle_http_response invokeStatic "client.clj" 48]
  [cognitect.aws.client$handle_http_response invoke "client.clj" 42]
  [cognitect.aws.client$send_request_STAR_$fn__24125 invoke "client.clj" 82]
  [clojure.core.async.impl.channels.ManyToManyChannel$fn__4659$fn__4660 invoke "channels.clj" 95]
  [clojure.lang.AFn run "AFn.java" 22]
  [java.util.concurrent.ThreadPoolExecutor runWorker "ThreadPoolExecutor.java" 1128]
  [java.util.concurrent.ThreadPoolExecutor$Worker run "ThreadPoolExecutor.java" 628]
  [java.lang.Thread run "Thread.java" 835]]

andrea.crotti17:02:52

same thing as what I had a few days ago, the error just says it can't parse the XML

ghadi17:02:20

can you file an issue with this info and we can take a look at it?

ghadi17:02:36

this stacktrace helps

ghadi17:02:22

also @andrea.crotti need the computed deps versions from your project (specifically for clojure.data.xml)

andrea.crotti17:02:14

looks like it [org.clojure/data.xml "0.0.8"]

andrea.crotti17:02:38

which should be the latest

ghadi17:02:52

0.0.8 doesn't seem right

andrea.crotti17:02:11

latest stable at least

ghadi17:02:40

I wonder how your deps are getting overridden to the wrong version

dchelimsky17:02:57

That's definitely most likely the issue.

dchelimsky17:02:41

And even though the data.xml version is alpha6, it's been that way since Nov 2018. That's one definition of stable 😉

dchelimsky17:02:45

@andrea.crotti are you using tools.deps, leiningen, other?

andrea.crotti17:02:52

ah well sadly upgrading data.xml makes something else blow up

andrea.crotti17:02:55

so I can't try it directly

andrea.crotti17:02:03

but I'll keep digging

andrea.crotti17:02:09

thanks in the meanwhile

ghadi17:02:16

you should inspect your lein deps :tree for conflicts

andrea.crotti17:02:10

no it's just some code we have in a utils.clj file