Skip to content

Instantly share code, notes, and snippets.

@austinlparker
Created June 19, 2018 18:00
Show Gist options
  • Save austinlparker/f12ee4c9048834c99891384c433f4ec3 to your computer and use it in GitHub Desktop.
Save austinlparker/f12ee4c9048834c99891384c433f4ec3 to your computer and use it in GitHub Desktop.
(samcli27) aparker@irvine  ~/go/src/github.com/apprenda/rebind   master ●  samdev local start-api --docker-network lambda-local -t templates/results-template.yml -n etc/devenv/results/docker-dynamo-environment.json --skip-pull-image --debug -d 5985
2018-06-19 13:58:20 local start-api command is called
2018-06-19 13:58:20 3 resources found in the template
2018-06-19 13:58:20 Found Serverless function with name='RebindIngestService' and CodeUri='../bin/cmd/ingest'
2018-06-19 13:58:20 Found Serverless function with name='RebindQueryService' and CodeUri='../bin/cmd/query'
2018-06-19 13:58:20 Trying paths: ['/Users/aparker/.docker/config.json', '/Users/aparker/.dockercfg']
2018-06-19 13:58:20 Found file at path: /Users/aparker/.docker/config.json
2018-06-19 13:58:20 Found 'auths' section
2018-06-19 13:58:20 Auth data for https://index.docker.io/v1/ is absent. Client might be using a credentials store instead.
2018-06-19 13:58:20 Found 'credsStore' section
2018-06-19 13:58:20 http://localhost:None "GET /v1.35/_ping HTTP/1.1" 200 2
2018-06-19 13:58:20 3 resources found in the template
2018-06-19 13:58:20 Found '0' API Events in Serverless function with name 'RebindIngestService'
2018-06-19 13:58:20 Found '1' API Events in Serverless function with name 'RebindQueryService'
2018-06-19 13:58:20 Detected Inline Swagger definition
2018-06-19 13:58:20 Lambda function integration not found in Swagger document at path='/search' method='get'
2018-06-19 13:58:20 Found '0' APIs in resource 'ServerlessRestApi'
2018-06-19 13:58:20 Removed duplicates from '0' Explicit APIs and '1' Implicit APIs to produce '1' APIs
2018-06-19 13:58:20 1 APIs found in the template
2018-06-19 13:58:20 Trying paths: ['/Users/aparker/.docker/config.json', '/Users/aparker/.dockercfg']
2018-06-19 13:58:20 Found file at path: /Users/aparker/.docker/config.json
2018-06-19 13:58:20 Found 'auths' section
2018-06-19 13:58:20 Auth data for https://index.docker.io/v1/ is absent. Client might be using a credentials store instead.
2018-06-19 13:58:20 Found 'credsStore' section
2018-06-19 13:58:20 Mounting RebindQueryService at http://127.0.0.1:3000/search [GET]
2018-06-19 13:58:20 You can now browse to the above endpoints to invoke your functions. You do not need to restart/reload SAM CLI while working on your functions changes will be reflected instantly/automatically. You only need to restart SAM CLI if you update your AWS SAM template
2018-06-19 13:58:20 Local API Server starting up. Multi-threading = False
2018-06-19 13:58:20 * Running on http://127.0.0.1:3000/ (Press CTRL+C to quit)
2018-06-19 13:58:23 Constructed String representation of Event to invoke Lambda. Event: {"body": null, "httpMethod": "GET", "resource": "/search", "queryStringParameters": null, "requestContext": {"httpMethod": "GET", "requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef", "path": "/search", "extendedRequestId": null, "resourceId": "123456", "apiId": "1234567890", "stage": "prod", "resourcePath": "/search", "identity": {"accountId": null, "apiKey": null, "userArn": null, "cognitoAuthenticationProvider": null, "cognitoIdentityPoolId": null, "userAgent": "Custom User Agent String", "caller": null, "cognitoAuthenticationType": null, "sourceIp": "127.0.0.1", "user": null}, "accountId": "123456789012"}, "headers": {"Host": "127.0.0.1:3000", "X-Forwarded-Proto": "http", "Accept-Encoding": "gzip, deflate", "X-Forwarded-Port": "3000", "Connection": "keep-alive", "Accept": "*/*", "User-Agent": "HTTPie/0.9.9"}, "stageVariables": null, "path": "/search", "pathParameters": null, "isBase64Encoded": false}
2018-06-19 13:58:23 Found one Lambda function with name 'RebindQueryService'
2018-06-19 13:58:23 Invoking query (go1.x)
2018-06-19 13:58:23 Environment variables overrides data is standard format
2018-06-19 13:58:23 Loading AWS credentials from session with profile 'None'
2018-06-19 13:58:23 Loading variable profile from defaults.
2018-06-19 13:58:23 Loading variable config_file from defaults.
2018-06-19 13:58:23 Loading variable credentials_file from defaults.
2018-06-19 13:58:23 Loading variable data_path from defaults.
2018-06-19 13:58:23 Loading variable profile from defaults.
2018-06-19 13:58:23 Loading variable credentials_file from defaults.
2018-06-19 13:58:23 Loading variable config_file from defaults.
2018-06-19 13:58:23 Loading variable profile from defaults.
2018-06-19 13:58:23 Loading variable metadata_service_timeout from defaults.
2018-06-19 13:58:23 Loading variable profile from defaults.
2018-06-19 13:58:23 Loading variable metadata_service_num_attempts from defaults.
2018-06-19 13:58:23 Loading variable profile from defaults.
2018-06-19 13:58:23 Looking for credentials via: env
2018-06-19 13:58:23 Looking for credentials via: assume-role
2018-06-19 13:58:23 Looking for credentials via: shared-credentials-file
2018-06-19 13:58:23 Found credentials in shared credentials file: ~/.aws/credentials
2018-06-19 13:58:23 Loading variable profile from defaults.
2018-06-19 13:58:23 Loading variable profile from defaults.
2018-06-19 13:58:23 Loading variable region from config file with value 'us-east-1'.
2018-06-19 13:58:23 Loading variable profile from defaults.
2018-06-19 13:58:23 Loading variable profile from defaults.
2018-06-19 13:58:23 Loading variable region from config file with value 'us-east-1'.
2018-06-19 13:58:23 Loading variable profile from defaults.
2018-06-19 13:58:23 Loading variable profile from defaults.
2018-06-19 13:58:23 Loading variable region from config file with value 'us-east-1'.
2018-06-19 13:58:23 Resolving code path. Cwd=/Users/aparker/go/src/github.com/apprenda/rebind/templates, CodeUri=../bin/cmd/query
2018-06-19 13:58:23 Resolved absolute path to code is /Users/aparker/go/src/github.com/apprenda/rebind/bin/cmd/query
2018-06-19 13:58:23 Code /Users/aparker/go/src/github.com/apprenda/rebind/bin/cmd/query is not a zip/jar file
2018-06-19 13:58:23 Trying paths: ['/Users/aparker/.docker/config.json', '/Users/aparker/.dockercfg']
2018-06-19 13:58:23 Found file at path: /Users/aparker/.docker/config.json
2018-06-19 13:58:23 Found 'auths' section
2018-06-19 13:58:23 Auth data for https://index.docker.io/v1/ is absent. Client might be using a credentials store instead.
2018-06-19 13:58:23 Found 'credsStore' section
2018-06-19 13:58:23 http://localhost:None "GET /v1.35/images/lambci/lambda:go1.x/json HTTP/1.1" 200 None
2018-06-19 13:58:23 Requested to skip pulling images ...
2018-06-19 13:58:23 Mounting /Users/aparker/go/src/github.com/apprenda/rebind/bin/cmd/query as /var/task:ro inside runtime container
2018-06-19 13:58:24 http://localhost:None "POST /v1.35/containers/create HTTP/1.1" 201 90
2018-06-19 13:58:24 http://localhost:None "GET /v1.35/containers/b583d6e0f30afd504a5ca8b622dd7786473b364173a80e5e3460a500d4e9926a/json HTTP/1.1" 200 None
2018-06-19 13:58:24 http://localhost:None "GET /v1.35/networks/lambda-local HTTP/1.1" 200 678
2018-06-19 13:58:24 http://localhost:None "POST /v1.35/networks/b1bc18c9ca629c348a674236714d2d2b492e81dcdcce0e58e63b2b570a33c494/connect HTTP/1.1" 200 0
2018-06-19 13:58:24 http://localhost:None "GET /v1.35/containers/b583d6e0f30afd504a5ca8b622dd7786473b364173a80e5e3460a500d4e9926a/json HTTP/1.1" 200 None
2018-06-19 13:58:24 http://localhost:None "POST /v1.35/containers/b583d6e0f30afd504a5ca8b622dd7786473b364173a80e5e3460a500d4e9926a/start HTTP/1.1" 204 0
2018-06-19 13:58:24 Setting up SIGTERM interrupt handler
2018-06-19 13:58:24 http://localhost:None "GET /v1.35/containers/b583d6e0f30afd504a5ca8b622dd7786473b364173a80e5e3460a500d4e9926a/json HTTP/1.1" 200 None
2018-06-19 13:58:24 http://localhost:None "POST /containers/b583d6e0f30afd504a5ca8b622dd7786473b364173a80e5e3460a500d4e9926a/attach?stream=1&stdin=0&logs=1&stderr=1&stdout=1 HTTP/1.1" 101 0
Could not create config directory: mkdir /home/sbx_user1051: permission denied.2018/06/19 17:58:29 debugger.go:109: launching process with args: [/var/task/query]
API server listening at: [::]:5985
2018-06-19 13:59:25 http://localhost:None "GET /v1.35/containers/b583d6e0f30afd504a5ca8b622dd7786473b364173a80e5e3460a500d4e9926a/json HTTP/1.1" 200 None
2018-06-19 13:59:26 http://localhost:None "DELETE /v1.35/containers/b583d6e0f30afd504a5ca8b622dd7786473b364173a80e5e3460a500d4e9926a?force=True&link=False&v=False HTTP/1.1" 204 0
2018-06-19 13:59:26 Exception on /search [GET]
Traceback (most recent call last):
File "/Users/aparker/.pyenv/versions/2.7.14/envs/samcli27/lib/python2.7/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/Users/aparker/.pyenv/versions/2.7.14/envs/samcli27/lib/python2.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Users/aparker/.pyenv/versions/2.7.14/envs/samcli27/lib/python2.7/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/Users/aparker/.pyenv/versions/2.7.14/envs/samcli27/lib/python2.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/Users/aparker/.pyenv/versions/2.7.14/envs/samcli27/lib/python2.7/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/Users/aparker/code/aws-sam-cli-dev/samcli/local/apigw/service.py", line 185, in _request_handler
self.lambda_runner.invoke(route.function_name, event, stdout=stdout_stream, stderr=self.stderr)
File "/Users/aparker/code/aws-sam-cli-dev/samcli/commands/local/lib/local_lambda.py", line 80, in invoke
stdout=stdout, stderr=stderr)
File "/Users/aparker/code/aws-sam-cli-dev/samcli/local/lambdafn/runtime.py", line 98, in invoke
container.wait_for_logs(stdout=stdout, stderr=stderr)
File "/Users/aparker/code/aws-sam-cli-dev/samcli/local/docker/container.py", line 189, in wait_for_logs
self._write_container_output(logs_itr, stdout=stdout, stderr=stderr)
File "/Users/aparker/code/aws-sam-cli-dev/samcli/local/docker/container.py", line 208, in _write_container_output
for frame_type, data in output_itr:
File "/Users/aparker/code/aws-sam-cli-dev/samcli/local/docker/attach_api.py", line 98, in _read_socket
payload_type, payload_size = _read_header(socket)
File "/Users/aparker/code/aws-sam-cli-dev/samcli/local/docker/attach_api.py", line 170, in _read_header
data = read_exactly(socket, 8)
File "/Users/aparker/.pyenv/versions/2.7.14/envs/samcli27/lib/python2.7/site-packages/docker/utils/socket.py", line 44, in read_exactly
next_data = read(socket, n - len(data))
File "/Users/aparker/.pyenv/versions/2.7.14/envs/samcli27/lib/python2.7/site-packages/docker/utils/socket.py", line 30, in read
return socket.recv(n)
timeout: timed out
2018-06-19 13:59:26 127.0.0.1 - - [19/Jun/2018 13:59:26] "GET /search HTTP/1.1" 502 -
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 50291)
Traceback (most recent call last):
File "/Users/aparker/.pyenv/versions/2.7.14/lib/python2.7/SocketServer.py", line 290, in _handle_request_noblock
self.process_request(request, client_address)
File "/Users/aparker/.pyenv/versions/2.7.14/lib/python2.7/SocketServer.py", line 318, in process_request
self.finish_request(request, client_address)
File "/Users/aparker/.pyenv/versions/2.7.14/lib/python2.7/SocketServer.py", line 331, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/Users/aparker/.pyenv/versions/2.7.14/lib/python2.7/SocketServer.py", line 654, in __init__
self.finish()
File "/Users/aparker/.pyenv/versions/2.7.14/lib/python2.7/SocketServer.py", line 713, in finish
self.wfile.close()
File "/Users/aparker/.pyenv/versions/2.7.14/lib/python2.7/socket.py", line 283, in close
self.flush()
File "/Users/aparker/.pyenv/versions/2.7.14/lib/python2.7/socket.py", line 307, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
----------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment