Description:
Running the Quick Start Hello World Application described at https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-quick-start.html raises a RuntimeError.
Steps to reproduce the issue:
Observed result:
Relevant command output:
Fetching lambci/lambda:build-python3.7 Docker container image.............
2018-12-05 19:07:12 Mounting C:\PythonCode\sampoc\sam-app\hello_world as /tmp/samcli/source:ro inside runtime container
Traceback ....
File "C:\Users\scalwas\AppData\Roaming\Python\Python37\site-packages\samcli\localdocker\container.py", line 195, in wait_for_logs
raise RuntimeError ("Container does not exist. Cannot get logs for this container")
Expected result:
Expected the result described in the Quick Start instructions.
I just tried to repro this and didn't run into this issue. Could you try restarting your docker, maybe?
Yes, I did restart both Docker and my computer. I ran these commands both yesterday and today with the same results.
I'm not familiar with Docker, but its Windows default uses Linux containers(?). An output message I quoted in my OP describes mounting a Windows item to a Linux reference. Could this be an issue?
the path mount shouldn't be an issue, we want to choose Linux containers. can you try running with --debug and the paste the entire trace here
Here is all the output from the command "sam build --use-container --debug".
2018-12-06 17:01:30 Using SAM Template at C:\PythonCode\sampoc\sam-app\template.yaml
2018-12-06 17:01:30 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2018-12-06 17:01:30 Changing event name from before-call.apigateway to before-call.api-gateway
2018-12-06 17:01:30 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2018-12-06 17:01:30 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2018-12-06 17:01:30 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2018-12-06 17:01:30 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2018-12-06 17:01:30 Changing event name from docs..autoscaling.CreateLaunchConfiguration.complete-section to docs..auto-scaling.CreateLaunchConfiguration.complete-section
2018-12-06 17:01:30 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2018-12-06 17:01:30 Changing event name from docs..logs.CreateExportTask.complete-section to docs..cloudwatch-logs.CreateExportTask.complete-section
2018-12-06 17:01:30 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2018-12-06 17:01:30 Changing event name from docs..cloudsearchdomain.Search.complete-section to docs..cloudsearch-domain.Search.complete-section
2018-12-06 17:01:30 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2018-12-06 17:01:30 Changing event name from before-call.apigateway to before-call.api-gateway
2018-12-06 17:01:30 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2018-12-06 17:01:30 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2018-12-06 17:01:30 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2018-12-06 17:01:30 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2018-12-06 17:01:30 Changing event name from docs..autoscaling.CreateLaunchConfiguration.complete-section to docs..auto-scaling.CreateLaunchConfiguration.complete-section
2018-12-06 17:01:30 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2018-12-06 17:01:30 Changing event name from docs..logs.CreateExportTask.complete-section to docs..cloudwatch-logs.CreateExportTask.complete-section
2018-12-06 17:01:30 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2018-12-06 17:01:30 Changing event name from docs..cloudsearchdomain.Search.complete-section to docs..cloudsearch-domain.Search.complete-section
2018-12-06 17:01:30 'build' command is called
2018-12-06 17:01:30 Starting Build inside a container
2018-12-06 17:01:30 Looking for credentials via: env
2018-12-06 17:01:30 Looking for credentials via: assume-role
2018-12-06 17:01:30 Looking for credentials via: shared-credentials-file
2018-12-06 17:01:30 Found credentials in shared credentials file: ~/.aws/credentials
2018-12-06 17:01:30 Loading JSON file: C:\Users\scalwas\AppData\Roaming\Python\Python37\site-packages\botocore\dataendpoints.json
2018-12-06 17:01:30 Event choose-service-name: calling handler
2018-12-06 17:01:30 Loading JSON file: C:\Users\scalwas\AppData\Roaming\Python\Python37\site-packages\botocore\data\serverlessrepo\2017-09-08\service-2.json
2018-12-06 17:01:30 Event creating-client-class.serverlessapplicationrepository: calling handler
2018-12-06 17:01:30 The s3 config key is not a dictionary type, ignoring its value of: None
2018-12-06 17:01:30 Setting serverlessrepo timeout as (60, 60)
2018-12-06 17:01:30 Loading JSON file: C:\Users\scalwas\AppData\Roaming\Python\Python37\site-packages\botocore\data_retry.json
2018-12-06 17:01:30 Registering retry handlers for service: serverlessrepo
2018-12-06 17:01:30 No Parameters detected in the template
2018-12-06 17:01:30 2 resources found in the template
2018-12-06 17:01:30 Found Serverless function with name='HelloWorldFunction' and CodeUri='hello_world/'
2018-12-06 17:01:30 Trying paths: ['C:\Users\scalwas\.docker\config.json', 'C:\Users\scalwas\.dockercfg']
2018-12-06 17:01:30 Found file at path: C:\Users\scalwas.docker\config.json
2018-12-06 17:01:30 Couldn't find auth-related section ; attempting to interpret as auth-only file
2018-12-06 17:01:30 Config entry for key stackOrchestrator is not auth config
2018-12-06 17:01:30 Building resource 'HelloWorldFunction'
2018-12-06 17:01:30 Trying paths: ['C:\Users\scalwas\.docker\config.json', 'C:\Users\scalwas\.dockercfg']
2018-12-06 17:01:30 Found file at path: C:\Users\scalwas.docker\config.json
2018-12-06 17:01:30 Couldn't find auth-related section ; attempting to interpret as auth-only file
2018-12-06 17:01:30 Config entry for key stackOrchestrator is not auth config
2018-12-06 17:01:30 http://localhost:None "GET /v1.35/images/lambci/lambda:build-python3.7/json HTTP/1.1" 200 None
2018-12-06 17:01:30 Looking for auth config
2018-12-06 17:01:30 Looking for auth entry for 'docker.io'
2018-12-06 17:01:30 No entry found
2018-12-06 17:01:30 No auth config found
2018-12-06 17:01:32 http://localhost:None "POST /v1.35/images/create?tag=build-python3.7&fromImage=lambci%2Flambda HTTP/1.1" 200 None
Fetching lambci/lambda:build-python3.7 Docker container image......
2018-12-06 17:01:32 Mounting C:\PythonCode\sampoc\sam-app\hello_world as /tmp/samcli/source:ro inside runtime container
2018-12-06 17:01:58 http://localhost:None "POST /v1.35/containers/create HTTP/1.1" 500 26
Traceback (most recent call last):
File "c:\python3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\python3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\scalwas\AppData\Roaming\Python\Python37\Scripts\sam.exe__main__.py", line 9, in
File "C:\Users\scalwas\AppData\Roaming\Python\Python37\site-packages\click\core.py", line 722, in __call__
return self.main(args, *kwargs)
File "C:\Users\scalwas\AppData\Roaming\Python\Python37\site-packages\click\core.py", line 697, in main
rv = self.invoke(ctx)
File "C:\Users\scalwas\AppData\Roaming\Python\Python37\site-packages\click\core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\scalwas\AppData\Roaming\Python\Python37\site-packages\click\core.py", line 895, in invoke
return ctx.invoke(self.callback, *ctx.params)
File "C:\Users\scalwas\AppData\Roaming\Python\Python37\site-packages\click\core.py", line 535, in invoke
return callback(args, *kwargs)
File "C:\Users\scalwas\AppData\Roaming\Python\Python37\site-packages\click\decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args[1:], *kwargs)
File "C:\Users\scalwas\AppData\Roaming\Python\Python37\site-packages\click\core.py", line 535, in invoke
return callback(args, *kwargs)
File "C:\Users\scalwas\AppData\Roaming\Python\Python37\site-packages\samcli\commands\build\command.py", line 94, in cli
skip_pull_image, parameter_overrides) # pragma: no cover
File "C:\Users\scalwas\AppData\Roaming\Python\Python37\site-packages\samcli\commands\build\command.py", line 132, in do_cli
artifacts = builder.build()
File "C:\Users\scalwas\AppData\Roaming\Python\Python37\site-packages\samcli\lib\build\app_builder.py", line 117, in build
lambda_function.runtime)
File "C:\Users\scalwas\AppData\Roaming\Python\Python37\site-packages\samcli\lib\build\app_builder.py", line 189, in _build_function
runtime)
File "C:\Users\scalwas\AppData\Roaming\Python\Python37\site-packages\samcli\lib\build\app_builder.py", line 249, in _build_function_on_container
container.wait_for_logs(stdout=stdout_stream, stderr=stderr_stream)
File "C:\Users\scalwas\AppData\Roaming\Python\Python37\site-packages\samcli\localdocker\container.py", line 195, in wait_for_logs
raise RuntimeError("Container does not exist. Cannot get logs for this container")
RuntimeError: Container does not exist. Cannot get logs for this container
I'm having issues running the quickstart as well. Seems unable to find the container on macOS Mojave (Python 3.7 via Homebrew) following the instructions in the docs.
Docker and the laptop have been restarted multiple times. The behavior is consistent on another machine as well.
Debug output:
laptop:sam-app
2018-12-16 22:06:34 Using SAM Template at /Users/
2018-12-16 22:06:34 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2018-12-16 22:06:34 Changing event name from before-call.apigateway to before-call.api-gateway
2018-12-16 22:06:34 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2018-12-16 22:06:34 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2018-12-16 22:06:34 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2018-12-16 22:06:34 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2018-12-16 22:06:34 Changing event name from docs..autoscaling.CreateLaunchConfiguration.complete-section to docs..auto-scaling.CreateLaunchConfiguration.complete-section
2018-12-16 22:06:34 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2018-12-16 22:06:34 Changing event name from docs..logs.CreateExportTask.complete-section to docs..cloudwatch-logs.CreateExportTask.complete-section
2018-12-16 22:06:34 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2018-12-16 22:06:34 Changing event name from docs..cloudsearchdomain.Search.complete-section to docs..cloudsearch-domain.Search.complete-section
2018-12-16 22:06:34 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2018-12-16 22:06:34 Changing event name from before-call.apigateway to before-call.api-gateway
2018-12-16 22:06:34 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2018-12-16 22:06:34 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2018-12-16 22:06:34 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2018-12-16 22:06:34 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2018-12-16 22:06:34 Changing event name from docs..autoscaling.CreateLaunchConfiguration.complete-section to docs..auto-scaling.CreateLaunchConfiguration.complete-section
2018-12-16 22:06:34 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2018-12-16 22:06:34 Changing event name from docs..logs.CreateExportTask.complete-section to docs..cloudwatch-logs.CreateExportTask.complete-section
2018-12-16 22:06:34 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2018-12-16 22:06:34 Changing event name from docs..cloudsearchdomain.Search.complete-section to docs..cloudsearch-domain.Search.complete-section
2018-12-16 22:06:34 'build' command is called
2018-12-16 22:06:34 Starting Build inside a container
2018-12-16 22:06:34 Looking for credentials via: env
2018-12-16 22:06:34 Looking for credentials via: assume-role
2018-12-16 22:06:34 Looking for credentials via: shared-credentials-file
2018-12-16 22:06:34 Found credentials in shared credentials file: ~/.aws/credentials
2018-12-16 22:06:34 Loading JSON file: /usr/local/Cellar/aws-sam-cli/0.9.0/libexec/lib/python3.7/site-packages/botocore/data/endpoints.json
2018-12-16 22:06:34 Event choose-service-name: calling handler
2018-12-16 22:06:34 Loading JSON file: /usr/local/Cellar/aws-sam-cli/0.9.0/libexec/lib/python3.7/site-packages/botocore/data/serverlessrepo/2017-09-08/service-2.json
2018-12-16 22:06:34 Event creating-client-class.serverlessapplicationrepository: calling handler
2018-12-16 22:06:34 The s3 config key is not a dictionary type, ignoring its value of: None
2018-12-16 22:06:34 Setting serverlessrepo timeout as (60, 60)
2018-12-16 22:06:34 Loading JSON file: /usr/local/Cellar/aws-sam-cli/0.9.0/libexec/lib/python3.7/site-packages/botocore/data/_retry.json
2018-12-16 22:06:34 Registering retry handlers for service: serverlessrepo
2018-12-16 22:06:34 No Parameters detected in the template
2018-12-16 22:06:34 2 resources found in the template
2018-12-16 22:06:34 Found Serverless function with name='HelloWorldFunction' and CodeUri='hello_world/'
2018-12-16 22:06:34 Trying paths: ['/Users/
2018-12-16 22:06:34 Found file at path: /Users/
2018-12-16 22:06:34 Found 'auths' section
2018-12-16 22:06:34 Auth data for https://
2018-12-16 22:06:34 Auth data for https://index.docker.io/v1/ is absent. Client might be using a credentials store instead.
2018-12-16 22:06:34 Found 'credsStore' section
2018-12-16 22:06:34 Building resource 'HelloWorldFunction'
2018-12-16 22:06:34 Trying paths: ['/Users/
2018-12-16 22:06:34 Found file at path: /Users/
2018-12-16 22:06:34 Found 'auths' section
2018-12-16 22:06:34 Auth data for https://
2018-12-16 22:06:34 Auth data for https://index.docker.io/v1/ is absent. Client might be using a credentials store instead.
2018-12-16 22:06:34 Found 'credsStore' section
2018-12-16 22:06:34 http://localhost:None "GET /v1.35/images/lambci/lambda:build-python3.7/json HTTP/1.1" 502 32
Traceback (most recent call last):
File "/usr/local/bin/sam", line 11, in
load_entry_point('aws-sam-cli==0.9.0', 'console_scripts', 'sam')()
File "/usr/local/Cellar/aws-sam-cli/0.9.0/libexec/lib/python3.7/site-packages/click/core.py", line 722, in __call__
return self.main(args, *kwargs)
File "/usr/local/Cellar/aws-sam-cli/0.9.0/libexec/lib/python3.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/Cellar/aws-sam-cli/0.9.0/libexec/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/Cellar/aws-sam-cli/0.9.0/libexec/lib/python3.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, *ctx.params)
File "/usr/local/Cellar/aws-sam-cli/0.9.0/libexec/lib/python3.7/site-packages/click/core.py", line 535, in invoke
return callback(args, *kwargs)
File "/usr/local/Cellar/aws-sam-cli/0.9.0/libexec/lib/python3.7/site-packages/click/decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args[1:], *kwargs)
File "/usr/local/Cellar/aws-sam-cli/0.9.0/libexec/lib/python3.7/site-packages/click/core.py", line 535, in invoke
return callback(args, *kwargs)
File "/usr/local/Cellar/aws-sam-cli/0.9.0/libexec/lib/python3.7/site-packages/samcli/commands/build/command.py", line 94, in cli
skip_pull_image, parameter_overrides) # pragma: no cover
File "/usr/local/Cellar/aws-sam-cli/0.9.0/libexec/lib/python3.7/site-packages/samcli/commands/build/command.py", line 132, in do_cli
artifacts = builder.build()
File "/usr/local/Cellar/aws-sam-cli/0.9.0/libexec/lib/python3.7/site-packages/samcli/lib/build/app_builder.py", line 123, in build
lambda_function.runtime)
File "/usr/local/Cellar/aws-sam-cli/0.9.0/libexec/lib/python3.7/site-packages/samcli/lib/build/app_builder.py", line 195, in _build_function
runtime)
File "/usr/local/Cellar/aws-sam-cli/0.9.0/libexec/lib/python3.7/site-packages/samcli/lib/build/app_builder.py", line 255, in _build_function_on_container
container.wait_for_logs(stdout=stdout_stream, stderr=stderr_stream)
File "/usr/local/Cellar/aws-sam-cli/0.9.0/libexec/lib/python3.7/site-packages/samcli/local/docker/container.py", line 195, in wait_for_logs
raise RuntimeError("Container does not exist. Cannot get logs for this container")
RuntimeError: Container does not exist. Cannot get logs for this container
Any news on this issue? I tried the newest SAM v0.10.0 and backtracking from Python 3.7.1 to 3.6.8, but they had no effect. I also tried backtracking the pypiwin32 package from 223 to 220 as described in issue #847, but again had no effect.
Here is the debug output from running SAM 0.10.0, Python 3.6.8, pypiwin32 223.
$ sam build --use-container --debug > log.txt
2018-12-27 17:40:40 Using SAM Template at C:\PythonCode\sampoc\sam-app\template.yaml
2018-12-27 17:40:40 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2018-12-27 17:40:40 Changing event name from before-call.apigateway to before-call.api-gateway
2018-12-27 17:40:40 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2018-12-27 17:40:40 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2018-12-27 17:40:40 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2018-12-27 17:40:40 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2018-12-27 17:40:40 Changing event name from docs..autoscaling.CreateLaunchConfiguration.complete-section to docs..auto-scaling.CreateLaunchConfiguration.complete-section
2018-12-27 17:40:40 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2018-12-27 17:40:40 Changing event name from docs..logs.CreateExportTask.complete-section to docs..cloudwatch-logs.CreateExportTask.complete-section
2018-12-27 17:40:40 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2018-12-27 17:40:40 Changing event name from docs..cloudsearchdomain.Search.complete-section to docs..cloudsearch-domain.Search.complete-section
2018-12-27 17:40:40 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2018-12-27 17:40:40 Changing event name from before-call.apigateway to before-call.api-gateway
2018-12-27 17:40:40 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2018-12-27 17:40:40 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2018-12-27 17:40:40 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2018-12-27 17:40:40 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2018-12-27 17:40:40 Changing event name from docs..autoscaling.CreateLaunchConfiguration.complete-section to docs..auto-scaling.CreateLaunchConfiguration.complete-section
2018-12-27 17:40:40 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2018-12-27 17:40:40 Changing event name from docs..logs.CreateExportTask.complete-section to docs..cloudwatch-logs.CreateExportTask.complete-section
2018-12-27 17:40:40 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2018-12-27 17:40:40 Changing event name from docs..cloudsearchdomain.Search.complete-section to docs..cloudsearch-domain.Search.complete-section
2018-12-27 17:40:40 'build' command is called
2018-12-27 17:40:40 Starting Build inside a container
2018-12-27 17:40:40 Looking for credentials via: env
2018-12-27 17:40:40 Looking for credentials via: assume-role
2018-12-27 17:40:40 Looking for credentials via: shared-credentials-file
2018-12-27 17:40:40 Found credentials in shared credentials file: ~/.aws/credentials
2018-12-27 17:40:40 Loading JSON file: C:\Users\scalwas\AppData\Roaming\Python\Python36\site-packages\botocore\dataendpoints.json
2018-12-27 17:40:40 Event choose-service-name: calling handler
2018-12-27 17:40:40 Loading JSON file: C:\Users\scalwas\AppData\Roaming\Python\Python36\site-packages\botocore\data\serverlessrepo\2017-09-08\service-2.json
2018-12-27 17:40:40 Event creating-client-class.serverlessapplicationrepository: calling handler
2018-12-27 17:40:40 The s3 config key is not a dictionary type, ignoring its value of: None
2018-12-27 17:40:40 Setting serverlessrepo timeout as (60, 60)
2018-12-27 17:40:40 Loading JSON file: C:\Users\scalwas\AppData\Roaming\Python\Python36\site-packages\botocore\data_retry.json
2018-12-27 17:40:40 Registering retry handlers for service: serverlessrepo
2018-12-27 17:40:41 No Parameters detected in the template
2018-12-27 17:40:41 2 resources found in the template
2018-12-27 17:40:41 Found Serverless function with name='HelloWorldFunction' and CodeUri='hello_world/'
2018-12-27 17:40:41 Trying paths: ['C:\Users\scalwas\.docker\config.json', 'C:\Users\scalwas\.dockercfg']
2018-12-27 17:40:41 Found file at path: C:\Users\scalwas.docker\config.json
2018-12-27 17:40:41 Couldn't find auth-related section ; attempting to interpret as auth-only file2018-12-27 17:40:41 Config entry for key stackOrchestrator is not auth config
2018-12-27 17:40:41 Building resource 'HelloWorldFunction'
2018-12-27 17:40:41 Trying paths: ['C:\Users\scalwas\.docker\config.json', 'C:\Users\scalwas\.dockercfg']
2018-12-27 17:40:41 Found file at path: C:\Users\scalwas.docker\config.json
2018-12-27 17:40:41 Couldn't find auth-related section ; attempting to interpret as auth-only file2018-12-27 17:40:41 Config entry for key stackOrchestrator is not auth config
2018-12-27 17:40:41 http://localhost:None "GET /v1.35/images/lambci/lambda:build-python3.6/json HTTP/1.1" 200 None
2018-12-27 17:40:41 Looking for auth config
2018-12-27 17:40:41 Looking for auth entry for 'docker.io'
2018-12-27 17:40:41 No entry found
2018-12-27 17:40:41 No auth config found
2018-12-27 17:40:42 http://localhost:None "POST /v1.35/images/create?tag=build-python3.6&fromImage=lambci%2Flambda HTTP/1.1" 200 None
Fetching lambci/lambda:build-python3.6 Docker container image......
2018-12-27 17:40:42 Mounting C:\PythonCode\sampoc\sam-app\hello_world as /tmp/samcli/source:ro inside runtime container
2018-12-27 17:40:49 http://localhost:None "POST /v1.35/containers/create HTTP/1.1" 500 42
Traceback (most recent call last):
File "c:\python3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\python3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\scalwas\AppData\Roaming\Python\Python37\Scripts\sam.exe__main__.py", line 9, in
File "C:\Users\scalwas\AppData\Roaming\Python\Python36\site-packages\click\core.py", line 722, in __call__
return self.main(args, *kwargs)
File "C:\Users\scalwas\AppData\Roaming\Python\Python36\site-packages\click\core.py", line 697, in main
rv = self.invoke(ctx)
File "C:\Users\scalwas\AppData\Roaming\Python\Python36\site-packages\click\core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\scalwas\AppData\Roaming\Python\Python36\site-packages\click\core.py", line 895, in invoke
return ctx.invoke(self.callback, *ctx.params)
File "C:\Users\scalwas\AppData\Roaming\Python\Python36\site-packages\click\core.py", line 535, in invoke
return callback(args, *kwargs)
File "C:\Users\scalwas\AppData\Roaming\Python\Python36\site-packages\click\decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args[1:], *kwargs)
File "C:\Users\scalwas\AppData\Roaming\Python\Python36\site-packages\click\core.py", line 535, in invoke
return callback(args, *kwargs)
File "C:\Users\scalwas\AppData\Roaming\Python\Python36\site-packages\samcli\commands\build\command.py", line 94, in cli
skip_pull_image, parameter_overrides) # pragma: no cover
File "C:\Users\scalwas\AppData\Roaming\Python\Python36\site-packages\samcli\commands\build\command.py", line 132, in do_cli
artifacts = builder.build()
File "C:\Users\scalwas\AppData\Roaming\Python\Python36\site-packages\samcli\lib\build\app_builder.py", line 129, in build
lambda_function.runtime)
File "C:\Users\scalwas\AppData\Roaming\Python\Python36\site-packages\samcli\lib\build\app_builder.py", line 201, in _build_function
runtime)
File "C:\Users\scalwas\AppData\Roaming\Python\Python36\site-packages\samcli\lib\build\app_builder.py", line 261, in _build_function_on_container
container.wait_for_logs(stdout=stdout_stream, stderr=stderr_stream)
File "C:\Users\scalwas\AppData\Roaming\Python\Python36\site-packages\samcli\localdocker\container.py", line 196, in wait_for_logs
raise RuntimeError("Container does not exist. Cannot get logs for this container")
RuntimeError: Container does not exist. Cannot get logs for this container
@SCalwas Looking at your output, this is the key part:
2018-12-27 17:40:42 http://localhost:None "POST /v1.35/images/create?tag=build-python3.6&fromImage=lambci%2Flambda HTTP/1.1" 200 None
Fetching lambci/lambda:build-python3.6 Docker container image......
2018-12-27 17:40:42 Mounting C:\PythonCode\sampoc\sam-app\hello_world as /tmp/samcli/source:ro inside runtime container
2018-12-27 17:40:49 http://localhost:None "POST /v1.35/containers/create HTTP/1.1" 500 42
You can see that the container appears to be downloaded locally but we we go to create the container, docker blows up.
Given you are on Windows, can you make sure that the container type is linux and not windows. My current guess is that docker is giving an internal service error because of this. You are able to download so that means docker is running and responsive.
Docker is using Linux containers. During installation, Linux containers were the default type, and I left that unchanged. Also, right-clicking the Docker icon pops up a menu with an item of "Switch to Windows containers..." When clicked, a dialog asks if I'm sure I want to change from Linux containers to Windows containers. So definitely using Linux containers.
FYI: Using SAM 0.10.0 and Python 3.6.8 and running "sam build --use-container," Docker prompts whether I want to share drive C:. This prompt did not occur with SAM 0.08.0 and Python 3.7.1.
That prompt is from Docker not SAM CLI.
You want to share the C: drive, if that is the drive you are working from. Does sharing solve this for you?
Yes, I always respond "Yes" to sharing drive C. Then comes the crash.
@SCalwas Can you reach out to me on slack? If you are not in the samdev channel, you can join with the link in our README
To eliminate Docker asking to share drive C: on every run of "sam build ..." I went to the Docker settings to set drive C: as always shared. The sharing failed with the message "Firewall detected. A firewall is blocking file Sharing between Windows and the containers."
I'll have to install and configure Slack. Will try.
Ahh. So your Firewall is blocking docker access to the code (not sure why docker fails the way it does on that).
Without docker having access, you won't be able to run anything in containers (including invoking). You will have to resolve that in order to get it working.
:-) FYI: I work at AWS. SDK Programmer Writer. Think I have any chance of getting past the firewall??? :-)
I had the same error (I'm running Windows 10), sharing C drive solved it. Thank you very much!

Hey guys,
Just in case, ensure that you initialize and build using the latest sam cli install.
I had this issue when I tried initializing the app with an old version of the aws sam cli while doing the build with the newer version.
Initially issue was due to a firewall blocking the traffic to the Docker Daemon. Closing as it was an issue with the system and not SAM CLI
Most helpful comment
I had the same error (I'm running Windows 10), sharing C drive solved it. Thank you very much!