aws / aws-sam-cli

CLI tool to build, test, debug, and deploy Serverless applications using AWS SAM
https://aws.amazon.com/serverless/sam/
Apache License 2.0
6.51k stars 1.17k forks source link

Bug: sam invoke local - Docker 404 Client Error: Not Found #4324

Closed astroalek closed 2 years ago

astroalek commented 2 years ago

Description:

I'm having a hard time trying to locally invoking lambda code with hello-world templates

Steps to reproduce:

sam init -r python3.8

1

1

N

sam-app-py38

cd sam-app-py38

sam build --debug

2022-10-19 19:05:12,888 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics

2022-10-19 19:05:12,888 | Using config file: samconfig.toml, config environment: default

2022-10-19 19:05:12,888 | Expand command line arguments to:

2022-10-19 19:05:12,888 | --template_file=/PATH_TO_SAM_APP/template.yml --build_dir=.aws-sam/build --cache_dir=.aws-sam/cache

2022-10-19 19:05:13,127 | 'build' command is called

2022-10-19 19:05:13,127 | Template is not provided in context, skip adding project type metric

2022-10-19 19:05:13,154 | Sending Telemetry: {'metrics': [{'commandRun': {'requestId': '5dab619d-ddc3-435c-a390-8deddd4ff231', 'installationId': '8ada282a-332d-4b64-98e1-4f7fb559111a', 'sessionId': '109eed1c-a0cf-4170-a22a-0b43307498a9', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.8.15', 'samcliVersion': '1.60.0', 'awsProfileProvided': False, 'debugFlagProvided': True, 'region': '', 'commandName': 'sam build', 'metricSpecificAttributes': {'gitOrigin': None, 'projectName': '894b4894943a1373a55cb1b7c0a8aa33530234fd6f4de1e562bc37c62c949767', 'initialCommit': None}, 'duration': 265, 'exitReason': 'TemplateNotFoundException', 'exitCode': 1}}]}

2022-10-19 19:05:13,853 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)

Error: Template file not found at /PATH_TO_SAM_APP/template.yml

afrigerio@Alessandros-MacBook-Pro lambdas % cd sam-app-py38

afrigerio@Alessandros-MacBook-Pro sam-app-py38 % sam build --debug

2022-10-19 19:06:07,009 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics

2022-10-19 19:06:07,009 | Using config file: samconfig.toml, config environment: default

2022-10-19 19:06:07,009 | Expand command line arguments to:

2022-10-19 19:06:07,009 | --template_file=/PATH_TO_SAM_APP/sam-app-py38/template.yaml --build_dir=.aws-sam/build --cache_dir=.aws-sam/cache

2022-10-19 19:06:07,144 | 'build' command is called

2022-10-19 19:06:07,147 | No Parameters detected in the template

2022-10-19 19:06:07,158 | There is no customer defined id or cdk path defined for resource HelloWorldFunction, so we will use the resource logical id as the resource id

2022-10-19 19:06:07,158 | 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

2022-10-19 19:06:07,158 | 0 stacks found in the template

2022-10-19 19:06:07,158 | No Parameters detected in the template

2022-10-19 19:06:07,163 | There is no customer defined id or cdk path defined for resource HelloWorldFunction, so we will use the resource logical id as the resource id

2022-10-19 19:06:07,164 | 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

2022-10-19 19:06:07,164 | 2 resources found in the stack

2022-10-19 19:06:07,164 | Found Serverless function with name='HelloWorldFunction' and CodeUri='hello_world/'

2022-10-19 19:06:07,164 | --base-dir is not presented, adjusting uri hello_world/ relative to /PATH_TO_SAM_APP/sam-app-py38/template.yaml

2022-10-19 19:06:07,166 | Your template contains a resource with logical ID "ServerlessRestApi", which is a reserved logical ID in AWS SAM. It could result in unexpected behaviors and is not recommended.

2022-10-19 19:06:07,166 | 2 resources found in the stack

2022-10-19 19:06:07,166 | Found Serverless function with name='HelloWorldFunction' and CodeUri='hello_world/'

2022-10-19 19:06:07,167 | Instantiating build definitions

2022-10-19 19:06:07,167 | No previous build graph found, generating new one

2022-10-19 19:06:07,167 | Unique function build definition found, adding as new (Function Build Definition: BuildDefinition(python3.8, /PATH_TO_SAM_APP/sam-app-py38/hello_world, Zip, , 4a7df146-0be6-426a-b355-2e43bc6fce03, {}, {}, x86_64, []), Function: Function(function_id='HelloWorldFunction', name='HelloWorldFunction', functionname='HelloWorldFunction', runtime='python3.8', memory=None, timeout=3, handler='app.lambda_handler', imageuri=None, packagetype='Zip', imageconfig=None, codeuri='/PATH_TO_SAM_APP/sam-app-py38/hello_world', environment=None, rolearn=None, layers=[], events={'HelloWorld': {'Type': 'Api', 'Properties': {'Path': '/hello', 'Method': 'get', 'RestApiId': 'ServerlessRestApi'}}}, metadata={'SamResourceId': 'HelloWorldFunction'}, inlinecode=None, codesign_config_arn=None, architectures=['x86_64'], function_url_config=None, stack_path=''))

2022-10-19 19:06:07,168 | Building codeuri: /PATH_TO_SAM_APP/sam-app-py38/hello_world runtime: python3.8 metadata: {} architecture: x86_64 functions: HelloWorldFunction

2022-10-19 19:06:07,168 | Building to following folder /PATH_TO_SAM_APP/sam-app-py38/.aws-sam/build/HelloWorldFunction

2022-10-19 19:06:07,168 | Loading workflow module 'aws_lambda_builders.workflows'

2022-10-19 19:06:07,172 | Registering workflow 'PythonPipBuilder' with capability 'Capability(language='python', dependency_manager='pip', application_framework=None)'

2022-10-19 19:06:07,173 | Registering workflow 'NodejsNpmBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm', application_framework=None)'

2022-10-19 19:06:07,174 | Registering workflow 'RubyBundlerBuilder' with capability 'Capability(language='ruby', dependency_manager='bundler', application_framework=None)'

2022-10-19 19:06:07,176 | Registering workflow 'GoModulesBuilder' with capability 'Capability(language='go', dependency_manager='modules', application_framework=None)'

2022-10-19 19:06:07,178 | Registering workflow 'JavaGradleWorkflow' with capability 'Capability(language='java', dependency_manager='gradle', application_framework=None)'

2022-10-19 19:06:07,179 | Registering workflow 'JavaMavenWorkflow' with capability 'Capability(language='java', dependency_manager='maven', application_framework=None)'

2022-10-19 19:06:07,181 | Registering workflow 'DotnetCliPackageBuilder' with capability 'Capability(language='dotnet', dependency_manager='cli-package', application_framework=None)'

2022-10-19 19:06:07,182 | Registering workflow 'CustomMakeBuilder' with capability 'Capability(language='provided', dependency_manager=None, application_framework=None)'

2022-10-19 19:06:07,183 | Registering workflow 'NodejsNpmEsbuildBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm-esbuild', application_framework=None)'

2022-10-19 19:06:07,183 | Found workflow 'PythonPipBuilder' to support capabilities 'Capability(language='python', dependency_manager='pip', application_framework=None)'

2022-10-19 19:06:07,198 | Running workflow 'PythonPipBuilder'

2022-10-19 19:06:07,199 | Running PythonPipBuilder:ResolveDependencies

2022-10-19 19:06:07,216 | calling pip download -r /PATH_TO_SAM_APP/sam-app-py38/hello_world/requirements.txt --dest /var/folders/7s/02wlz_dx27q5f_hjqbrsjdsr0000gn/T/tmpm3ffmr1d --exists-action i

2022-10-19 19:06:07,782 | Full dependency closure: {urllib3==1.26.12(wheel), requests==2.28.1(wheel), idna==3.4(wheel), certifi==2022.9.24(wheel), charset-normalizer==2.1.1(wheel)}

2022-10-19 19:06:07,783 | initial compatible: {urllib3==1.26.12(wheel), requests==2.28.1(wheel), idna==3.4(wheel), certifi==2022.9.24(wheel), charset-normalizer==2.1.1(wheel)}

2022-10-19 19:06:07,783 | initial incompatible: set()

2022-10-19 19:06:07,783 | Downloading missing wheels: set()

2022-10-19 19:06:07,783 | compatible wheels after second download pass: {urllib3==1.26.12(wheel), requests==2.28.1(wheel), idna==3.4(wheel), certifi==2022.9.24(wheel), charset-normalizer==2.1.1(wheel)}

2022-10-19 19:06:07,783 | Build missing wheels from sdists (C compiling True): set()

2022-10-19 19:06:07,783 | compatible after building wheels (no C compiling): {urllib3==1.26.12(wheel), requests==2.28.1(wheel), idna==3.4(wheel), certifi==2022.9.24(wheel), charset-normalizer==2.1.1(wheel)}

2022-10-19 19:06:07,783 | Build missing wheels from sdists (C compiling False): set()

2022-10-19 19:06:07,783 | compatible after building wheels (C compiling): {urllib3==1.26.12(wheel), requests==2.28.1(wheel), idna==3.4(wheel), certifi==2022.9.24(wheel), charset-normalizer==2.1.1(wheel)}

2022-10-19 19:06:07,783 | Final compatible: {idna==3.4(wheel), urllib3==1.26.12(wheel), requests==2.28.1(wheel), certifi==2022.9.24(wheel), charset-normalizer==2.1.1(wheel)}

2022-10-19 19:06:07,783 | Final incompatible: set()

2022-10-19 19:06:07,783 | Final missing wheels: set()

2022-10-19 19:06:07,797 | PythonPipBuilder:ResolveDependencies succeeded

2022-10-19 19:06:07,797 | Running PythonPipBuilder:CopySource

2022-10-19 19:06:07,798 | Copying source file (/PATH_TO_SAM_APP/sam-app-py38/hello_world/requirements.txt) to destination (/PATH_TO_SAM_APP/sam-app-py38/.aws-sam/build/HelloWorldFunction/requirements.txt)

2022-10-19 19:06:07,798 | Copying source file (/PATH_TO_SAM_APP/sam-app-py38/hello_world/__init__.py) to destination (/PATH_TO_SAM_APP/sam-app-py38/.aws-sam/build/HelloWorldFunction/__init__.py)

2022-10-19 19:06:07,798 | Copying source file (/PATH_TO_SAM_APP/sam-app-py38/hello_world/app.py) to destination (/PATH_TO_SAM_APP/sam-app-py38/.aws-sam/build/HelloWorldFunction/app.py)

2022-10-19 19:06:07,798 | PythonPipBuilder:CopySource succeeded

2022-10-19 19:06:07,799 | There is no customer defined id or cdk path defined for resource HelloWorldFunction, so we will use the resource logical id as the resource id

2022-10-19 19:06:07,799 | 2 resources found in the stack

2022-10-19 19:06:07,799 | Found Serverless function with name='HelloWorldFunction' and CodeUri='hello_world/'

Build Succeeded

Built Artifacts : .aws-sam/build

Built Template : .aws-sam/build/template.yaml

Commands you can use next

[*] Validate SAM template: sam validate

[*] Invoke Function: sam local invoke

[*] Test Function in the Cloud: sam sync --stack-name {stack-name} --watch

[*] Deploy: sam deploy --guided

2022-10-19 19:06:07,826 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics

2022-10-19 19:06:07,826 | Unable to find Click Context for getting session_id.

2022-10-19 19:06:07,827 | Sending Telemetry: {'metrics': [{'commandRun': {'requestId': '7ac7183d-5134-44d2-a310-1ee8d30ece10', 'installationId': '8ada282a-332d-4b64-98e1-4f7fb559111a', 'sessionId': 'b549e766-17a5-4641-b0de-d53095b082cb', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.8.15', 'samcliVersion': '1.60.0', 'awsProfileProvided': False, 'debugFlagProvided': True, 'region': '', 'commandName': 'sam build', 'metricSpecificAttributes': {'projectType': 'CFN', 'gitOrigin': None, 'projectName': '0fdcacdf0a5a5c982672247f3c17ee797bd2e5c80105099d05b5329699391655', 'initialCommit': None}, 'duration': 816, 'exitReason': 'success', 'exitCode': 0}}]}

2022-10-19 19:06:07,827 | Sending Telemetry: {'metrics': [{'events': {'requestId': 'dd4677f9-d7d4-4ebb-9214-aa1aebc9712c', 'installationId': '8ada282a-332d-4b64-98e1-4f7fb559111a', 'sessionId': 'b549e766-17a5-4641-b0de-d53095b082cb', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.8.15', 'samcliVersion': '1.60.0', 'metricSpecificAttributes': {'events': [{'event_name': 'BuildWorkflowUsed', 'event_value': 'python-pip', 'thread_id': 4376790400, 'time_stamp': '2022-10-19 17:06:07.168'}, {'event_name': 'BuildFunctionRuntime', 'event_value': 'python3.8', 'thread_id': 4376790400, 'time_stamp': '2022-10-19 17:06:07.801'}]}}}]}

2022-10-19 19:06:08,521 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)

2022-10-19 19:06:08,522 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)

sam local invoke --debug

2022-10-19 19:15:55,258 | Telemetry endpoint configured to be https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics

2022-10-19 19:15:55,258 | Using config file: samconfig.toml, config environment: default

2022-10-19 19:15:55,258 | Expand command line arguments to:

2022-10-19 19:15:55,258 | --template_file=/PATH_TO_SAM_APP/sam-app-py38/.aws-sam/build/template.yaml --event=events/event.json --no_event --layer_cache_basedir=/Users/afrigerio/.aws-sam/layers-pkg --container_host=localhost --container_host_interface=127.0.0.1

2022-10-19 19:15:55,258 | local invoke command is called

2022-10-19 19:15:55,261 | No Parameters detected in the template

2022-10-19 19:15:55,270 | Sam customer defined id is more priority than other IDs. Customer defined id for resource HelloWorldFunction is HelloWorldFunction

2022-10-19 19:15:55,270 | 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

2022-10-19 19:15:55,270 | 0 stacks found in the template

2022-10-19 19:15:55,270 | No Parameters detected in the template

2022-10-19 19:15:55,275 | Sam customer defined id is more priority than other IDs. Customer defined id for resource HelloWorldFunction is HelloWorldFunction

2022-10-19 19:15:55,275 | 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

2022-10-19 19:15:55,276 | 2 resources found in the stack

2022-10-19 19:15:55,276 | Found Serverless function with name='HelloWorldFunction' and CodeUri='HelloWorldFunction'

2022-10-19 19:15:55,276 | --base-dir is not presented, adjusting uri HelloWorldFunction relative to /PATH_TO_SAM_APP/sam-app-py38/.aws-sam/build/template.yaml

2022-10-19 19:15:55,299 | Found one Lambda function with name 'HelloWorldFunction'

2022-10-19 19:15:55,299 | Invoking app.lambda_handler (python3.8)

2022-10-19 19:15:55,299 | No environment variables found for function 'HelloWorldFunction'

2022-10-19 19:15:55,299 | Loading AWS credentials from session with profile 'None'

2022-10-19 19:15:55,304 | Resolving code path. Cwd=/PATH_TO_SAM_APP/sam-app-py38/.aws-sam/build, CodeUri=/PATH_TO_SAM_APP/sam-app-py38/.aws-sam/build/HelloWorldFunction

2022-10-19 19:15:55,304 | Resolved absolute path to code is /PATH_TO_SAM_APP/sam-app-py38/.aws-sam/build/HelloWorldFunction

2022-10-19 19:15:55,305 | Code /PATH_TO_SAM_APP/sam-app-py38/.aws-sam/build/HelloWorldFunction is not a zip/jar file

2022-10-19 19:15:55,307 | Cleaning all decompressed code dirs

2022-10-19 19:15:55,333 | Sending Telemetry: {'metrics': [{'commandRun': {'requestId': '94dcccda-e42d-4b06-b446-ad4bcc6fe6c3', 'installationId': '8ada282a-332d-4b64-98e1-4f7fb559111a', 'sessionId': 'b2d0e00e-d549-46e3-bab5-0cd6a21e9883', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.8.15', 'samcliVersion': '1.60.0', 'awsProfileProvided': False, 'debugFlagProvided': True, 'region': '', 'commandName': 'sam local invoke', 'metricSpecificAttributes': {'projectType': 'CFN', 'gitOrigin': None, 'projectName': '0fdcacdf0a5a5c982672247f3c17ee797bd2e5c80105099d05b5329699391655', 'initialCommit': None}, 'duration': 75, 'exitReason': 'NotFound', 'exitCode': 255}}]}

2022-10-19 19:15:56,064 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)

Traceback (most recent call last):

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/docker/api/client.py", line 261, in _raise_for_status

response.raise_for_status()

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/requests/models.py", line 943, in raise_for_status

raise HTTPError(http_error_msg, response=self)

requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http+docker://localhost/v1.35/images/public.ecr.aws/sam/emulation-python3.8:rapid-1.60.0-x86_64/json

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/opt/homebrew/bin/sam", line 8, in <module>

sys.exit(cli())

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/click/core.py", line 829, in __call__

return self.main(*args, **kwargs)

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/click/core.py", line 782, in main

rv = self.invoke(ctx)

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/click/core.py", line 1259, in invoke

return _process_result(sub_ctx.command.invoke(sub_ctx))

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/click/core.py", line 1259, in invoke

return _process_result(sub_ctx.command.invoke(sub_ctx))

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/click/core.py", line 1066, in invoke

return ctx.invoke(self.callback, **ctx.params)

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/click/core.py", line 610, in invoke

return callback(*args, **kwargs)

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/click/decorators.py", line 73, in new_func

return ctx.invoke(f, obj, *args, **kwargs)

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/click/core.py", line 610, in invoke

return callback(*args, **kwargs)

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/samcli/lib/telemetry/metric.py", line 176, in wrapped

raise exception # pylint: disable=raising-bad-type

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/samcli/lib/telemetry/metric.py", line 126, in wrapped

return_value = func(*args, **kwargs)

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/samcli/lib/utils/version_checker.py", line 41, in wrapped

actual_result = func(*args, **kwargs)

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/samcli/cli/main.py", line 86, in wrapper

return func(*args, **kwargs)

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/samcli/commands/local/invoke/cli.py", line 85, in cli

do_cli(

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/samcli/commands/local/invoke/cli.py", line 182, in do_cli

context.local_lambda_runner.invoke(

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/samcli/commands/local/lib/local_lambda.py", line 137, in invoke

self.local_runtime.invoke(

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/samcli/lib/telemetry/metric.py", line 240, in wrapped_func

return_value = func(*args, **kwargs)

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/samcli/local/lambdafn/runtime.py", line 177, in invoke

container = self.create(function_config, debug_context, container_host, container_host_interface)

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/samcli/local/lambdafn/runtime.py", line 73, in create

container = LambdaContainer(

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/samcli/local/docker/lambda_container.py", line 93, in __init__

image = LambdaContainer._get_image(

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/samcli/local/docker/lambda_container.py", line 236, in _get_image

return lambda_image.build(runtime, packagetype, image, layers, architecture, function_name=function_name)

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/samcli/local/docker/lambda_image.py", line 145, in build

self.docker_client.images.get(image_tag)

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/docker/models/images.py", line 316, in get

return self.prepare_model(self.client.api.inspect_image(name))

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/docker/utils/decorators.py", line 19, in wrapped

return f(self, resource_id, *args, **kwargs)

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/docker/api/image.py", line 245, in inspect_image

return self._result(

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/docker/api/client.py", line 267, in _result

self._raise_for_status(response)

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/docker/api/client.py", line 263, in _raise_for_status

raise create_api_error_from_http_exception(e)

File "/opt/homebrew/Cellar/aws-sam-cli/1.60.0/libexec/lib/python3.8/site-packages/docker/errors.py", line 31, in create_api_error_from_http_exception

raise cls(e, response=response, explanation=explanation)

docker.errors.NotFound: 404 Client Error: Not Found ("id not found")

Expected result:

I was expecting the result coming from the lambda execution. I got a similar output if i try

sam local start-api

and then

curl http://127.0.0.1:3000/hello

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: macOS Monterey (M1)
  2. sam --version: SAM CLI, version 1.60.0
  3. AWS region: eu-central-1
sriram-mv commented 2 years ago

Do you have the latest version of the docker daemon installed? are you still running into it?

astroalek commented 2 years ago

Do you have the latest version of the docker daemon installed? are you still running into it?

docker --version
Docker version 20.10.17, build 100c701

Yeah, I'm still receiving the same error sam local invoke

astroalek commented 2 years ago

My bad, your suggestion made me check my docker settings and I found out that I've enabled the flag "Use containerd for pulling and storing images" in Docker Desktop Experimental features. Disabling it enabled docker to pull the image thatn previously was not found.

mndeveci commented 2 years ago

It looks like the issue have been resolved, I am going to close this issue but please feel free to create a new one if you still encounter any other issues.