awslabs / aws-lambda-go-api-proxy

lambda-go-api-proxy makes it easy to port APIs written with Go frameworks such as Gin (https://gin-gonic.github.io/gin/ ) to AWS Lambda and Amazon API Gateway.
Apache License 2.0
1.04k stars 197 forks source link

sam local start-api got the error message: Invalid API Gateway Response #54

Open ShawnOY opened 4 years ago

ShawnOY commented 4 years ago

Hello, I follow the sample to develop my lambda function and it's working well, but today I got some error message and try the sample again got the same error message.

Invoking main (go1.x)
Decompressing /private/tmp/aws-lambda-go-api-proxy/sample/main.zip

Fetching lambci/lambda:go1.x Docker container image......
Mounting /private/var/folders/m0/_9179l9507jf8r61173wrvg40000gn/T/tmpbthat67r as /var/task:ro,delegated inside runtime container
START RequestId: 8e9f234a-b0e8-1746-4601-ec5a9ce55d2c Version: $LATEST
END RequestId: 8e9f234a-b0e8-1746-4601-ec5a9ce55d2c
REPORT RequestId: 8e9f234a-b0e8-1746-4601-ec5a9ce55d2c  Init Duration: 91.11 ms Duration: 2.25 ms   Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 14 MB  
Invalid API Gateway Response Keys: {'errorType', 'errorMessage'} in {'errorType': 'exitError', 'errorMessage': 'RequestId: 23a9762d-bfdc-13ab-f40b-ad1433273dc5 Error: fork/exec /var/task/main: exec format error'}
Function returned an invalid response (must include one of: body, headers, multiValueHeaders or statusCode in the response object). Response received: {"errorType":"exitError","errorMessage":"RequestId: 23a9762d-bfdc-13ab-f40b-ad1433273dc5 Error: fork/exec /var/task/main: exec format error"}
2019-12-23 17:17:49 127.0.0.1 - - [23/Dec/2019 17:17:49] "GET /pets/1 HTTP/1.1" 502 -

I have no idea what happened, it's working before today.

noonii commented 4 years ago

+1

diegotony commented 4 years ago

+1

sapessi commented 4 years ago

Looks like the executable format or the environment changed under you: fork/exec /var/task/main: exec format error. Few questions:

stackchain commented 4 years ago

+1

akhodos commented 3 years ago

Looks like the executable format or the environment changed under you: fork/exec /var/task/main: exec format error. Few questions:

  • What OS do you build on? MacOS Catalina
  • How do you specify the target OS? GOOS=linux
  • Do you use SAM build? yes