serverless: Golang, internal server error? Path Error
I’m trying to test my lambda funtion on API Gateway but I keep getting this error. Does anyone know what this is about? I’ve used the exact code shown in the tutorial.
Execution log for request test-request
Fri Feb 23 20:42:26 UTC 2018 : Starting execution for request: test-invoke-request
Fri Feb 23 20:42:26 UTC 2018 : HTTP Method: GET, Resource Path: /world
Fri Feb 23 20:42:26 UTC 2018 : Method request path: {}
Fri Feb 23 20:42:26 UTC 2018 : Method request query string: {}
Fri Feb 23 20:42:26 UTC 2018 : Method request headers: {}
Fri Feb 23 20:42:26 UTC 2018 : Method request body before transformations:
Fri Feb 23 20:42:26 UTC 2018 : Endpoint request URI: https://lambda.eu-west-2.amazonaws.com/2015-03-31/functions/arn:aws:lambda:eu-west-2:977442817389:function:myservice-dev-world/invocations
Fri Feb 23 20:42:26 UTC 2018 : Endpoint request headers: {x-amzn-lambda-integration-tag=test-request, Authorization=************************************************************************************************************************************************************************************************************************************************************************************************************************3dec67, X-Amz-Date=20180223T204226Z, x-amzn-apigateway-api-id=2fhz7wz460, X-Amz-Source-Arn=arn:aws:execute-api:eu-west-2:977442817389:2fhz7wz460/null/GET/world, Accept=application/json, User-Agent=AmazonAPIGateway_2fhz7wz460, X-Amz-Security-Token=*********************** [TRUNCATED]
Fri Feb 23 20:42:26 UTC 2018 : Endpoint request body after transformations: {"resource":"/world","path":"/world","httpMethod":"GET","headers":null,"queryStringParameters":null,"pathParameters":null,"stageVariables":null,"requestContext":{"path":"/world","accountId":"977442817389","resourceId":"y0sw2d","stage":"test-invoke-stage","requestId":"test-invoke-request","identity":{"cognitoIdentityPoolId":null,"cognitoIdentityId":null,"apiKey":"test-invoke-api-key","cognitoAuthenticationType":null,"userArn":"arn:aws:iam::977442817389:root","apiKeyId":"test-invoke-api-key-id","userAgent":"Apache-HttpClient/4.5.x (Java/1.8.0_144)","accountId":"977442817389","caller":"977442817389","sourceIp":"test-invoke-source-ip","accessKey":"ASIAIJI6T6KT47FT3VNA","cognitoAuthenticationProvider":null,"user":"977442817389"},"resourcePath":"/world","httpMethod":"GET","apiId":"2fhz7wz460"},"body":null,"isBase64Encoded":false}
Fri Feb 23 20:42:26 UTC 2018 : Sending request to https://lambda.eu-west-2.amazonaws.com/2015-03-31/functions/arn:aws:lambda:eu-west-2:977442817389:function:myservice-dev-world/invocations
Fri Feb 23 20:42:26 UTC 2018 : Received response. Integration latency: 299 ms
Fri Feb 23 20:42:26 UTC 2018 : Endpoint response body before transformations: {"errorMessage":"fork/exec /var/task/bin/world: permission denied","errorType":"PathError"}
Fri Feb 23 20:42:26 UTC 2018 : Endpoint response headers: {X-Amz-Executed-Version=$LATEST, x-amzn-Remapped-Content-Length=0, Connection=keep-alive, x-amzn-RequestId=0ea6a715-18da-11e8-893b-519df7fde7d9, Content-Length=91, X-Amz-Function-Error=Unhandled, Date=Fri, 23 Feb 2018 20:42:26 GMT, X-Amzn-Trace-Id=root=1-5a907cb2-e95d4b1335e5fd8428f9857c;sampled=0, Content-Type=application/json}
Fri Feb 23 20:42:26 UTC 2018 : Execution failed due to configuration error: Malformed Lambda proxy response
Fri Feb 23 20:42:26 UTC 2018 : Method completed with status: 502
Serverless Version: 1.26.0 Windows 10
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 19 (5 by maintainers)
Hi guys,
I had same issue Here is a working code example, just add
StatusCode: 200If solution above didn’t fix your issue. Check your package naming. it must be:
I’ve re created the aws zipper which can be used to zip all the files in a folder and gives them 777 permissions. https://github.com/rayhaanq/win-go-zipper. I guess this can be a temporary fix for now. You just need to set your package artefact to the generated zip file. I’ve tested it and it seems to work