Request: / Status: 502 Latency: 3334 ms Response Body {"message": "Internal server error"} Response Headers {"x-amzn-ErrorType":["InternalServerErrorException"]} Logs Execution log for request d71724ca-4a01-4055-b5ef-0f35d1df28bc Wed Mar 29 18:35:54 UTC 2023 : Starting execution for request: d71724ca-4a01-4055-b5ef-0f35d1df28bc Wed Mar 29 18:35:54 UTC 2023 : HTTP Method: POST, Resource Path: / Wed Mar 29 18:35:54 UTC 2023 : Method request path: {} Wed Mar 29 18:35:54 UTC 2023 : Method request query string: {} Wed Mar 29 18:35:54 UTC 2023 : Method request headers: {} Wed Mar 29 18:35:54 UTC 2023 : Method request body before transformations: {"prompt": "explain code: print(\"Hello world\")", "session_id": ""} Wed Mar 29 18:35:54 UTC 2023 : Request validation succeeded for content type application/json Wed Mar 29 18:35:54 UTC 2023 : Endpoint request URI: https://lambda.us-east-1.amazonaws.com/2015-03-31/functions/arn:aws:lambda:us-east-1:712474041964:function:LangChainApp-LangChainHandlerDD6FD44B-Iq41vk9lEV6I/invocations Wed Mar 29 18:35:54 UTC 2023 : Endpoint request headers: {X-Amz-Date=20230329T183554Z, x-amzn-apigateway-api-id=xa14alpara, Accept=application/json, User-Agent=AmazonAPIGateway_xa14alpara, Host=lambda.us-east-1.amazonaws.com, X-Amz-Content-Sha256=3d3ae8f4c1a3a5be47cb87ea8ecad456005ba119b139b958d5c61f670052485d, X-Amzn-Trace-Id=Root=1-6424850a-596e84187e359ebb993b6f34, x-amzn-lambda-integration-tag=d71724ca-4a01-4055-b5ef-0f35d1df28bc, Authorization=*********************************************************************************************************************************************************************************************************************************************************************************************************************************************6454ba, X-Amz-Source-Arn=arn:aws:execute-api:us-east-1:712474041964:xa14alpara/test-invoke-stage/POST/, X-Amz-Security-Token=IQoJb3JpZ2luX2VjEIr//////////wEaCXVzLWVhc3QtMSJIMEYCIQDCclkcSeRSH2XfIYosF6OmshuCZJs8vAErDV3olEPRyAIhAInuqCTdqVU1xLTAV/sM76U8N6lrxBlnnR/SLaOLduJB [TRUNCATED] Wed Mar 29 18:35:54 UTC 2023 : Endpoint request body after transformations: {"resource":"/","path":"/","httpMethod":"POST","headers":null,"multiValueHeaders":null,"queryStringParameters":null,"multiValueQueryStringParameters":null,"pathParameters":null,"stageVariables":null,"requestContext":{"resourceId":"tsv4pp40ib","resourcePath":"/","httpMethod":"POST","extendedRequestId":"Cjm5pG-woAMFfqw=","requestTime":"29/Mar/2023:18:35:54 +0000","path":"/","accountId":"712474041964","protocol":"HTTP/1.1","stage":"test-invoke-stage","domainPrefix":"testPrefix","requestTimeEpoch":1680114954279,"requestId":"d71724ca-4a01-4055-b5ef-0f35d1df28bc","identity":{"cognitoIdentityPoolId":null,"cognitoIdentityId":null,"apiKey":"test-invoke-api-key","principalOrgId":null,"cognitoAuthenticationType":null,"userArn":"arn:aws:iam::712474041964:root","apiKeyId":"test-invoke-api-key-id","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36","accountId":"712474041964","caller":"712474041964"," [TRUNCATED] Wed Mar 29 18:35:54 UTC 2023 : Sending request to https://lambda.us-east-1.amazonaws.com/2015-03-31/functions/arn:aws:lambda:us-east-1:712474041964:function:LangChainApp-LangChainHandlerDD6FD44B-Iq41vk9lEV6I/invocations Wed Mar 29 18:35:57 UTC 2023 : Received response. Status: 200, Integration latency: 3328 ms Wed Mar 29 18:35:57 UTC 2023 : Endpoint response headers: {Date=Wed, 29 Mar 2023 18:35:57 GMT, Content-Type=application/json, Content-Length=768, Connection=keep-alive, x-amzn-RequestId=18df37c5-8c19-44bb-a1bb-260793944dc6, X-Amz-Function-Error=Unhandled, x-amzn-Remapped-Content-Length=0, X-Amz-Executed-Version=$LATEST, X-Amzn-Trace-Id=root=1-6424850a-596e84187e359ebb993b6f34;sampled=0} Wed Mar 29 18:35:57 UTC 2023 : Endpoint response body before transformations: {"errorMessage": "Expecting value: line 1 column 1 (char 0)", "errorType": "JSONDecodeError", "requestId": "18df37c5-8c19-44bb-a1bb-260793944dc6", "stackTrace": [" File \"/var/task/main.py\", line 27, in handler\n api_key=get_api_key(),\n", " File \"/var/task/main.py\", line 66, in get_api_key\n secret = json.loads(json.loads(r.text)[\"SecretString\"])\n", " File \"/var/lang/lib/python3.9/json/__init__.py\", line 346, in loads\n return _default_decoder.decode(s)\n", " File \"/var/lang/lib/python3.9/json/decoder.py\", line 337, in decode\n obj, end = self.raw_decode(s, idx=_w(s, 0).end())\n", " File \"/var/lang/lib/python3.9/json/decoder.py\", line 355, in raw_decode\n raise JSONDecodeError(\"Expecting value\", s, err.value) from None\n"]} Wed Mar 29 18:35:57 UTC 2023 : Lambda execution failed with status 200 due to customer function error: Expecting value: line 1 column 1 (char 0). Lambda request id: 18df37c5-8c19-44bb-a1bb-260793944dc6 Wed Mar 29 18:35:57 UTC 2023 : Method completed with status: 502