You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are calling java lambda from api gateway and in cloudwatch logs i can see internal server error is coming,
After going through the logs and support team i got to know that AwsProxyResponse class is generating response JSON which is rejected by API gateway with Malformed error
Json generated is using field name base64Encoded instead of isBase64Encoded
Describe how you would expect the application to behave
Actual behavior
Describe what you are seeing instead
Steps to reproduce
Provide code samples we can use to reproduce the issue as part of our integration tests. If there is a public repository for the misbehaving application link to it here
Full log output
Paste the full log output from the Lambda function's CloudWatch logs
Scenario - When we are trying to invoke lambda with proxy integration from apigateway, apigateway is throwing malformed error
Expected Behaviour - as part of lambda response, api gatway is expecting isBase64Encoded value but from lambda response we are getting only base64Encoded key
Actual Behaviour - isBase64Encoded should come ans statusDescriptions also not required as per api gateway
Stepa to reproduce -
Create a api gatway
Call lambda ( rerurn type should be AwsProxyResponse)
Invoke Lambda from ApIGAteway
Activity
deki commentedon May 9, 2024
Hi @Chiranjibeem,
can you please fill out the issue template to help us looking into your issue?
The property is named explicitly
https://github.com/aws/serverless-java-container/blob/main/aws-serverless-java-container-core/src/main/java/com/amazonaws/serverless/proxy/model/AwsProxyResponse.java#L122 so I wonder what makes the serialization ignore it in your case.
To help us debug your issue fill in the basic information below using the options provided
Serverless Java Container version:
eg. 1.5
Implementations:
Jersey / Spring / Spring Boot / Spring Boot 2 / Spark
Framework version:
eg SpringBoot 2.2.6.RELEASE
Frontend service:
REST API / HTTP API / ALB
Deployment method:
eg SAM, Serverless Framework, Console
Scenario
Describe what you are trying to accomplish
Expected behavior
Describe how you would expect the application to behave
Actual behavior
Describe what you are seeing instead
Steps to reproduce
Provide code samples we can use to reproduce the issue as part of our integration tests. If there is a public repository for the misbehaving application link to it here
Full log output
Paste the full log output from the Lambda function's CloudWatch logs
Chiranjibeem commentedon May 9, 2024
Serverless Java Container version: 2.0.0-M2
Implementations: Spring Boot
Framework version: SpringBoot 3.2.0
Frontend service: AWS API Gateway
Deployment method: Serverless Framework
Scenario - When we are trying to invoke lambda with proxy integration from apigateway, apigateway is throwing malformed error
Expected Behaviour - as part of lambda response, api gatway is expecting isBase64Encoded value but from lambda response we are getting only base64Encoded key
Actual Behaviour - isBase64Encoded should come ans statusDescriptions also not required as per api gateway
Stepa to reproduce -
Create a api gatway
Call lambda ( rerurn type should be AwsProxyResponse)
Invoke Lambda from ApIGAteway
deki commentedon May 10, 2024
Can you please try reproducing it using our sample https://github.com/aws/serverless-java-container/tree/main/samples/springboot3/pet-store?
We have multiple unittests in place that cover it so I can only imagine it's related to specific configurations inside your application.