I just installed a portkey function via (pk/mount): I get error:
{"errorMessage":"Error loading class portkey.LambdaStub: clojure/lang/IFn","errorType":"java.lang.NoClassDefFoundError"}
my code is:
(defn flatter []
(str "hello world"))
(pk/mount! flatter "/hello")
Is there a wa I can manually inspect the zip/jar that was uploaded ?Yes
You can download it on the aws interface
But you won’t learn anything as it’s bytecode
Weird, on the AWs interface, I see a "clj-hello" (which is some other functikn I manually uploaded), but I don' see the "flatter / hello" function.
I want to open up the jar/zind see if Clojure/IFN .class is somewhere there.
You sure you are in the right region ?
I'm an idiot.
Was in wrong region.
Not an idiot, this happen ;-)
Do you still mount it from boot ?
Yeah, I have never tried mounting from lein.
cgrand sent in a patch, so I assumed mounting from boot works ....
Because lambdastub call the handler that aws is waiting for, it should be present
Oh
I had some personnal stuff last week so I won’t be able to work on portkey for an other week but even if there are still bugs, your function is working for me
100% sure
Awesome, thanks!
I will take this opportunity to to build a Cryptic-AWS-Error-Msg -> how-to-fix-it map 🙂
I will be back on business on Tuesday
Back from US ;-)?
@qqq that’s something that can be upgrade, how to shorten the error-message feedback loop
I downloaded my package (took a while to figure out the GUI). I run:
find . | grep Lambda
./com/amazonaws/services/lambda/runtime/LambdaLogger.class
./portkey/LambdaStub.class
so it appears that portkey/LambdaStub.class indeed is there.find clojure
clojure
clojure/java
clojure/java/api
clojure/java/api/Clojure.class
Hmm, is that supposed to happen ?I'm expecting to see clojure/foobar/IFn.class
Have you try to reboot your repl and re-mount it ?
I will try that right now.
Almost home. Enjoying traffic jams due to the start of fall holidays.
Hehe
@baptiste-from-paris: same issue; will now see if I can get mount to work via a lein repl
Ok, if it doesn’t pastebin your code and I’ll try
lein repl
nREPL server started on port 40198 on host 127.0.0.1 - <nrepl://127.0.0.1:40198>
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.9.0-beta2
OpenJDK 64-Bit Server VM 1.8.0_131-8u131-b11-2ubuntu1.16.04.3-b11
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e
user=> (require '[portkey.core :as pk])
WARNING: get-method already refers to: #'clojure.core/get-method in namespace: portkey.aws.apigateway, being replaced by: #'portkey.aws.apigateway/get-method
nil
user=> (defn ltalk [] (str "hello world"))
#'user/ltalk
user=> (pk/mount! ltalk "/hi")
NullPointerException portkey.ouroboros/bytecode (ouroboros.clj:227)
user=> (ltalk)
"hello world"
user=> (pk/mount! ltalk "/")
NullPointerException portkey.ouroboros/bytecode (ouroboros.clj:227)
weirdness; Lein gets an ouroboros NullPointerException ?
here is my project.clj:
cat project.clj
(defproject foobar "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "<http://example.com/FIXME>"
:license {:name "Eclipse Public License"
:url "<http://www.eclipse.org/legal/epl-v10.html>"}
:dependencies [[org.clojure/clojure "1.9.0-beta2"]
[portkey "0.1.0-SNAPSHOT"] ])
I'm going to go nuke ~/.m2 and retry all this.
Ok, let me try (and take a break from my bordeaux wine)
hmm, I just did a git pull, ouroboros was updated, perhaps I am facing an older bug
success: from lein repl, I got a clj function to mount 🙂
I don't knowif this issue is boot vs lein or "old code vs doing a git pull"
but once ~/.m2 is repopulated, I will test in boot repl
Oh nice !
I think the boot repl is tree shaking too much.
lein repl -- uploaded a 4.5 MB zip
boot repl -- uploladed a 1.5MB zip (earlier) and a 300k zip (now)
personnaly I rarely have mounting problem, it’s more error once mounted
so it's apparently shaking the tree soo hard clojure function classes are being shaken off
@qqq does not sound satisfying, I think Clojure itself is around 3MB
find lein | grep -i clojure ; echo "==" ; find boot | grep -i clojure
lein/clojure
lein/clojure/java
lein/clojure/java/api
lein/clojure/java/api/Clojure.class
lein/lib/clojure-1.9.0-beta2.jar
==
boot/clojure
boot/clojure/java
boot/clojure/java/api
boot/clojure/java/api/Clojure.class
I downloaded the lein / boot versions.The lein version includes clojure-...-.jar ; the boot version somehow does not.
I'm half tempted now to add the jar file into the boot version, and manually upload it 🙂
okay, I got the boot version to work
by copying over /lein-version/lib to /boot-version/lib , recreating the zip, and uploading it
I'm filing an issue on github.
nice !
@cgrand: ^-- welcome home gift for you 🙂
@baptiste-from-paris: thanks for the tip on downloading from aws // could not have debugged this without that
Ah gréât !
By the way, I can’t verify right now but I am pretty sure that you can download it with the api
@cgrand @baptiste-from-paris: i realize portkey is open source software with no SLA and the volunterr devs have lives of their own -- is there some hack I can use to get around this in boot? This is on the critical path of my work.
I just switched from boot to lein; this is no longer blocking me. 🙂