cljs-lambda icon indicating copy to clipboard operation
cljs-lambda copied to clipboard

Cannot deploy twice

Open conan opened this issue 5 years ago • 2 comments

The second time I run lein cljs-lambda deploy I always get this error:

Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('X' (code 88)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')

The unexpected character in question is always the first character of the output from the previous aws lambda get-function-configuration command:

aws lambda get-function-configuration --function-name referralbot-slash-command
XlWc1<snip>Omy8=    905749          arn:aws:lambda:eu-west-1:1<snip>4:function:referralbot-slash-command        referralbot-slash-command       index.referralbot_core_SLASH_slash_command      2018-09-27T11:43:22.641+0000    128     arn:aws:iam::1<snip>4:rol
                        nodejs4.3       3       $LATEST

I've tried running the aws configure command as suggested in #99, and have tried re-installing it too, but it didn't help. Here's the full stack trace. At the moment I have to delete the function in Lambda before lein cljs-lambda deploy will work again, which isn't an ideal workflow. Any ideas?

aws --version
aws-cli/1.11.13 Python/3.5.2 Linux/4.4.0-17134-Microsoft botocore/1.4.70

conan avatar Sep 28 '18 11:09 conan

OK, just noticed that cheshire is mentioned in the output and therefore figured out that cljs-lambda requires aws configure to have the output set to json rather than text.

I've sent a PR to mention this in the docs.

conan avatar Sep 28 '18 12:09 conan

https://github.com/nervous-systems/cljs-lambda/blob/master/plugin/src/leiningen/cljs_lambda/aws.clj#L143 should rather do(->cli-args {:name name :output "json"})

moea avatar Oct 04 '18 16:10 moea