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
sudo NODE_ENV=local sam local start-api --docker-network example --warm-containers LAZY --port 3001 --invoke-image layer:latest --skip-pull-image --debug
Observed result:
sudo NODE_ENV=local sam local start-api --docker-network example --warm-containers LAZY --port 3001 --invoke-image layer:latest --skip-pull-image --debug
2024-01-28 18:18:09,692 | No config file found in this directory.
2024-01-28 18:18:09,693 | OSError occurred while reading TOML file: [Errno 2] No such file or directory:
'/Users/user/Developer/example/samconfig.toml'
2024-01-28 18:18:09,694 | Config file location: /Users/user/Developer/example/samconfig.toml
2024-01-28 18:18:09,694 | Config file '/Users/user/Developer/example/samconfig.toml' does not exist
2024-01-28 18:18:09,717 | Using SAM Template at /Users/user/Developer/example/template.yaml
2024-01-28 18:18:09,727 | OSError occurred while reading TOML file: [Errno 2] No such file or directory:
'/Users/user/Developer/example/samconfig.toml'
2024-01-28 18:18:09,727 | Using config file: samconfig.toml, config environment: default
2024-01-28 18:18:09,728 | Expand command line arguments to:
2024-01-28 18:18:09,728 | --template_file=/Users/user/Developer/example/template.yaml --docker_network=example
--warm_containers=LAZY --port=3001 --invoke_image=('layer:latest',) --skip_pull_image --host=127.0.0.1 --static_dir=public
--layer_cache_basedir=/Users/user/.aws-sam/layers-pkg --container_host=localhost --container_host_interface=127.0.0.1
2024-01-28 18:18:09,760 | local start-api command is called
2024-01-28 18:18:09,782 | Collected default values for parameters: {'NodeEnv': 'default', 'AwsRegion': 'default', 'AppEnv': 'default', 'SGid': 'default', 'SubnetIds':
'default'}
2024-01-28 18:18:09,874 | There is no customer defined id or cdk path defined for resource SwaggerFunction, so we will use the resource logical id as the resource id
2024-01-28 18:18:09,875 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2024-01-28 18:18:09,896 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2024-01-28 18:18:09,897 | Sending Telemetry: {'metrics': [{'commandRun': {'requestId': '8ed38610-962c-4be2-bc21-5cc2675be072', 'installationId':
'344747cd-700b-4bee-8dac-34f8b13d989a', 'sessionId': 'f5b30a7f-a0ca-4f61-ae82-fce0c0e8ba35', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.12.1',
'samcliVersion': '1.108.0', 'awsProfileProvided': False, 'debugFlagProvided': True, 'region': '', 'commandName': 'sam local start-api', 'metricSpecificAttributes':
{'projectType': 'CFN', 'gitOrigin': None, 'projectName': '082b0254afae42a837982ff34d7cdbbeafb7a9135ec70c6a47232e51b2147d47', 'initialCommit': None}, 'duration': 147,
'exitReason': 'AttributeError', 'exitCode': 255}}]}
2024-01-28 18:18:09,897 | Unable to find Click Context for getting session_id.
2024-01-28 18:18:09,899 | Sending Telemetry: {'metrics': [{'events': {'requestId': '6e2bd5c2-7853-444d-a7d6-d7347e9ee80e', 'installationId':
'344747cd-700b-4bee-8dac-34f8b13d989a', 'sessionId': 'f5b30a7f-a0ca-4f61-ae82-fce0c0e8ba35', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.12.1',
'samcliVersion': '1.108.0', 'commandName': 'sam local start-api', 'metricSpecificAttributes': {'events': [{'event_name': 'SamConfigFileExtension', 'event_value':
'.toml', 'thread_id': 'a2c52a5a6f7242a1b3d70b87d4a92faf', 'time_stamp': '2024-01-28 16:18:09.694', 'exception_name': None}, {'event_name': 'SamConfigFileExtension',
'event_value': '.toml', 'thread_id': 'cc72116ef58a442da6761155af27aec6', 'time_stamp': '2024-01-28 16:18:09.727', 'exception_name': None}]}}}]}
2024-01-28 18:18:10,607 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)
2024-01-28 18:18:10,610 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)
Error: 'NoneType' object has no attribute 'get'
Traceback:
File "/opt/homebrew/opt/python-click/lib/python3.12/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/opt/homebrew/opt/python-click/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/opt/python-click/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/opt/python-click/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/opt/python-click/lib/python3.12/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.108.0/libexec/lib/python3.12/site-packages/samcli/cli/cli_config_file.py", line 347, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/opt/python-click/lib/python3.12/site-packages/click/decorators.py", line 92, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/opt/python-click/lib/python3.12/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.108.0/libexec/lib/python3.12/site-packages/samcli/lib/telemetry/metric.py", line 184, in wrapped
raise exception # pylint: disable=raising-bad-type
^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.108.0/libexec/lib/python3.12/site-packages/samcli/lib/telemetry/metric.py", line 149, in wrapped
return_value = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.108.0/libexec/lib/python3.12/site-packages/samcli/lib/utils/version_checker.py", line 42, in wrapped
actual_result = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.108.0/libexec/lib/python3.12/site-packages/samcli/cli/main.py", line 95, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.108.0/libexec/lib/python3.12/site-packages/samcli/commands/local/start_api/cli.py", line 150, in cli
do_cli(
File "/opt/homebrew/Cellar/aws-sam-cli/1.108.0/libexec/lib/python3.12/site-packages/samcli/commands/local/start_api/cli.py", line 232, in do_cli
with InvokeContext(
File "/opt/homebrew/Cellar/aws-sam-cli/1.108.0/libexec/lib/python3.12/site-packages/samcli/commands/local/cli_common/invoke_context.py", line 220, in __enter__
self._stacks = self._get_stacks()
^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.108.0/libexec/lib/python3.12/site-packages/samcli/commands/local/cli_common/invoke_context.py", line 466, in _get_stacks
stacks, _ = SamLocalStackProvider.get_stacks(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.108.0/libexec/lib/python3.12/site-packages/samcli/lib/providers/sam_stack_provider.py", line 269, in get_stacks
current = SamLocalStackProvider(
^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.108.0/libexec/lib/python3.12/site-packages/samcli/lib/providers/sam_stack_provider.py", line 61, in __init__
self._template_dict = self.get_template(
^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.108.0/libexec/lib/python3.12/site-packages/samcli/lib/providers/sam_base_provider.py", line 194, in get_template
ResourceMetadataNormalizer.normalize(template_dict)
File "/opt/homebrew/Cellar/aws-sam-cli/1.108.0/libexec/lib/python3.12/site-packages/samcli/lib/samlib/resource_metadata_normalizer.py", line 97, in normalize
{SAM_RESOURCE_ID_KEY: ResourceMetadataNormalizer.get_resource_id(resource, logical_id)},
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/aws-sam-cli/1.108.0/libexec/lib/python3.12/site-packages/samcli/lib/samlib/resource_metadata_normalizer.py", line 232, in get_resource_id
customer_defined_id = resource_metadata.get(SAM_RESOURCE_ID_KEY)
^^^^^^^^^^^^^^^^^^^^^
An unexpected error was encountered while executing "sam local start-api".
Search for an existing issue:
https://github.com/aws/aws-sam-cli/issues?q=is%3Aissue+is%3Aopen+Bug%3A%20sam%20local%20start-api%20-%20AttributeError
Or create a bug report:
https://github.com/aws/aws-sam-cli/issues/new?template=Bug_report.md&title=Bug%3A%20sam%20local%20start-api%20-%20AttributeError
Expected result:
it works
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
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.
Error: 'NoneType' object has no attribute 'get'
Description:
switched from linux to macOS M3, installed sam
Steps to reproduce:
sudo NODE_ENV=local sam local start-api --docker-network example --warm-containers LAZY --port 3001 --invoke-image layer:latest --skip-pull-image --debug
Observed result:
Expected result:
it works
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --info
:The text was updated successfully, but these errors were encountered: