Skip to content
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

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

Closed
dyllandry opened this issue Jul 2, 2019 · 5 comments
Closed

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

dyllandry opened this issue Jul 2, 2019 · 5 comments

Comments

@dyllandry
Copy link

dyllandry commented Jul 2, 2019

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
@dyllandry dyllandry changed the title 400 Client Error: Bad Request ( 400 Client Error: Bad Request ("OCI runtime create failed... Jul 2, 2019
@dyllandry dyllandry reopened this Jul 3, 2019
@dyllandry
Copy link
Author

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

@awood45
Copy link
Member

awood45 commented Aug 5, 2019

Looks like this was fixed in a recent release, so closing. Feel free to reopen if you have this issue with the latest SAM CLI release.

@awood45 awood45 closed this as completed Aug 5, 2019
@danieljosephbrennan
Copy link

I'm still having this issue with
aws-cli/2.0.41 Python/3.7.4 Darwin/19.5.0 exe/x86_64
SAM CLI, version 1.1.0

@S4lem
Copy link

S4lem commented Oct 14, 2020

I don't know why but changing my runtime from python3.6 to python3.8 fixed it....

@prashanthkalidindi84
Copy link

prashanthkalidindi84 commented 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
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants