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

Deno.serve timeouts on AWS lambda #26947

Open
piotrgrundas opened this issue Nov 20, 2024 · 0 comments
Open

Deno.serve timeouts on AWS lambda #26947

piotrgrundas opened this issue Nov 20, 2024 · 0 comments
Labels
needs investigation requires further investigation before determining if it is an issue or not

Comments

@piotrgrundas
Copy link

piotrgrundas commented Nov 20, 2024

Version: Deno 2.0.6

I'm trying to deploy a complied deno project into AWS Lambda. I'm using Hono, and in the docs, they are using Deno.serve.
The problem is that lambda timeouts and returns Internal Server Error.

After investigating the problem it seems that the Deno.serve is causing this.

In the log I can see:

2024-11-20T09:22:13.960Z | Listening on http://0.0.0.0:8000/
2024-11-20T09:22:22.838Z | EXTENSION Name: lambda-adapter State: Ready Events: []
2024-11-20T09:22:22.838Z | INIT_REPORT Init Duration: 9999.92 ms Phase: init Status: timeout

Steps:

  1. Create a main.ts with Deno.serve((req) => new Response("Hello World!"));
  2. Build & deploy the app:
deno compile -A --target x86_64-unknown-linux-gnu --no-check -o bootstrap main.ts && chmod +x ./bootstrap && zip -r -D artifact.zip bootstrap && aws lambda update-function-code --region eu-central-1 --function-name deno-compiled --zip-file fileb://artifact.zip
  1. Remember to add lambda layer adapter arn:aws:lambda:eu-central-1:753240598075:layer:LambdaAdapterLayerX86:23.

I know there is a dockerised approach for deploying Deno, but I don't want to use it because it uses too much memory.

If you take an oak example from aws-lambda-web-adapter examples, compile it, and deploy it to AWS Lambda - it works.

@nathanwhit nathanwhit added the needs investigation requires further investigation before determining if it is an issue or not label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation requires further investigation before determining if it is an issue or not
Projects
None yet
Development

No branches or pull requests

2 participants