Open AidanOB opened 2 months ago
Hi @AidanOB, thanks for reporting the issue and providing details. I will try to reproduce the issue.
Can you check if sam local invoke
is able to initialize the containers for you and invoke the lambdas?
Unfortunately the containers don't initialise either. Regular output is just no response on the terminal.
With the -debug flag set:
2024-08-06 10:49:37,750 | Config file location: /var/home/user/hello-world-tutorial/samconfig.toml
2024-08-06 10:49:37,753 | Loading configuration values from [default.['local', 'invoke'].parameters] (env.command_name.section) in
config file at '/var/home/user/hello-world-tutorial/samconfig.toml'...
2024-08-06 10:49:37,754 | Configuration values successfully loaded.
2024-08-06 10:49:37,754 | Configuration values are: {'stack_name': 'hello-world-tutorial'}
2024-08-06 10:49:37,757 | Using SAM Template at /var/home/user/hello-world-tutorial/.aws-sam/build/template.yaml
2024-08-06 10:49:37,834 | Using config file: samconfig.toml, config environment: default
2024-08-06 10:49:37,835 | Expand command line arguments to:
2024-08-06 10:49:37,835 | --template_file=/var/home/user/hello-world-tutorial/.aws-sam/build/template.yaml --no_event
--layer_cache_basedir=/home/user/.aws-sam/layers-pkg --container_host=localhost --container_host_interface=127.0.0.1
2024-08-06 10:49:37,836 | local invoke command is called
2024-08-06 10:49:39,126 | No Parameters detected in the template
2024-08-06 10:49:39,168 | Sam customer defined id is more priority than other IDs. Customer defined id for resource
HelloWorldFunction is HelloWorldFunction
2024-08-06 10:49:39,170 | There is no customer defined id or cdk path defined for resource ServerlessRestApi, so we will use the
resource logical id as the resource id
2024-08-06 10:49:39,173 | 0 stacks found in the template
2024-08-06 10:49:39,174 | No Parameters detected in the template
2024-08-06 10:49:39,204 | Sam customer defined id is more priority than other IDs. Customer defined id for resource
HelloWorldFunction is HelloWorldFunction
2024-08-06 10:49:39,206 | There is no customer defined id or cdk path defined for resource ServerlessRestApi, so we will use the
resource logical id as the resource id
2024-08-06 10:49:39,208 | 2 resources found in the stack
2024-08-06 10:49:39,209 | Found Serverless function with name='HelloWorldFunction' and CodeUri='HelloWorldFunction'
2024-08-06 10:49:39,211 | --base-dir is not presented, adjusting uri HelloWorldFunction relative to
/var/home/user/hello-world-tutorial/.aws-sam/build/template.yaml
Further behaviour I have discovered, but intermittently (so unable to reliably reproduce) is that the lambdas will initialise if I do other things with toolbox/podman. Sometimes making or entering a new toolbox will trigger the initialisation of the lambdas. Or making another container. But this has only happened once or twice and not exactly sure what I did at the time that caused the lambdas in the other container to suddenly initialise.
I'm experiencing something similar.
The sam
commands (either sam local start-api
or sam local invoke
) simply hang indefinitely, until I would run something like podman run hello-world
in a separate shell.
Somehow this allows the sam process to continue and everything works as expected.
Environment details: podman version 5.2.0 macOS Sonoma Version 14.5 SAM CLI, version 1.121.0
Description:
When attempting to run
sam local start-api
from within podman/toolbox on Fedora 40 Kinoite, the lambda function containers fail to initialise. Command hangs for over an hour (at least) without initialising containers. On one occassion, when left overnight it initialised the container and was ready to be called.To test, utilised AWS Lambda powertools tutorial template found here: https://docs.powertools.aws.dev/lambda/python/latest/tutorial/#code-example
Output
Initializing the lambda functions containers.
Steps to reproduce:
Fedora 40 Kinoite -> Toolbox
Observed result:
Expected result:
Expected Lambda to initialise and be available.
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
OS: Fedora 40 Kinoite { "version": "1.120.0", "system": { "python": "3.11.8", "os": "Linux-6.9.10-200.fc40.x86_64-x86_64-with-glibc2.39" }, "additional_dependencies": { "docker_engine": "5.1.2", "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" ] }