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

[BUG] BackendApiHandlerV2 lambda function failing to stabilize #653

Open
cusackeoin opened this issue Dec 18, 2024 · 2 comments
Open

[BUG] BackendApiHandlerV2 lambda function failing to stabilize #653

cusackeoin opened this issue Dec 18, 2024 · 2 comments

Comments

@cusackeoin
Copy link

cusackeoin commented Dec 18, 2024

🚨 Please Note 🚨

To ensure efficient investigation of the issue, please fill out the fields below with as much detail as possible. Reports that do not follow this template may be closed without notification. We appreciate your cooperation.

Describe the bug

I'm deploying the application to an aws account in us-east-1, I'm running this from my local (not through cloudshell) using cdk deploy --require-approval never --all

While deploying the BedrockChatStack I'm hitting the following issue:

  • BedrockChatStack | 11:43:53 | CREATE_FAILED | AWS::Lambda::Version | BackendApi/HandlerV2/CurrentVersion (BackendApiHandlerV2CurrentVersion28FAABFCab799a485617eb22be6de9714fee4547) Resource handler returned message: "Resource of type 'AWS::Lambda::Version' with identifier 'arn:aws:lambda:us-east-1:485442427944:function:BedrockChatStack-BackendApiHandlerV263FCB936-91dafWH7nnRI:1' did not stabilize. Status Reason is An error occurred during function initialization." (RequestToken: 14808d81-45c0-938a-bd13-167a30aeb286, HandlerErrorCode: NotStabilized)

Looking at the lambda logs in cloudwatch its saying the run.sh file cannot be found

  • 2024-12-18T11:43:25.184Z | INIT_START Runtime Version: python:3.12.v38 Runtime Version ARN: arn:aws:lambda:us-east-1::runtime:7515e00d6763496e7a147ffa395ef5b0f0c1ffd6064130abb5ecde5a6d630e86
  • | 2024-12-18T11:43:25.243Z | /opt/bootstrap: line 3: /var/task/run.sh: cannot execute: required file not found
  • | 2024-12-18T11:43:25.243Z | EXTENSION Name: lambda-adapter State: Ready Events: []
  • | 2024-12-18T11:43:25.243Z | INIT_REPORT Init Duration: 59.22 ms Phase: init Status: error Error Type: Runtime.ExitError

I understand the code matches the example that is used on the library 'fastapi-zip' that is used here:
https://github.com/awslabs/aws-lambda-web-adapter/tree/main/examples/fastapi-zip

so I cannot understand why it is failing.

To Reproduce

  • Using the latest version on git
  • I have docker desktop running to allow docker to build
  • run cdk deploy --require-approval never --all into the target account
  • error is output to the terminal

Screenshots

image

When viewing the lambda function before it gets deleted I can see the files in the directory look correct:
image

Additional context

Seems to be failing since the merge 3 weeks ago #611

@axelpina
Copy link

Did you try setting the enableLambdaSnapStart flag to false in cdk.json?

@cusackeoin
Copy link
Author

No joy @axelpina - I added it to test and I got the same result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants