You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Invoking app.app (python3.12)
Local image is up-to-date
Using local image: public.ecr.aws/lambda/python:3.12-rapid-x86_64.
Mounting ProjectFolder/aws/vk-aws-flask-testing/.aws-sam/build/HelloWorldFunction as /var/task:ro,delegated, inside runtime
container
START RequestId: 3ce5e5c2-4b90-410c-b117-c20db0700ec8 Version: $LATEST
{"timestamp": "2025-01-10T23:20:02Z", "log_level": "ERROR", "errorMessage": "Unable to import module 'app': No module named 'flask_lambda'", "errorType": "Runtime.ImportModuleError", "requestId": "", "stackTrace": []}
10 Jan 2025 23:20:02,509 [ERROR] (rapid) Init failed error=Runtime exited with error: exit status 1 InvokeID=
10 Jan 2025 23:20:02,514 [ERROR] (rapid) Invoke failed error=Runtime exited with error: exit status 1 InvokeID=2c5f0794-306b-4c16-baaa-7ed4411562b8
10 Jan 2025 23:20:02,515 [ERROR] (rapid) Invoke DONE failed: Sandbox.Failure
{"errorMessage": "Unable to import module 'app': No module named 'flask_lambda'", "errorType": "Runtime.ImportModuleError", "requestId": "", "stackTrace": []}
koteswarvijay@Vijays-MacBook-Air vk-aws-flask-testing %
sam -info output:
{
"version": "1.132.0",
"system": {
"python": "3.12.4",
"os": "macOS-12.7.6-x86_64-i386-64bit"
},
"additional_dependencies": {
"docker_engine": "27.4.0",
"aws_cdk": "Not available",
"terraform": "Not available"
},
"available_beta_feature_env_vars": [
"SAM_CLI_BETA_FEATURES",
"SAM_CLI_BETA_BUILD_PERFORMANCE",
"SAM_CLI_BETA_TERRAFORM_SUPPORT",
"SAM_CLI_BETA_RUST_CARGO_LAMBDA"
]
}
Updated templates.yaml:
Resources:
HelloWorldFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
CodeUri: hello_world/
Handler: app.app
Runtime: python3.12
Architectures:
- x86_64
Events:
HelloWorld:
Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
Properties:
Path: /hello
Method: get
The text was updated successfully, but these errors were encountered:
Description: Created new sam project and replaced lambda_handler with flask_lambda. Unable to start the server due to various dependency issues.
Steps to reproduce:
Create new project with command:
sam init —name xxxx
Note: I can build and start the api.
Replace lambda_handler with flask_handler. Below is the code of app.py:
Updated templates.yaml:
The text was updated successfully, but these errors were encountered: