ok, thanks
for information, I have this error when trying a simple get call
Attempting to call unbound fn: #'clj-http.core/request: java.lang.IllegalStateException
java.lang.IllegalStateException: Attempting to call unbound fn: #'clj-http.core/request
at clojure.lang.Var$Unbound.throwArity(Var.java:45)
at clojure.lang.AFn.invoke(AFn.java:32)
at clojure.lang.Var.invoke(Var.java:381)
at clj_http.client$wrap_request_timing$fn__4812.invoke(client.clj:1046)
at clj_http.client$wrap_async_pooling$fn__4820.invoke(client.clj:1079)
at clj_http.headers$wrap_header_map$fn__2936.invoke(headers.clj:147)
at clj_http.client$wrap_query_params$fn__4700.invoke(client.clj:806)
at clj_http.client$wrap_basic_auth$fn__4706.invoke(client.clj:829)
at clj_http.client$wrap_oauth$fn__4711.invoke(client.clj:846)
at clj_http.client$wrap_user_info$fn__4720.invoke(client.clj:866)
at clj_http.client$wrap_url$fn__4794.invoke(client.clj:998)
at clj_http.client$wrap_decompression$fn__4471.invoke(client.clj:414)
at clj_http.client$wrap_input_coercion$fn__4624.invoke(client.clj:626)
at clj_http.client$wrap_additional_header_parsing$fn__4649.invoke(client.clj:681)
at clj_http.client$wrap_output_coercion$fn__4611.invoke(client.clj:570)
at clj_http.client$wrap_exceptions$fn__4418.invoke(client.clj:248)
at clj_http.client$wrap_accept$fn__4664.invoke(client.clj:724)
at clj_http.client$wrap_accept_encoding$fn__4671.invoke(client.clj:746)
at clj_http.client$wrap_content_type$fn__4658.invoke(client.clj:707)
at clj_http.client$wrap_form_params$fn__4767.invoke(client.clj:948)
at clj_http.client$wrap_nested_params$fn__4789.invoke(client.clj:983)
at clj_http.client$wrap_method$fn__4725.invoke(client.clj:882)
at clj_http.cookies$wrap_cookies$fn__1825.invoke(cookies.clj:131)
at clj_http.links$wrap_links$fn__3248.invoke(links.clj:63)
at clj_http.client$wrap_unknown_host$fn__4797.invoke(client.clj:1009)
at clj_http.client$request_STAR_.invokeStatic(client.clj:1181)
at clj_http.client$request_STAR_.invoke(client.clj:1174)
at clj_http.client$get.invokeStatic(client.clj:1187)
at clj_http.client$get.doInvoke(client.clj:1183)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at port.core$handler.invokeStatic(core.clj:61)
at port.core$handler.invoke(core.clj:56)
at portkey.core$mount_ring_BANG_$wrap__17167.invoke(core.clj:705)
at portkey.LambdaStub.handleRequest(LambdaStub.java:33
with this code
(defn handler
[request]
(response/response (client/get "<http://thecatapi.com/api/images/get?format=xml&results_per_page=20>")))
hum, does it work with with older clojure, say 1.9.0-alpha19?
I don’t know but I just reproduced @baptiste-from-paris error
neat
and I checked clojure, no change around require handling
reproducible errors are warm and fuzzy
@viesti nope, same error
just to be sure, portkey
only loads java class right ? For example, if you take the google-api-client
, you have the key store which is store in a jks file and called like this =>
public static synchronized KeyStore getCertificateTrustStore()
throws IOException, GeneralSecurityException {
if (certTrustStore == null) {
certTrustStore = SecurityUtils.getJavaKeyStore();
InputStream keyStoreStream = GoogleUtils.class.getResourceAsStream("google.jks");
SecurityUtils.loadKeyStore(certTrustStore, keyStoreStream, "notasecret");
}
return certTrustStore;
}
it’s not found offcourse ^^, right ?
It should be found
We really need a verbose mode for packaging
ok, it’s not, at least keyStore is empty in lambda, working locally
by the way, you call keeps like that right ? => (pk/mount-ring! #'handler :keeps ["file1" "file2"])
yes, a set may be more descriptive, so #{"path/to/resource-on-classpath"}
for now, you can download the lambda zip to check that resource is there
no, being lazy 🙂 Maybe option for keeping the zip locally?
done that and it was not working
done some modifications
cause it seq’ like this (#{“path”}) so the (into {} (comp fn*)
returns nil
I am not sure if I am right
but it’s working for me
no client/core
You want us to step outside of the comfort or our repl? Never!
(wrap-request #'core/request)
a new trick to teach to the abstract interpreter
maybe this could even be behind a dynamic var, to look for new analysis at the repl: https://github.com/portkey-cloud/portkey/blob/master/src/main/clojure/portkey/analysis.clj#L112
analysis.clj is used for what ?
sorry again, but I got this new error that I never saw
Error loading class portkey.LambdaStub: java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
Caused by: com.esotericsoftware.kryo.KryoException: java.lang.IllegalStateException
Serialization trace:
provider (java.security.SecureRandom)
secureRandom (sun.security.ssl.SSLContextImpl$TLSContext)
contextSpi (javax.net.ssl.SSLContext)
sslContext (org.apache.http.nio.conn.ssl.SSLIOSessionStrategy)
map (org.apache.http.config.Registry)
at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:144)
at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:540)
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:731)
at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125)
at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:540)
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:731)
at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125)
at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:540)
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:731)
at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125)
at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:540)
at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:813)
at com.esotericsoftware.kryo.serializers.MapSerializer.read(MapSerializer.java:161)
at com.esotericsoftware.kryo.serializers.MapSerializer.read(MapSerializer.java:39)
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:731)
at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125)
at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:540)
at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:813)
at carbonite.serializer$mk_collection_reader$fn__190.invoke(serializer.clj:57)
at clojure.lang.Var.invoke(Var.java:385)
at carbonite.ClojureVecSerializer.read(ClojureVecSerializer.java:17)
at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:813)
at portkey.kryo$unfreeze.invokeStatic(kryo.clj:91)
at portkey.kryo$unfreeze.invoke(kryo.clj:87)
at portkey.core$bootstrap$fn__16755.invoke(core.clj:189)
at portkey.LambdaStub.<clinit>(LambdaStub.java:23)
... 2 more
Caused by: java.lang.IllegalStateException
at java.security.Provider.checkInitialized(Provider.java:650)
at java.security.Provider.check(Provider.java:655)
at java.security.Provider.put(Provider.java:317)
at com.esotericsoftware.kryo.serializers.MapSerializer.read(MapSerializer.java:162)
at com.esotericsoftware.kryo.serializers.MapSerializer.read(MapSerializer.java:39)
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:731)
at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125)
I am pretty sure it’s generated by this line => (ring.util.codec/form-decode body)
because it happened just after I added it
@baptiste-from-paris thanks for trying it’s really really useful
Analysis is about interpreting dynamic patterns used with mostly static arguments to get information on classes or Vars they may require
I think I can become addict to port key 😂! Would be awesome to connect a repl somehow
My guess was wrong: our Kryo var serializer doesn’t kick in.