Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieving bucket policy throws "java.lang.Character cannot be cast to java.util.Map$Entry" #148

Closed
BenJanecke opened this issue Aug 12, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@BenJanecke
Copy link

BenJanecke commented Aug 12, 2020

Dependencies

  [com.cognitect.aws/api "0.8.469"]
  [com.cognitect.aws/endpoints "1.1.11.837"]
  [com.cognitect.aws/s3 "807.2.729.0"]

Description with failing test case

Hey folks, hope you can help me :)

When I try to retrieve a buckets policy I get "java.lang.Character cannot be cast to java.util.Map$Entry"

(def s3 (aws/client {:api    :s3
                               :region "us-east-1"
                               :endpoint-override {:hostname "s3.example.com"}
                               :credentials-provider (aws-credentials/basic-credentials-provider
                                               {:access-key-id     "access-key"
                                                :secret-access-key "secret-key"})}))
(def res (aws/invoke s3 {:op :GetBucketPolicy
                            :request {:Bucket "bucket-name"}}))

Stack traces

{:cognitect.anomalies/category :cognitect.anomalies/fault,
 :cognitect.aws.client/throwable #error {
 :cause "java.lang.Character cannot be cast to java.util.Map$Entry"
 :via
 [{:type java.lang.ClassCastException
   :message "java.lang.Character cannot be cast to java.util.Map$Entry"
   :at [clojure.lang.APersistentMap cons "APersistentMap.java" 42]}]
 :trace
 [[clojure.lang.APersistentMap cons "APersistentMap.java" 42]
  [clojure.lang.RT conj "RT.java" 677]
  [clojure.core$conj__5390 invokeStatic "core.clj" 85]
  [clojure.core$merge$fn__5958 invoke "core.clj" 3049]
  [clojure.core$reduce1 invokeStatic "core.clj" 944]
  [clojure.core$reduce1 invokeStatic "core.clj" 934]
  [clojure.core$merge invokeStatic "core.clj" 3048]
  [clojure.core$merge doInvoke "core.clj" 3041]
  [clojure.lang.RestFn invoke "RestFn.java" 421]
  [cognitect.aws.protocols.rest$parse_http_response invokeStatic "rest.clj" 258]
  [cognitect.aws.protocols.rest$parse_http_response invoke "rest.clj" 249]
  [cognitect.aws.protocols.rest_xml$eval72344$fn__72345 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" 43]
  [cognitect.aws.client$send_request$fn__26955$state_machine__9709__auto____26982$fn__26985 invoke "client.clj" 111]
  [cognitect.aws.client$send_request$fn__26955$state_machine__9709__auto____26982 invoke "client.clj" 107]
  [clojure.core.async.impl.ioc_macros$run_state_machine invokeStatic "ioc_macros.clj" 973]
  [clojure.core.async.impl.ioc_macros$run_state_machine invoke "ioc_macros.clj" 972]
  [clojure.core.async.impl.ioc_macros$run_state_machine_wrapped invokeStatic "ioc_macros.clj" 977]
  [clojure.core.async.impl.ioc_macros$run_state_machine_wrapped invoke "ioc_macros.clj" 975]
  [clojure.core.async.impl.ioc_macros$take_BANG_$fn__9727 invoke "ioc_macros.clj" 986]
  [clojure.core.async.impl.channels.ManyToManyChannel$fn__4505$fn__4506 invoke "channels.clj" 95]
  [clojure.lang.AFn run "AFn.java" 22]
  [java.util.concurrent.ThreadPoolExecutor runWorker "ThreadPoolExecutor.java" 1149]
  [java.util.concurrent.ThreadPoolExecutor$Worker run "ThreadPoolExecutor.java" 624]
  [java.lang.Thread run "Thread.java" 748]]}}
@dchelimsky dchelimsky self-assigned this Aug 12, 2020
@dchelimsky dchelimsky added the bug Something isn't working label Aug 12, 2020
@dchelimsky dchelimsky added this to Inbox in AWS API Project via automation Aug 12, 2020
@dchelimsky
Copy link
Contributor

Thanks for the bug report @BenJanecke. Fix is on master, release coming shortly. I'm surprised this never came up before as this has been broken since our very first release. One reason might be that of 7823 operations across 227 services, GetBucketPolicy is the only operation with the particular output structure that triggered the bug!

@dchelimsky dchelimsky moved this from Inbox to Ready to release in AWS API Project Aug 15, 2020
@dchelimsky
Copy link
Contributor

Fix released in version "0.8.474".

@BenJanecke
Copy link
Author

Thanks so much for the super prompt response, you're awesome and have made my week!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
AWS API Project
  
Ready to release
Development

No branches or pull requests

2 participants