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
I am trying to invoke the sam local It throws an error of unsupported runtime java17.
Steps to reproduce:
command: sam local invoke "Function" -e src/test/resources/event/new-config-with-variant.json --debug
Observed result:
`X@INR-HQ-X mdm-product-sync % sam local invoke "Function" -e src/test/resources/event/new-config-with-variant.json --debug
2024-03-22 02:03:00,166 | Config file location: /Users/X/Documents/Flaconi/mdm-product-sync/samconfig.toml
2024-03-22 02:03:00,166 | Config file '/Users/X/Documents/Flaconi/mdm-product-sync/samconfig.toml' does not exist
2024-03-22 02:03:00,169 | Using SAM Template at /Users/X/Documents/Flaconi/mdm-product-sync/template.yml
2024-03-22 02:03:00,216 | Using config file: samconfig.toml, config environment: default
2024-03-22 02:03:00,216 | Expand command line arguments to:
2024-03-22 02:03:00,216 | --template_file=/Users/X/Documents/Flaconi/mdm-product-sync/template.yml --event=src/test/resources/event/new-config-with-variant.json --function_logical_id=Function --no_event --layer_cache_basedir=/Users/X/.aws-sam/layers-pkg --container_host=localhost --container_host_interface=127.0.0.1
2024-03-22 02:03:00,216 | local invoke command is called
2024-03-22 02:03:00,219 | No Parameters detected in the template
2024-03-22 02:03:00,308 | There is no customer defined id or cdk path defined for resource Function, so we will use the resource logical id as the resource id
2024-03-22 02:03:00,308 | 0 stacks found in the template
2024-03-22 02:03:00,308 | No Parameters detected in the template
2024-03-22 02:03:00,321 | There is no customer defined id or cdk path defined for resource Function, so we will use the resource logical id as the resource id
2024-03-22 02:03:00,321 | 1 resources found in the stack
2024-03-22 02:03:00,321 | Found Serverless function with name='Function' and CodeUri='build/distributions/mdm-product-sync-0.1.zip'
2024-03-22 02:03:00,321 | --base-dir is not presented, adjusting uri build/distributions/mdm-product-sync-0.1.zip relative to /Users/X/Documents/Flaconi/mdm-product-sync/template.yml
2024-03-22 02:03:04,491 | Found one Lambda function with name 'Function'
2024-03-22 02:03:04,491 | Invoking de.flaconi.ng.common.lambda.RequestStreamHandler::handleRequest (java17)
2024-03-22 02:03:04,491 | No environment variables found for function 'Function'
2024-03-22 02:03:04,491 | Loading AWS credentials from session with profile 'None'
2024-03-22 02:03:04,520 | Resolving code path. Cwd=/Users/X/Documents/Flaconi/mdm-product-sync, CodeUri=/Users/X/Documents/Flaconi/mdm-product-sync/build/distributions/mdm-product-sync-0.1.zip
2024-03-22 02:03:04,521 | Resolved absolute path to code is /Users/X/Documents/Flaconi/mdm-product-sync/build/distributions/mdm-product-sync-0.1.zip
2024-03-22 02:03:04,535 | Decompressing /Users/X/Documents/Flaconi/mdm-product-sync/build/distributions/mdm-product-sync-0.1.zip
2024-03-22 02:03:05,241 | Cleaning all decompressed code dirs
2024-03-22 02:03:05,382 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2024-03-22 02:03:05,576 | Sending Telemetry: {'metrics': [{'commandRun': {'requestId': 'xxxxx-c991-4576-8f93-64e30c5eb2f5', 'installationId': 'xxxxx-f983-4fe7-94e3-f9687820198b', 'sessionId': 'xxxxxx-c4e3-4d09-b29d-9fe718d52b49', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.8.13', 'samcliVersion': '1.76.0', 'awsProfileProvided': False, 'debugFlagProvided': True, 'region': '', 'commandName': 'sam local invoke', 'metricSpecificAttributes': {'projectType': 'CFN', 'gitOrigin': None, 'projectName': 'xxxx40c8e23b5dfbe74a5a67aed6fa154xxxxxxxx8e3adec61', 'initialCommit': None}, 'duration': 5166, 'exitReason': 'ValueError', 'exitCode': 255}}]}
2024-03-22 02:03:06,116 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)
Error: Unsupported Lambda runtime java17
Traceback:
File "click/core.py", line 1055, in main
File "click/core.py", line 1657, in invoke
File "click/core.py", line 1657, in invoke
File "click/core.py", line 1404, in invoke
File "click/core.py", line 760, in invoke
File "click/decorators.py", line 84, in new_func
File "click/core.py", line 760, in invoke
File "samcli/lib/telemetry/metric.py", line 183, in wrapped
File "samcli/lib/telemetry/metric.py", line 148, in wrapped
File "samcli/lib/utils/version_checker.py", line 42, in wrapped
File "samcli/cli/main.py", line 92, in wrapper
File "samcli/commands/local/invoke/cli.py", line 96, in cli
File "samcli/commands/local/invoke/cli.py", line 203, in do_cli
File "samcli/commands/local/lib/local_lambda.py", line 144, in invoke
File "samcli/lib/telemetry/metric.py", line 323, in wrapped_func
File "samcli/local/lambdafn/runtime.py", line 189, in invoke
File "samcli/local/lambdafn/runtime.py", line 85, in create
File "samcli/local/docker/lambda_container.py", line 92, in init
Hey @mharisahmed, it looks like you might be using an outdated version of SAM CLI. Can you update to the latest version and see if that resolves your issue?
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
Description:
I am trying to invoke the sam local It throws an error of unsupported runtime java17.
Steps to reproduce:
command: sam local invoke "Function" -e src/test/resources/event/new-config-with-variant.json --debug
Observed result:
`X@INR-HQ-X mdm-product-sync % sam local invoke "Function" -e src/test/resources/event/new-config-with-variant.json --debug
2024-03-22 02:03:00,166 | Config file location: /Users/X/Documents/Flaconi/mdm-product-sync/samconfig.toml
2024-03-22 02:03:00,166 | Config file '/Users/X/Documents/Flaconi/mdm-product-sync/samconfig.toml' does not exist
2024-03-22 02:03:00,169 | Using SAM Template at /Users/X/Documents/Flaconi/mdm-product-sync/template.yml
2024-03-22 02:03:00,216 | Using config file: samconfig.toml, config environment: default
2024-03-22 02:03:00,216 | Expand command line arguments to:
2024-03-22 02:03:00,216 | --template_file=/Users/X/Documents/Flaconi/mdm-product-sync/template.yml --event=src/test/resources/event/new-config-with-variant.json --function_logical_id=Function --no_event --layer_cache_basedir=/Users/X/.aws-sam/layers-pkg --container_host=localhost --container_host_interface=127.0.0.1
2024-03-22 02:03:00,216 | local invoke command is called
2024-03-22 02:03:00,219 | No Parameters detected in the template
2024-03-22 02:03:00,308 | There is no customer defined id or cdk path defined for resource Function, so we will use the resource logical id as the resource id
2024-03-22 02:03:00,308 | 0 stacks found in the template
2024-03-22 02:03:00,308 | No Parameters detected in the template
2024-03-22 02:03:00,321 | There is no customer defined id or cdk path defined for resource Function, so we will use the resource logical id as the resource id
2024-03-22 02:03:00,321 | 1 resources found in the stack
2024-03-22 02:03:00,321 | Found Serverless function with name='Function' and CodeUri='build/distributions/mdm-product-sync-0.1.zip'
2024-03-22 02:03:00,321 | --base-dir is not presented, adjusting uri build/distributions/mdm-product-sync-0.1.zip relative to /Users/X/Documents/Flaconi/mdm-product-sync/template.yml
2024-03-22 02:03:04,491 | Found one Lambda function with name 'Function'
2024-03-22 02:03:04,491 | Invoking de.flaconi.ng.common.lambda.RequestStreamHandler::handleRequest (java17)
2024-03-22 02:03:04,491 | No environment variables found for function 'Function'
2024-03-22 02:03:04,491 | Loading AWS credentials from session with profile 'None'
2024-03-22 02:03:04,520 | Resolving code path. Cwd=/Users/X/Documents/Flaconi/mdm-product-sync, CodeUri=/Users/X/Documents/Flaconi/mdm-product-sync/build/distributions/mdm-product-sync-0.1.zip
2024-03-22 02:03:04,521 | Resolved absolute path to code is /Users/X/Documents/Flaconi/mdm-product-sync/build/distributions/mdm-product-sync-0.1.zip
2024-03-22 02:03:04,535 | Decompressing /Users/X/Documents/Flaconi/mdm-product-sync/build/distributions/mdm-product-sync-0.1.zip
2024-03-22 02:03:05,241 | Cleaning all decompressed code dirs
2024-03-22 02:03:05,382 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2024-03-22 02:03:05,576 | Sending Telemetry: {'metrics': [{'commandRun': {'requestId': 'xxxxx-c991-4576-8f93-64e30c5eb2f5', 'installationId': 'xxxxx-f983-4fe7-94e3-f9687820198b', 'sessionId': 'xxxxxx-c4e3-4d09-b29d-9fe718d52b49', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.8.13', 'samcliVersion': '1.76.0', 'awsProfileProvided': False, 'debugFlagProvided': True, 'region': '', 'commandName': 'sam local invoke', 'metricSpecificAttributes': {'projectType': 'CFN', 'gitOrigin': None, 'projectName': 'xxxx40c8e23b5dfbe74a5a67aed6fa154xxxxxxxx8e3adec61', 'initialCommit': None}, 'duration': 5166, 'exitReason': 'ValueError', 'exitCode': 255}}]}
2024-03-22 02:03:06,116 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)
Error: Unsupported Lambda runtime java17
Traceback:
File "click/core.py", line 1055, in main
File "click/core.py", line 1657, in invoke
File "click/core.py", line 1657, in invoke
File "click/core.py", line 1404, in invoke
File "click/core.py", line 760, in invoke
File "click/decorators.py", line 84, in new_func
File "click/core.py", line 760, in invoke
File "samcli/lib/telemetry/metric.py", line 183, in wrapped
File "samcli/lib/telemetry/metric.py", line 148, in wrapped
File "samcli/lib/utils/version_checker.py", line 42, in wrapped
File "samcli/cli/main.py", line 92, in wrapper
File "samcli/commands/local/invoke/cli.py", line 96, in cli
File "samcli/commands/local/invoke/cli.py", line 203, in do_cli
File "samcli/commands/local/lib/local_lambda.py", line 144, in invoke
File "samcli/lib/telemetry/metric.py", line 323, in wrapped_func
File "samcli/local/lambdafn/runtime.py", line 189, in invoke
File "samcli/local/lambdafn/runtime.py", line 85, in create
File "samcli/local/docker/lambda_container.py", line 92, in init
An unexpected error was encountered while executing "sam local invoke".
Search for an existing issue:
https://github.com/aws/aws-sam-cli/issues?q=is%3Aissue+is%3Aopen+Bug%3A%20sam%20local%20invoke%20-%20ValueError
Or create a bug report:
https://github.com/aws/aws-sam-cli/issues/new?template=Bug_report.md&title=Bug%3A%20sam%20local%20invoke%20-%20ValueError
`
Expected result:
Should have invoked lambda locally as it was supposed to do with runtime java11
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
operating system: MAC
python version: 3.10.9
Java: 17.0.10
sam --version
:The text was updated successfully, but these errors were encountered: