question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

400 Client Error: Bad Request ("OCI runtime create failed...

See original GitHub issue

Description

I am just following the serverless quick start tutorial. I’ve installed Docker already (Docker version 18.09.2, build 6247962).

Steps to reproduce

  1. sam init -r nodejs -d npm
  2. sam local invoke HelloWorldFunction --event event.json

Observed result

2019-07-02 20:00:56 Using SAM Template at /Users/dylan/Tutorials/aws/serverless-quick-start/sam-app/template.yaml
2019-07-02 20:00:56 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2019-07-02 20:00:56 Changing event name from before-call.apigateway to before-call.api-gateway
2019-07-02 20:00:56 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2019-07-02 20:00:56 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2019-07-02 20:00:56 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2019-07-02 20:00:56 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2019-07-02 20:00:56 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2019-07-02 20:00:56 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2019-07-02 20:00:56 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2019-07-02 20:00:56 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2019-07-02 20:00:56 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2019-07-02 20:00:56 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2019-07-02 20:00:56 Changing event name from before-call.apigateway to before-call.api-gateway
2019-07-02 20:00:56 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2019-07-02 20:00:56 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2019-07-02 20:00:56 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2019-07-02 20:00:56 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2019-07-02 20:00:56 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2019-07-02 20:00:56 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2019-07-02 20:00:56 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2019-07-02 20:00:56 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2019-07-02 20:00:56 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2019-07-02 20:00:56 local invoke command is called
2019-07-02 20:00:56 No Parameters detected in the template
2019-07-02 20:00:56 2 resources found in the template
2019-07-02 20:00:56 Found Serverless function with name='HelloWorldFunction' and CodeUri='hello-world/'
2019-07-02 20:00:56 Trying paths: ['/Users/dylan/.docker/config.json', '/Users/dylan/.dockercfg']
2019-07-02 20:00:56 Found file at path: /Users/dylan/.docker/config.json
2019-07-02 20:00:56 Found 'auths' section
2019-07-02 20:00:56 Auth data for https://index.docker.io/v1/ is absent. Client might be using a credentials store instead.
2019-07-02 20:00:56 Found 'credsStore' section
2019-07-02 20:00:56 http://localhost:None "GET /v1.35/_ping HTTP/1.1" 200 2
2019-07-02 20:00:56 Trying paths: ['/Users/dylan/.docker/config.json', '/Users/dylan/.dockercfg']
2019-07-02 20:00:56 Found file at path: /Users/dylan/.docker/config.json
2019-07-02 20:00:56 Found 'auths' section
2019-07-02 20:00:56 Auth data for https://index.docker.io/v1/ is absent. Client might be using a credentials store instead.
2019-07-02 20:00:56 Found 'credsStore' section
2019-07-02 20:00:56 Found one Lambda function with name 'HelloWorldFunction'
2019-07-02 20:00:56 Invoking app.lambdaHandler (nodejs)
2019-07-02 20:00:56 No environment variables found for function 'HelloWorldFunction'
2019-07-02 20:00:56 Environment variables overrides data is standard format
2019-07-02 20:00:56 Loading AWS credentials from session with profile 'None'
2019-07-02 20:00:56 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2019-07-02 20:00:56 Changing event name from before-call.apigateway to before-call.api-gateway
2019-07-02 20:00:56 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2019-07-02 20:00:56 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2019-07-02 20:00:56 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2019-07-02 20:00:56 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2019-07-02 20:00:56 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2019-07-02 20:00:56 Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2019-07-02 20:00:56 Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2019-07-02 20:00:56 Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2019-07-02 20:00:56 Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2019-07-02 20:00:56 Looking for credentials via: env
2019-07-02 20:00:56 Looking for credentials via: assume-role
2019-07-02 20:00:56 Looking for credentials via: shared-credentials-file
2019-07-02 20:00:56 Looking for credentials via: custom-process
2019-07-02 20:00:56 Looking for credentials via: config-file
2019-07-02 20:00:56 Looking for credentials via: ec2-credentials-file
2019-07-02 20:00:56 Looking for credentials via: boto-config
2019-07-02 20:00:56 Looking for credentials via: container-role
2019-07-02 20:00:56 Looking for credentials via: iam-role
2019-07-02 20:00:56 Converted retries value: False -> Retry(total=False, connect=None, read=None, redirect=0, status=None)
2019-07-02 20:00:56 Starting new HTTP connection (1): 169.254.169.254:80
2019-07-02 20:00:57 Caught retryable HTTP exception while making metadata service request to http://169.254.169.254/latest/meta-data/iam/security-credentials/: Connect timeout on endpoint URL: "http://169.254.169.254/latest/meta-data/iam/security-credentials/"
Traceback (most recent call last):
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/urllib3/connection.py", line 160, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/urllib3/util/connection.py", line 80, in create_connection
    raise err
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/urllib3/util/connection.py", line 70, in create_connection
    sock.connect(sa)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/botocore/httpsession.py", line 262, in send
    chunked=self._chunked(request.headers),
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/urllib3/connectionpool.py", line 641, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/urllib3/util/retry.py", line 344, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/urllib3/packages/six.py", line 686, in reraise
    raise value
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/urllib3/connectionpool.py", line 603, in urlopen
    chunked=chunked)
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/urllib3/connectionpool.py", line 355, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1229, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/botocore/awsrequest.py", line 125, in _send_request
    method, url, body, headers, *args, **kwargs)
  File "/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1275, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1224, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/botocore/awsrequest.py", line 152, in _send_output
    self.send(msg)
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/botocore/awsrequest.py", line 236, in send
    return super(AWSConnection, self).send(str)
  File "/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 956, in send
    self.connect()
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/urllib3/connection.py", line 183, in connect
    conn = self._new_conn()
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/urllib3/connection.py", line 165, in _new_conn
    (self.host, self.timeout))
urllib3.exceptions.ConnectTimeoutError: (<botocore.awsrequest.AWSHTTPConnection object at 0x10f5fccc0>, 'Connection to 169.254.169.254 timed out. (connect timeout=1)')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/botocore/utils.py", line 303, in _get_request
    response = self._session.send(request.prepare())
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/botocore/httpsession.py", line 286, in send
    raise ConnectTimeoutError(endpoint_url=request.url, error=e)
botocore.exceptions.ConnectTimeoutError: Connect timeout on endpoint URL: "http://169.254.169.254/latest/meta-data/iam/security-credentials/"
2019-07-02 20:00:57 Max number of attempts exceeded (1) when attempting to retrieve data from metadata service.
2019-07-02 20:00:57 Resolving code path. Cwd=/Users/dylan/Tutorials/aws/serverless-quick-start/sam-app, CodeUri=hello-world/
2019-07-02 20:00:57 Resolved absolute path to code is /Users/dylan/Tutorials/aws/serverless-quick-start/sam-app/hello-world
2019-07-02 20:00:57 Code /Users/dylan/Tutorials/aws/serverless-quick-start/sam-app/hello-world is not a zip/jar file
2019-07-02 20:00:57 Skipping building an image since no layers were defined
2019-07-02 20:00:57 Trying paths: ['/Users/dylan/.docker/config.json', '/Users/dylan/.dockercfg']
2019-07-02 20:00:57 Found file at path: /Users/dylan/.docker/config.json
2019-07-02 20:00:57 Found 'auths' section
2019-07-02 20:00:57 Auth data for https://index.docker.io/v1/ is absent. Client might be using a credentials store instead.
2019-07-02 20:00:57 Found 'credsStore' section
2019-07-02 20:00:57 http://localhost:None "GET /v1.35/images/lambci/lambda:nodejs/json HTTP/1.1" 200 None
2019-07-02 20:00:57 Looking for auth config
2019-07-02 20:00:57 Using credentials store "osxkeychain"
2019-07-02 20:00:57 Looking for auth entry for 'https://index.docker.io/v1/'
2019-07-02 20:00:57 Found auth config
2019-07-02 20:00:58 http://localhost:None "POST /v1.35/images/create?tag=nodejs&fromImage=lambci%2Flambda HTTP/1.1" 200 None

Fetching lambci/lambda:nodejs Docker container image......
2019-07-02 20:00:58 Mounting /Users/dylan/Tutorials/aws/serverless-quick-start/sam-app/hello-world as /var/task:ro,delegated inside runtime container
2019-07-02 20:00:58 http://localhost:None "POST /v1.35/containers/create HTTP/1.1" 201 90
2019-07-02 20:00:58 http://localhost:None "GET /v1.35/containers/842ebb63b47d26eed69c9b15269c2a7aef4b11abc891ce27949e9a00e0a1b936/json HTTP/1.1" 200 None
2019-07-02 20:00:58 http://localhost:None "GET /v1.35/containers/842ebb63b47d26eed69c9b15269c2a7aef4b11abc891ce27949e9a00e0a1b936/json HTTP/1.1" 200 None
2019-07-02 20:00:59 http://localhost:None "POST /v1.35/containers/842ebb63b47d26eed69c9b15269c2a7aef4b11abc891ce27949e9a00e0a1b936/start HTTP/1.1" 400 187
2019-07-02 20:00:59 http://localhost:None "GET /v1.35/containers/842ebb63b47d26eed69c9b15269c2a7aef4b11abc891ce27949e9a00e0a1b936/json HTTP/1.1" 200 None
2019-07-02 20:00:59 http://localhost:None "DELETE /v1.35/containers/842ebb63b47d26eed69c9b15269c2a7aef4b11abc891ce27949e9a00e0a1b936?v=False&link=False&force=True HTTP/1.1" 204 0
Traceback (most recent call last):
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/docker/api/client.py", line 261, in _raise_for_status
    response.raise_for_status()
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http+docker://localhost/v1.35/containers/842ebb63b47d26eed69c9b15269c2a7aef4b11abc891ce27949e9a00e0a1b936/start

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/sam", line 11, in <module>
    load_entry_point('aws-sam-cli==0.17.0', 'console_scripts', 'sam')()
  File "/usr/local/Cellar/aws-sam-cli/0.17.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.17.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.17.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.17.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.17.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.17.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.17.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.17.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.17.0/libexec/lib/python3.7/site-packages/samcli/commands/local/invoke/cli.py", line 56, in cli
    parameter_overrides)  # pragma: no cover
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/samcli/commands/local/invoke/cli.py", line 100, in do_cli
    stderr=context.stderr)
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/samcli/commands/local/lib/local_lambda.py", line 93, in invoke
    self.local_runtime.invoke(config, event, debug_context=self.debug_context, stdout=stdout, stderr=stderr)
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/samcli/local/lambdafn/runtime.py", line 86, in invoke
    self._container_manager.run(container)
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/samcli/local/docker/manager.py", line 98, in run
    container.start(input_data=input_data)
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/samcli/local/docker/container.py", line 187, in start
    real_container.start()
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/docker/models/containers.py", line 400, in start
    return self.client.api.start(self.id, **kwargs)
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/docker/utils/decorators.py", line 19, in wrapped
    return f(self, resource_id, *args, **kwargs)
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/docker/api/container.py", line 1093, in start
    self._raise_for_status(res)
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/docker/api/client.py", line 263, in _raise_for_status
    raise create_api_error_from_http_exception(e)
  File "/usr/local/Cellar/aws-sam-cli/0.17.0/libexec/lib/python3.7/site-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation)
docker.errors.APIError: 400 Client Error: Bad Request ("OCI runtime create failed: container_linux.go:344: starting container process caused "exec: \"/usr/bin/node\": stat /usr/bin/node: no such file or directory": unknown")

Expected result

I expected the lambda function to run locally and successfully.

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

  1. OS: MacOS Mojave 10.14.4 (18E227)
  2. sam --version: SAM CLI, version 0.17.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
prashanthkalidindi84commented, Aug 2, 2021

@awood45 @danielclariondoor @dyllandry @sanathkr @mndeveci I am getting similar issue like above

Description :

->I am using AWS SAM Template and Docker Desktop to test Aws lambda locally. ->IDE -> webstorm ->SAM CLI version -> 1.26.0 ->In my SAM stack i am using different nodejs versions for different lambda functions, Both NodeJS 12.x and NodeJS14.x are being used

Steps to reproduce:

->When running through webstrom SAM build is successful but Locally SAM is failing.

Observer Result:

i) SAM Build Result:

/usr/local/bin/sam build skEnabler --template /Users/kalidindiprashanth/Applications/skExample/template.yaml --build-dir /Users/kalidindiprashanth/Applications/skExample/.aws-sam/build

Building codeuri: /Users/kalidindiprashanth/Applications/skExample/src/skEnabler runtime: nodejs12.x metadata: {} functions: [‘skEnabler’] Running NodejsNpmBuilder:NpmPack Running NodejsNpmBuilder:CopyNpmrc Running NodejsNpmBuilder:CopySource Running NodejsNpmBuilder:NpmInstall Running NodejsNpmBuilder:CleanUpNpmrc

Build Succeeded

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

ii) Lambda Invoke error:

/usr/local/bin/sam local invoke skEnabler --template /Users/kalidindiprashanth/Applications/skExample/.aws-sam/build/template.yaml --event “/private/var/folders/pr/2l_cmw4d5rd3yvg54q3pvqzh0000gn/T/[Local] skEnabler-event.json” --debug-port 50306

Invoking index.handler (nodejs12.x) arn:aws:lambda:ap-south-1:792937575283:layer:nodejs-mysql:2 is already cached. Skipping download Skip pulling image and use local one: samcli/lambda:nodejs12.x-400f4ba698cdc91c1e013eb5f.

Mounting /Users/kalidindiprashanth/Applications/skExample/.aws-sam/build/skEnabler as /var/task:ro,delegated inside runtime container Traceback (most recent call last): File “/usr/local/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/docker/api/client.py”, line 261, in _raise_for_status response.raise_for_status() File “/usr/local/Cellar/aws-sam-cli/1.26.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: 400 Client Error: Bad Request for url: http+docker://localhost/v1.35/containers/3ada6198fd2f7436935c0256aebc8966707910bd4f53ccc7a7d008c5a9b06268/start

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File “/usr/local/bin/sam”, line 8, in <module> sys.exit(cli()) File “/usr/local/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/click/core.py”, line 829, in call return self.main(*args, **kwargs) File “/usr/local/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/click/core.py”, line 782, in main rv = self.invoke(ctx) File “/usr/local/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/click/core.py”, line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File “/usr/local/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/click/core.py”, line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File “/usr/local/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/click/core.py”, line 1066, in invoke return ctx.invoke(self.callback, **ctx.params) File “/usr/local/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/click/core.py”, line 610, in invoke return callback(*args, **kwargs) File “/usr/local/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/click/decorators.py”, line 73, in new_func return ctx.invoke(f, obj, *args, **kwargs) File “/usr/local/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/click/core.py”, line 610, in invoke return callback(*args, **kwargs) File “/usr/local/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/samcli/lib/telemetry/metric.py”, line 153, in wrapped raise exception # pylint: disable=raising-bad-type File “/usr/local/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/samcli/lib/telemetry/metric.py”, line 122, in wrapped return_value = func(*args, **kwargs) File “/usr/local/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/samcli/lib/utils/version_checker.py”, line 42, in wrapped actual_result = func(*args, **kwargs) File “/usr/local/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/samcli/cli/main.py”, line 90, in wrapper return func(*args, **kwargs) File “/usr/local/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/samcli/commands/local/invoke/cli.py”, line 83, in cli do_cli( File “/usr/local/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/samcli/commands/local/invoke/cli.py”, line 175, in do_cli context.local_lambda_runner.invoke( File “/usr/local/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/samcli/commands/local/lib/local_lambda.py”, line 130, in invoke self.local_runtime.invoke( File “/usr/local/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/samcli/lib/telemetry/metric.py”, line 217, in wrapped_func return_value = func(*args, **kwargs) File “/usr/local/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/samcli/local/lambdafn/runtime.py”, line 177, in invoke container = self.run(container, function_config, debug_context) File “/usr/local/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/samcli/local/lambdafn/runtime.py”, line 131, in run self._container_manager.run(container) File “/usr/local/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/samcli/local/docker/manager.py”, line 117, in run container.start(input_data=input_data) File “/usr/local/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/samcli/local/docker/container.py”, line 273, in start real_container.start() File “/usr/local/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/docker/models/containers.py”, line 400, in start return self.client.api.start(self.id, **kwargs) File “/usr/local/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/docker/utils/decorators.py”, line 19, in wrapped return f(self, resource_id, *args, **kwargs) File “/usr/local/Cellar/aws-sam-cli/1.26.0/libexec/lib/python3.8/site-packages/docker/api/container.py”, line 1095, in start self._raise_for_status(res) File “/usr/local/Cellar/aws-sam-cli/1.26.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 “/usr/local/Cellar/aws-sam-cli/1.26.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.APIError: 400 Client Error: Bad Request (“OCI runtime create failed: container_linux.go:380: starting container process caused: exec: “/var/rapid/aws-lambda-rie”: stat /var/rapid/aws-lambda-rie: no such file or directory: unknown”) Running SAM local invoke has failed: Command did not exist successfully, exit code: 1 2 has failed: Command did not exist successfully, exit code: 1 2 has failed: Command did not exist successfully, exit code: 1

Expected Result

-> Lambda function is not invoking locally.

Note: I am breaking my head with this issue since last 2days, any help is kindly appreciated.

1reaction
dyllandrycommented, Jul 3, 2019

For some reason, changing runtime passed to sam init from nodejs to nodejs8.10, works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

400 Client Error: Bad Request ("OCI runtime create failed...
Description I am just following the serverless quick start tutorial. I've installed Docker already (Docker version 18.09.2, build 6247962).
Read more >
API error (400): OCI runtime create failed: container_linux.go ...
I am able to start the same container locally. I start the process from awscli with the following command: aws batch submit-job --job-name ......
Read more >
OCI runtime create failed: container_linux.go:380: starting ...
I keep getting this error in a Docker container when I execute docker run. Dockerfile FROM python:3.9.7-slim-bullseye ENV PYTHONUNBUFFERED 1 ...
Read more >
Dataset_convert tool is running properly but the TFrecords ...
Docker instantiation failed with error: 400 Client Error: Bad Request (“failed to create shim: OCI runtime create failed: ...
Read more >
error invoking remote method 'docker-start-container' - You.com
Error invoking remote method 'docker-start-container': Error: (HTTP code 400) unexpected - failed to create shim task: OCI runtime create failed: runc ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found