AWS Api Gateway在阶段返回状态500

时间:2020-01-09 01:29:05

标签: amazon-web-services api aws-lambda

我的问题是,我在AWS Api网关中创建了一个API,称为lambda函数。从API GW Test执行测试时,此工作正常。但是在邮递员进行部署和测试时,您的状态为500

{
    "message": "Internal server error"
}

AWS API GW资源测试的日志为

> Execution log for request a79b9264-9417-4f02-8284-661d6d2d905c
Thu Jan 09 01:22:11 UTC 2020 : Starting execution for request: a79b9264-9417-4f02-8284-661d6d2d905c
Thu Jan 09 01:22:11 UTC 2020 : HTTP Method: GET, Resource Path: /addresstypes
Thu Jan 09 01:22:11 UTC 2020 : Method request path: {}
Thu Jan 09 01:22:11 UTC 2020 : Method request query string: {}
Thu Jan 09 01:22:11 UTC 2020 : Method request headers: {}
Thu Jan 09 01:22:11 UTC 2020 : Method request body before transformations: 
Thu Jan 09 01:22:11 UTC 2020 : Endpoint request URI: https://lambda.us-east-1.amazonaws.com/2015-03-31/functions/arn:aws:lambda:us-east-1:915738336191:function:MerlinDomain/invocations
Thu Jan 09 01:22:11 UTC 2020 : Endpoint request headers: {x-amzn-lambda-integration-tag=a79b9264-9417-4f02-8284-661d6d2d905c, Authorization=**************************************************************************************************************************************************************************************************************************************************************************************f175c7, X-Amz-Date=20200109T012211Z, x-amzn-apigateway-api-id=foix47w0xa, X-Amz-Source-Arn=arn:aws:execute-api:us-east-1:915738336191:foix47w0xa/test-invoke-stage/GET/addresstypes, Accept=application/json, User-Agent=AmazonAPIGateway_foix47w0xa, X-Amz-Security-Token=IQoJb3JpZ2luX2VjEFEaCXVzLWVhc3QtMSJIMEYCIQDDjBjJHuiD30PuW2WdKZzjnmAl+EYhuwvKRf8wN5eXQAIhAPXBYSqiNnFmhpnID22MD+C7PAhMwvVsbxhNOuybhMuCKr0DCMn//////////wEQABoMMzkyMjIwNTc2NjUwIgx4ZnDErAKU8wUGIZsqkQMtfUE4Ki40krcc+1UaL/Pb6sPfq4N1ohoK7ueWjcofOctf7kUMvZd0YSyTqKVhi1bGj1V0kSe3/HYNGZV9BU6p2Ua89zFspdQZ6S/5l6Tl/w24lQzC+LFkvwAxdGQu+r7VkRMLdLp/kobuRCis3p4VA8ssl/mdz3+pdBKUYO44L8BDOA [TRUNCATED]
Thu Jan 09 01:22:11 UTC 2020 : Endpoint request body after transformations: 
Thu Jan 09 01:22:11 UTC 2020 : Sending request to https://lambda.us-east-1.amazonaws.com/2015-03-31/functions/arn:aws:lambda:us-east-1:915738336191:function:MerlinDomain/invocations
Thu Jan 09 01:22:11 UTC 2020 : Received response. Status: 200, Integration latency: 45 ms
Thu Jan 09 01:22:11 UTC 2020 : Endpoint response headers: {Date=Thu, 09 Jan 2020 01:22:11 GMT, Content-Type=application/json, Content-Length=85, Connection=keep-alive, x-amzn-RequestId=a20bc485-68d5-4a76-961d-0a850ed88b61, x-amzn-Remapped-Content-Length=0, X-Amz-Executed-Version=$LATEST, X-Amzn-Trace-Id=root=1-5e168043-e0acdc1e6a4a3f25b974f910;sampled=0}
Thu Jan 09 01:22:11 UTC 2020 : Endpoint response body before transformations: {"statusCode":200,"body":"[\"aaa\",\"eee\",\"bbb\",\"ccc\",\"ddd\",\"ggg\",\"fff\"]"}
Thu Jan 09 01:22:11 UTC 2020 : Method response body after transformations: {"statusCode":200,"body":"[\"aaa\",\"eee\",\"bbb\",\"ccc\",\"ddd\",\"ggg\",\"fff\"]"}
Thu Jan 09 01:22:11 UTC 2020 : Method response headers: {X-Amzn-Trace-Id=Root=1-5e168043-e0acdc1e6a4a3f25b974f910;Sampled=0, Access-Control-Allow-Origin=*, Content-Type=application/json}
Thu Jan 09 01:22:11 UTC 2020 : Successfully completed execution
Thu Jan 09 01:22:11 UTC 2020 : Method completed with status: 200

0 个答案:

没有答案