FieryCod / holy-lambda

The extraordinary simple, performant, and extensible custom AWS Lambda runtime for Clojure.
https://fierycod.github.io/holy-lambda
MIT License
342 stars 20 forks source link

[BUG] Issue building/deploying #60

Closed ryanechternacht closed 3 years ago

ryanechternacht commented 3 years ago

Describe the bug I'm following the steps laid out in the tutorial, but I'm getting the following error while running (in both docker and on Lambda) Method setDoOutput on class sun.net.www.protocol.http.HttpURLConnection not allowed!.

Full error locally

[holy-lambda] Command <stack:invoke>
Invoking school.yardstick.jobs.core.ExampleLambda (provided)
arn:aws:lambda:us-east-1:705159276995:layer:holy-lambda-babashka-runtime:1 is already cached. Skipping download
Skip pulling image and use local one: samcli/lambda:provided-ce5d90f5a0a163c2b5000f7db.

Mounting /Users/ryan/github/school-yardstick-jobs/src as /var/task:ro,delegated inside runtime container
START RequestId: 21090918-8ff9-420e-99d3-e82115f3183e Version: $LATEST
----- Error --------------------------------------------------------------------
Type:     clojure.lang.ExceptionInfo
Message:  Method setDoOutput on class sun.net.www.protocol.http.HttpURLConnection not allowed!

time="2021-07-01T04:00:24.881" level=error msg="Init failed" InvokeID= error="Runtime exited with error: exit status 1"
time="2021-07-01T04:00:24.881" level=error msg="INIT DONE failed: Runtime.ExitError"

Full error on Lambda

Function Logs
START RequestId: 63eb643c-0908-4693-8289-87debb9c9616 Version: $LATEST
----- Error --------------------------------------------------------------------
Type:     clojure.lang.ExceptionInfo
Message:  Method setDoOutput on class sun.net.www.protocol.http.HttpURLConnection not allowed!

END RequestId: 63eb643c-0908-4693-8289-87debb9c9616
REPORT RequestId: 63eb643c-0908-4693-8289-87debb9c9616  Duration: 399.37 ms Billed Duration: 400 ms Memory Size: 256 MB Max Memory Used: 39 MB  
RequestId: 63eb643c-0908-4693-8289-87debb9c9616 Error: Runtime exited with error: exit status 1
Runtime.ExitError

To Reproduce AFAICT, I'm following the tutorial exactly as-is.

Expected behavior I'm not expecting this error.

Extra information:

[holy-lambda] --------------------------------------- [holy-lambda] Checking health of holy-lambda stack [holy-lambda] Home directory is: /Users/ryan [holy-lambda] Project directory is: /Users/ryan/github/school-yardstick-jobs [holy-lambda] AWS SAM version: SAM CLI, version 1.24.1 [holy-lambda] AWS CLI version: aws-cli/2.2.1 Python/3.8.8 Darwin/19.6.0 exe/x86_64 prompt/off [holy-lambda] AWS directory is: /Users/ryan/.aws [holy-lambda] AWS directory exists?: true [holy-lambda] Docker version: Docker version 20.10.7, build f0df350 [holy-lambda] Babashka tasks sha: 1c814389a321e295fd8c214ce3a541980e818fc3 [holy-lambda] Babashka tasks version: 0.1.49 [holy-lambda] Babashka version: babashka v0.4.6 [holy-lambda] Runtime: :babashka [holy-lambda] Runtime entrypoint: school.yardstick.jobs.core [holy-lambda] Stack name: jobs-fb5383-stack [holy-lambda] S3 Bucket name: jobs-fb5383 [holy-lambda] S3 Bucket prefix: holy-lambda [holy-lambda] S3 Bucket exists?: true [holy-lambda] ---------------------------------------

[holy-lambda] :runtime looks good [holy-lambda] :runtime:entrypoint looks good [holy-lambda] :stack:capabilities looks good [holy-lambda] :runtime:bootstrap-file is supported only for :native runtime [holy-lambda] :runtime:native-deps is supported only for :native runtime [holy-lambda] :runtime:native-image-args are supported only for :native runtime [holy-lambda] :stack:name looks good [holy-lambda] property :mvn/local-repo in file deps.edn is correct [holy-lambda] property :mvn/local-repo in file bb.edn is correct [holy-lambda] Syncing stack is not required [holy-lambda] :infra:region definition looks good [holy-lambda] :infra:bucket-prefix looks good [holy-lambda] :stack:template looks good [holy-lambda] :infra:bucket-name looks good [holy-lambda] Required commands ["aws" "sam" "bb" "docker" "clojure" "zip" "id" "clj-kondo" "bash"] installed!

[holy-lambda] Validating template.yml 2021-07-01 00:02:59 Loading policies from IAM... 2021-07-01 00:03:01 Finished loading policies from IAM. /Users/ryan/github/school-yardstick-jobs/template.yml is a valid SAM Template

ryanechternacht commented 3 years ago

Thanks for looking at this. This framework seems dope and I'm hoping to use it!

FieryCod commented 3 years ago

@ryanechternacht For now change :runtime:version to 0.0.38, then run bb stack:sync and reference new layer ARN in template.yml. It seems like a regression in babashka.

FieryCod commented 3 years ago

@ryanechternacht Please retest with version 0.1.1 :)

EDIT: I have releases a new version of HL. You can update :runtime:version + tasks version to latest revisions :) Issue should be gone!

ryanechternacht commented 3 years ago

Worked like a charm. Thanks!