aws / aws-sam-cli

CLI tool to build, test, debug, and deploy Serverless applications using AWS SAM
https://aws.amazon.com/serverless/sam/
Apache License 2.0
6.51k stars 1.17k forks source link

Go Function always fails with permission denied #733

Closed NHirom closed 5 years ago

NHirom commented 5 years ago

Description:

As written in the title, Go function always fails with a permission denied error. I have just followed the instruction written in the below page to compile dlv and my go binary. https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-using-debugging-golang.html

Of course, I have checked permissions of those binaries and those were executable for all users.

Steps to reproduce the issue:

  1. execute "sam local start-api -d 5986 --debugger-path debug"
  2. kick "curl http://127.0.0.1:3000/test"
  3. Error occurs

Observed result:

Fetching lambci/lambda:go1.x Docker container image...... 2018-10-28 00:35:10 Mounting /Users/nhiromoto/.gvm/pkgsets/go1.10.4/global/src/sam-debug-sandbox as /var/task:ro inside runtime container START RequestId: 0fd90978-6cb3-1642-3e9f-6e812d4c67d1 Version: $LATEST END RequestId: 0fd90978-6cb3-1642-3e9f-6e812d4c67d1 REPORT RequestId: 0fd90978-6cb3-1642-3e9f-6e812d4c67d1 Duration: 2.58 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 7 MB
{ "errorMessage": "fork/exec /tmp/lambci_debug_files/dlv: permission denied", "errorType": "PathError" } 2018-10-28 00:35:11 Function returned an invalid response (must include one of: body, headers or statusCode in the response object). Response received: 2018-10-28 00:35:11 127.0.0.1 - - [28/Oct/2018 00:35:11] "GET /test HTTP/1.1" 502 -

Expected result:

my go binary runs

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

sam cli version -> 0.6.0 and upper go -> 1.10 dlv -> 1.0.0 and upper

NHirom commented 5 years ago

Is this because of docker image build done 6days ago? https://hub.docker.com/r/lambci/lambda/

I have seen a blog post that says the instruction had been working until two months ago.

jfuss commented 5 years ago

@NHirom What is in the debug directory you are passing in --debugger-path?

jfuss commented 5 years ago

Closing as inactive.