sam-cli local invoke error: Docker timeout after few seconds
up vote
0
down vote
favorite
I'm working on macOS High Sierra, and trying to run sam-cli to debug my lambdas locally. Lambda runtime is nodejs8.10, SAM CLI, version 0.4.0
I use the following command
sam local invoke --event payload.json --debug-port 5858 [lambdaName] --profile [profileName]
The debugger gets invoked and i'm able to debug the lambda code for a while before the docker timeout occurs.
`Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/bin/sam", line 11, in <module>
load_entry_point('aws-sam-cli==0.4.0', 'console_scripts', 'sam')()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args[1:], **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/commands/local/invoke/cli.py", line 44, in cli
docker_network, log_file, skip_pull_image, profile) # pragma: no cover
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/commands/local/invoke/cli.py", line 76, in do_cli
stderr=context.stderr)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/commands/local/lib/local_lambda.py", line 80, in invoke
stdout=stdout, stderr=stderr)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/local/lambdafn/runtime.py", line 98, in invoke
container.wait_for_logs(stdout=stdout, stderr=stderr)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/local/docker/container.py", line 187, in wait_for_logs
self._write_container_output(logs_itr, stdout=stdout, stderr=stderr)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/local/docker/container.py", line 206, in _write_container_output
for frame_type, data in output_itr:
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/local/docker/attach_api.py", line 98, in _read_socket
payload_type, payload_size = _read_header(socket)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/local/docker/attach_api.py", line 170, in _read_header
data = read_exactly(socket, 8)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/docker/utils/socket.py", line 47, in read_exactly
next_data = read(socket, n - len(data))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/docker/utils/socket.py", line 31, in read
return socket.recv(n)
socket.timeout: timed out`
This is my sam template
`AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
lambda Description
# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst
Globals:
Function:
Timeout: 300
Resources:
LambdaName:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
Handler: index.handler
Runtime: nodejs8.10
Environment:
Variables:
NODE_TLS_REJECT_UNAUTHORIZED : "0"
BUCKET_NAME : "bucketName"
KEY_NAME : "file.json"
DYNAMO_RULE_TABLE : "TableName"
NODE_ENV: "development" # NODE_ENV: "production"`
I'm unable to find the root cause for this issue.
python node.js amazon-web-services docker aws-lambda
add a comment |
up vote
0
down vote
favorite
I'm working on macOS High Sierra, and trying to run sam-cli to debug my lambdas locally. Lambda runtime is nodejs8.10, SAM CLI, version 0.4.0
I use the following command
sam local invoke --event payload.json --debug-port 5858 [lambdaName] --profile [profileName]
The debugger gets invoked and i'm able to debug the lambda code for a while before the docker timeout occurs.
`Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/bin/sam", line 11, in <module>
load_entry_point('aws-sam-cli==0.4.0', 'console_scripts', 'sam')()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args[1:], **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/commands/local/invoke/cli.py", line 44, in cli
docker_network, log_file, skip_pull_image, profile) # pragma: no cover
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/commands/local/invoke/cli.py", line 76, in do_cli
stderr=context.stderr)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/commands/local/lib/local_lambda.py", line 80, in invoke
stdout=stdout, stderr=stderr)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/local/lambdafn/runtime.py", line 98, in invoke
container.wait_for_logs(stdout=stdout, stderr=stderr)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/local/docker/container.py", line 187, in wait_for_logs
self._write_container_output(logs_itr, stdout=stdout, stderr=stderr)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/local/docker/container.py", line 206, in _write_container_output
for frame_type, data in output_itr:
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/local/docker/attach_api.py", line 98, in _read_socket
payload_type, payload_size = _read_header(socket)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/local/docker/attach_api.py", line 170, in _read_header
data = read_exactly(socket, 8)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/docker/utils/socket.py", line 47, in read_exactly
next_data = read(socket, n - len(data))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/docker/utils/socket.py", line 31, in read
return socket.recv(n)
socket.timeout: timed out`
This is my sam template
`AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
lambda Description
# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst
Globals:
Function:
Timeout: 300
Resources:
LambdaName:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
Handler: index.handler
Runtime: nodejs8.10
Environment:
Variables:
NODE_TLS_REJECT_UNAUTHORIZED : "0"
BUCKET_NAME : "bucketName"
KEY_NAME : "file.json"
DYNAMO_RULE_TABLE : "TableName"
NODE_ENV: "development" # NODE_ENV: "production"`
I'm unable to find the root cause for this issue.
python node.js amazon-web-services docker aws-lambda
Can you clarify- do you mean that your lambda invokes for five minutes and then times-out?
– thomasmichaelwallace
Nov 5 at 20:31
@thomasmichaelwallace I meant the SAM local starts and VS code debugger is able to bind to the debugging port, I'm able to debug few lines and the debugger terminates suddenly throwing the above error.
– Tore Binarflame
Nov 7 at 19:21
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm working on macOS High Sierra, and trying to run sam-cli to debug my lambdas locally. Lambda runtime is nodejs8.10, SAM CLI, version 0.4.0
I use the following command
sam local invoke --event payload.json --debug-port 5858 [lambdaName] --profile [profileName]
The debugger gets invoked and i'm able to debug the lambda code for a while before the docker timeout occurs.
`Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/bin/sam", line 11, in <module>
load_entry_point('aws-sam-cli==0.4.0', 'console_scripts', 'sam')()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args[1:], **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/commands/local/invoke/cli.py", line 44, in cli
docker_network, log_file, skip_pull_image, profile) # pragma: no cover
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/commands/local/invoke/cli.py", line 76, in do_cli
stderr=context.stderr)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/commands/local/lib/local_lambda.py", line 80, in invoke
stdout=stdout, stderr=stderr)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/local/lambdafn/runtime.py", line 98, in invoke
container.wait_for_logs(stdout=stdout, stderr=stderr)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/local/docker/container.py", line 187, in wait_for_logs
self._write_container_output(logs_itr, stdout=stdout, stderr=stderr)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/local/docker/container.py", line 206, in _write_container_output
for frame_type, data in output_itr:
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/local/docker/attach_api.py", line 98, in _read_socket
payload_type, payload_size = _read_header(socket)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/local/docker/attach_api.py", line 170, in _read_header
data = read_exactly(socket, 8)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/docker/utils/socket.py", line 47, in read_exactly
next_data = read(socket, n - len(data))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/docker/utils/socket.py", line 31, in read
return socket.recv(n)
socket.timeout: timed out`
This is my sam template
`AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
lambda Description
# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst
Globals:
Function:
Timeout: 300
Resources:
LambdaName:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
Handler: index.handler
Runtime: nodejs8.10
Environment:
Variables:
NODE_TLS_REJECT_UNAUTHORIZED : "0"
BUCKET_NAME : "bucketName"
KEY_NAME : "file.json"
DYNAMO_RULE_TABLE : "TableName"
NODE_ENV: "development" # NODE_ENV: "production"`
I'm unable to find the root cause for this issue.
python node.js amazon-web-services docker aws-lambda
I'm working on macOS High Sierra, and trying to run sam-cli to debug my lambdas locally. Lambda runtime is nodejs8.10, SAM CLI, version 0.4.0
I use the following command
sam local invoke --event payload.json --debug-port 5858 [lambdaName] --profile [profileName]
The debugger gets invoked and i'm able to debug the lambda code for a while before the docker timeout occurs.
`Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/bin/sam", line 11, in <module>
load_entry_point('aws-sam-cli==0.4.0', 'console_scripts', 'sam')()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/decorators.py", line 64, in new_func
return ctx.invoke(f, obj, *args[1:], **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/commands/local/invoke/cli.py", line 44, in cli
docker_network, log_file, skip_pull_image, profile) # pragma: no cover
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/commands/local/invoke/cli.py", line 76, in do_cli
stderr=context.stderr)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/commands/local/lib/local_lambda.py", line 80, in invoke
stdout=stdout, stderr=stderr)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/local/lambdafn/runtime.py", line 98, in invoke
container.wait_for_logs(stdout=stdout, stderr=stderr)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/local/docker/container.py", line 187, in wait_for_logs
self._write_container_output(logs_itr, stdout=stdout, stderr=stderr)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/local/docker/container.py", line 206, in _write_container_output
for frame_type, data in output_itr:
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/local/docker/attach_api.py", line 98, in _read_socket
payload_type, payload_size = _read_header(socket)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/samcli/local/docker/attach_api.py", line 170, in _read_header
data = read_exactly(socket, 8)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/docker/utils/socket.py", line 47, in read_exactly
next_data = read(socket, n - len(data))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/docker/utils/socket.py", line 31, in read
return socket.recv(n)
socket.timeout: timed out`
This is my sam template
`AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
lambda Description
# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst
Globals:
Function:
Timeout: 300
Resources:
LambdaName:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
Handler: index.handler
Runtime: nodejs8.10
Environment:
Variables:
NODE_TLS_REJECT_UNAUTHORIZED : "0"
BUCKET_NAME : "bucketName"
KEY_NAME : "file.json"
DYNAMO_RULE_TABLE : "TableName"
NODE_ENV: "development" # NODE_ENV: "production"`
I'm unable to find the root cause for this issue.
python node.js amazon-web-services docker aws-lambda
python node.js amazon-web-services docker aws-lambda
asked Nov 5 at 16:59
Tore Binarflame
5218
5218
Can you clarify- do you mean that your lambda invokes for five minutes and then times-out?
– thomasmichaelwallace
Nov 5 at 20:31
@thomasmichaelwallace I meant the SAM local starts and VS code debugger is able to bind to the debugging port, I'm able to debug few lines and the debugger terminates suddenly throwing the above error.
– Tore Binarflame
Nov 7 at 19:21
add a comment |
Can you clarify- do you mean that your lambda invokes for five minutes and then times-out?
– thomasmichaelwallace
Nov 5 at 20:31
@thomasmichaelwallace I meant the SAM local starts and VS code debugger is able to bind to the debugging port, I'm able to debug few lines and the debugger terminates suddenly throwing the above error.
– Tore Binarflame
Nov 7 at 19:21
Can you clarify- do you mean that your lambda invokes for five minutes and then times-out?
– thomasmichaelwallace
Nov 5 at 20:31
Can you clarify- do you mean that your lambda invokes for five minutes and then times-out?
– thomasmichaelwallace
Nov 5 at 20:31
@thomasmichaelwallace I meant the SAM local starts and VS code debugger is able to bind to the debugging port, I'm able to debug few lines and the debugger terminates suddenly throwing the above error.
– Tore Binarflame
Nov 7 at 19:21
@thomasmichaelwallace I meant the SAM local starts and VS code debugger is able to bind to the debugging port, I'm able to debug few lines and the debugger terminates suddenly throwing the above error.
– Tore Binarflame
Nov 7 at 19:21
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53158890%2fsam-cli-local-invoke-error-docker-timeout-after-few-seconds%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Can you clarify- do you mean that your lambda invokes for five minutes and then times-out?
– thomasmichaelwallace
Nov 5 at 20:31
@thomasmichaelwallace I meant the SAM local starts and VS code debugger is able to bind to the debugging port, I'm able to debug few lines and the debugger terminates suddenly throwing the above error.
– Tore Binarflame
Nov 7 at 19:21