-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: sam local invoke - ReadTimeout #6191
Comments
thanks @Joymaker for raising this issue. It looks like that the docker daemon is not running, could you please make sure that the |
Here you go. I noticed the following line:
I don't understand what would have happened here, because I did a total naïve, new-user install.
|
I'm having the exact same issue as well
|
In the end I got past this problem by doing a radical uninstall (manually) and reinstall of Docker. I used the form |
It seems the issue has been resolved after re-installing docker. I am closing this issue, feel free to open a new issue with more details if you are still facing issues or have concerns. |
|
Description:
Running on Mac with Docker desktop 4.24.0 and Docker engine 24.0.6. I ran the "hello world" SAM tutorial https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-getting-started-hello-world.html except that I opted into X-ray. Everything went according to plan through step 6. But then:
% sam local invoke
<silence of 1-2 minutes>
Error: UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)
Traceback:
File "click/core.py", line 1078, in main
File "click/core.py", line 1688, in invoke
File "click/core.py", line 1688, in invoke
File "click/core.py", line 1434, in invoke
File "click/core.py", line 783, in invoke
File "samcli/cli/cli_config_file.py", line 297, in wrapper
File "click/decorators.py", line 92, in new_func
File "click/core.py", line 783, in invoke
File "samcli/lib/telemetry/metric.py", line 184, in wrapped
File "samcli/lib/telemetry/metric.py", line 149, in wrapped
File "samcli/lib/utils/version_checker.py", line 42, in wrapped
File "samcli/cli/main.py", line 95, in wrapper
File "samcli/commands/local/invoke/cli.py", line 103, in cli
File "samcli/commands/local/invoke/cli.py", line 178, in do_cli
File "samcli/commands/local/cli_common/invoke_context.py", line 266, in enter
File "samcli/local/docker/manager.py", line 55, in is_docker_reachable
File "samcli/local/docker/utils.py", line 90, in is_docker_reachable
File "docker/client.py", line 203, in ping
File "docker/api/daemon.py", line 166, in ping
File "docker/utils/decorators.py", line 46, in inner
File "docker/api/client.py", line 237, in _get
File "requests/sessions.py", line 602, in get
File "requests/sessions.py", line 589, in request
File "requests/sessions.py", line 703, in send
File "requests/adapters.py", line 532, in send
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-%20ReadTimeout
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-%20ReadTimeout
Observed result:
% sam local invoke --debug
2023-11-02 08:43:21,628 | Config file location: /Users/ken/Snthesis/Tools/SAM tutorial/samconfig.toml
2023-11-02 08:43:21,633 | Loading configuration values from [default.['local', 'invoke'].parameters]
(env.command_name.section) in config file at '/Users/ken/Snthesis/Tools/SAM tutorial/samconfig.toml'...
2023-11-02 08:43:21,635 | Configuration values successfully loaded.
2023-11-02 08:43:21,636 | Configuration values are: {'stack_name': 'sam-app'}
2023-11-02 08:43:21,644 | Using SAM Template at /Users/ken/Snthesis/Tools/SAM tutorial/.aws-sam/build/template.yaml
2023-11-02 08:43:21,694 | Using config file: samconfig.toml, config environment: default
2023-11-02 08:43:21,696 | Expand command line arguments to:
2023-11-02 08:43:21,697 | --template_file=/Users/ken/Snthesis/Tools/SAM tutorial/.aws-sam/build/template.yaml
--no_event --layer_cache_basedir=/Users/ken/.aws-sam/layers-pkg --container_host=localhost
--container_host_interface=127.0.0.1
2023-11-02 08:43:21,699 | local invoke command is called
2023-11-02 08:43:21,706 | No Parameters detected in the template
2023-11-02 08:43:21,747 | Sam customer defined id is more priority than other IDs. Customer defined id for resource
HelloWorldFunction is HelloWorldFunction
2023-11-02 08:43:21,748 | 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
2023-11-02 08:43:21,751 | 0 stacks found in the template
2023-11-02 08:43:21,753 | No Parameters detected in the template
2023-11-02 08:43:21,795 | Sam customer defined id is more priority than other IDs. Customer defined id for resource
HelloWorldFunction is HelloWorldFunction
2023-11-02 08:43:21,797 | 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
2023-11-02 08:43:21,799 | 2 resources found in the stack
2023-11-02 08:43:21,800 | Found Serverless function with name='HelloWorldFunction' and CodeUri='HelloWorldFunction'
2023-11-02 08:43:21,801 | --base-dir is not presented, adjusting uri HelloWorldFunction relative to
/Users/ken/Snthesis/Tools/SAM tutorial/.aws-sam/build/template.yaml
2023-11-02 08:44:21,812 | Telemetry endpoint configured to be
https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2023-11-02 08:44:21,902 | Telemetry endpoint configured to be
https://aws-serverless-tools-telemetry.us-west-2.amazonaws.com/metrics
2023-11-02 08:44:21,905 | Sending Telemetry: {'metrics': [{'commandRun': {'requestId':
'a7ec3911-0076-457b-a376-d1c059d6ea0e', 'installationId': 'fbec54fc-a77c-4092-8591-fffb078d0066', 'sessionId':
'7a5e9614-bc70-4397-bdb6-7b6d6fac76ae', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.8.13',
'samcliVersion': '1.99.0', 'awsProfileProvided': False, 'debugFlagProvided': True, 'region': '', 'commandName':
'sam local invoke', 'metricSpecificAttributes': {'projectType': 'CFN', 'gitOrigin': None, 'projectName':
'6ab8971aae664fa1dae8d905143149c4ba902d09cea5f08ebdf59f2d51f1f57e', 'initialCommit': None}, 'duration': 60120,
'exitReason': 'ReadTimeout', 'exitCode': 255}}]}
2023-11-02 08:44:21,905 | Unable to find Click Context for getting session_id.
2023-11-02 08:44:21,913 | Sending Telemetry: {'metrics': [{'events': {'requestId':
'63ef94f3-2eed-4d4e-b42e-aeebc79d85c4', 'installationId': 'fbec54fc-a77c-4092-8591-fffb078d0066', 'sessionId':
'7a5e9614-bc70-4397-bdb6-7b6d6fac76ae', 'executionEnvironment': 'CLI', 'ci': False, 'pyversion': '3.8.13',
'samcliVersion': '1.99.0', 'commandName': 'sam local invoke', 'metricSpecificAttributes': {'events':
[{'event_name': 'SamConfigFileExtension', 'event_value': '.toml', 'thread_id': '1d89df6b1c9640e8a85a8f90487f8b29',
'time_stamp': '2023-11-02 12:43:21.627', 'exception_name': None}, {'event_name': 'SamConfigFileExtension',
'event_value': '.toml', 'thread_id': 'c2205ea080924f74b49c88f5d6954ff1', 'time_stamp': '2023-11-02 12:43:21.694',
'exception_name': None}]}}}]}
2023-11-02 08:44:22,385 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com',
port=443): Read timed out. (read timeout=0.1)
Error: UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=60)
Traceback:
File "click/core.py", line 1078, in main
File "click/core.py", line 1688, in invoke
File "click/core.py", line 1688, in invoke
File "click/core.py", line 1434, in invoke
File "click/core.py", line 783, in invoke
File "samcli/cli/cli_config_file.py", line 297, in wrapper
File "click/decorators.py", line 92, in new_func
File "click/core.py", line 783, in invoke
File "samcli/lib/telemetry/metric.py", line 184, in wrapped
File "samcli/lib/telemetry/metric.py", line 149, in wrapped
File "samcli/lib/utils/version_checker.py", line 42, in wrapped
File "samcli/cli/main.py", line 95, in wrapper
File "samcli/commands/local/invoke/cli.py", line 103, in cli
File "samcli/commands/local/invoke/cli.py", line 178, in do_cli
File "samcli/commands/local/cli_common/invoke_context.py", line 266, in enter
File "samcli/local/docker/manager.py", line 55, in is_docker_reachable
File "samcli/local/docker/utils.py", line 90, in is_docker_reachable
File "docker/client.py", line 203, in ping
File "docker/api/daemon.py", line 166, in ping
File "docker/utils/decorators.py", line 46, in inner
File "docker/api/client.py", line 237, in _get
File "requests/sessions.py", line 602, in get
File "requests/sessions.py", line 589, in request
File "requests/sessions.py", line 703, in send
File "requests/adapters.py", line 532, in send
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-%20ReadTimeout
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-%20ReadTimeout
2023-11-02 08:44:22,393 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com',
port=443): Read timed out. (read timeout=0.1)
Expected result:
(As scripted in the tutorial)
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: SAM CLI, version 1.99.0The text was updated successfully, but these errors were encountered: