cognitect-labs / aws-api

AWS, data driven
Apache License 2.0
727 stars 100 forks source link

"Property null is not supported" on valid responses #252

Closed cbowdon closed 8 months ago

cbowdon commented 8 months ago

Dependencies

:deps {com.cognitect.aws/api {:mvn/version "0.8.692"}
       com.cognitect.aws/endpoints {:mvn/version "1.1.12.504"}
       com.cognitect.aws/s3 {:mvn/version "848.2.1413.0"}}}

Description with failing test case

In this scenario any valid request fails with the stack trace below.

The cause turned out to be due to a dependency conflict, so there's nothing to fix per se in this library. Maintainers could close this issue directly. However it was tedious to debug, so I'm documenting it in hopes of saving someone else the difficulty.

The issue turns out to be that if your project includes an older version of clojure.data.xml (in my case 0.0.8, the last stable version) then cognitect.aws.util/xml-read will throw due to the keyword arguments to clojure.data.xml/parse being invalid. This isn't immediately obvious from the error about nulls. It was necessary to use clojure.data.xml version 0.2.0-alpha8.

Stack traces

{:cognitect.anomalies/category :cognitect.anomalies/fault, :cognitect.aws.client.impl/throwable #error {
 :cause "Property null is not supported"
 :via
 [{: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" 669]
  [clojure.core$apply invoke "core.clj" 662]
  [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" 167]
  [cognitect.aws.util$xml_read invoke "util.clj" 164]
  [cognitect.aws.shape$xml_parse invokeStatic "shape.clj" 317]
  [cognitect.aws.shape$xml_parse invoke "shape.clj" 313]
  [cognitect.aws.protocols.query$build_query_http_response invokeStatic "query.clj" 115]
  [cognitect.aws.protocols.query$build_query_http_response invoke "query.clj" 105]
  [cognitect.aws.protocols.query$eval75878$fn__75879 invoke "query.clj" 120]
  [clojure.lang.MultiFn invoke "MultiFn.java" 239]
  [cognitect.aws.client.impl$handle_http_response invokeStatic "impl.clj" 41]
  [cognitect.aws.client.impl$handle_http_response invoke "impl.clj" 35]
  [cognitect.aws.client.impl$send_request$fn__74727$state_machine__9637__auto____74756$fn__74759 invoke "impl.clj" 101]
  [cognitect.aws.client.impl$send_request$fn__74727$state_machine__9637__auto____74756 invoke "impl.clj" 97]
  [clojure.core.async.impl.ioc_macros$run_state_machine invokeStatic "ioc_macros.clj" 978]
  [clojure.core.async.impl.ioc_macros$run_state_machine invoke "ioc_macros.clj" 977]
  [clojure.core.async.impl.ioc_macros$run_state_machine_wrapped invokeStatic "ioc_macros.clj" 982]
  [clojure.core.async.impl.ioc_macros$run_state_machine_wrapped invoke "ioc_macros.clj" 980]
  [clojure.core.async.impl.ioc_macros$take_BANG_$fn__9655 invoke "ioc_macros.clj" 991]
  [clojure.core.async.impl.channels.ManyToManyChannel$fn__4479$fn__4480 invoke "channels.clj" 99]
  [clojure.lang.AFn run "AFn.java" 22]
  [java.util.concurrent.ThreadPoolExecutor runWorker "ThreadPoolExecutor.java" 1144]
  [java.util.concurrent.ThreadPoolExecutor$Worker run "ThreadPoolExecutor.java" 642]
  [clojure.core.async.impl.concurrent$counted_thread_factory$reify__4382$fn__4383 invoke "concurrent.clj" 29]
  [clojure.lang.AFn run "AFn.java" 22]
  [java.lang.Thread run "Thread.java" 1583]]}}