Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE when returning status code 207 MULTI_STATUS with AWS ALB #1167

Open
jmktam opened this issue Aug 29, 2021 · 0 comments
Open

NPE when returning status code 207 MULTI_STATUS with AWS ALB #1167

jmktam opened this issue Aug 29, 2021 · 0 comments

Comments

@jmktam
Copy link

jmktam commented Aug 29, 2021

Expected Behavior

HTTP/1.1 207 Multi Status

Actual Behaviour

HTTP/1.1 500 Internal Server Error

[AbstractLambdaContainerHandler:215:] [] ERROR Error while handling request java.lang.NullPointerException: null
	at io.micronaut.function.aws.proxy.MicronautResponseWriter.writeResponse(MicronautResponseWriter.java:113)
	at io.micronaut.function.aws.proxy.MicronautResponseWriter.writeResponse(MicronautResponseWriter.java:50)
	at io.micronaut.function.aws.proxy.AbstractLambdaContainerHandler.proxy(AbstractLambdaContainerHandler.java:213)
	at io.micronaut.function.aws.proxy.MicronautLambdaHandler.handleRequest(MicronautLambdaHandler.java:68)
	at io.micronaut.function.aws.proxy.MicronautLambdaHandler.handleRequest(MicronautLambdaHandler.java:35)
	at lambdainternal.EventHandlerLoader$PojoHandlerAsStreamHandler.handleRequest(EventHandlerLoader.java:180)
	at lambdainternal.EventHandlerLoader$2.call(EventHandlerLoader.java:902)
	at lambdainternal.AWSLambda.startRuntime(AWSLambda.java:340)
	at lambdainternal.AWSLambda.<clinit>(AWSLambda.java:63)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at lambdainternal.LambdaRTEntry.main(LambdaRTEntry.java:150)

Steps To Reproduce

  1. Create a mn app: micronaut/2.4.2/bin/mn create-app --features=aws-lambda,aws-lambda-custom-runtime,shadeddd example.micronaut.micronautguided --build=maven --lang=java
  2. Return a status of 209 MULTI_STATUS
     @Get("/207")
     // Setting a status that isn't in javax.ws.rs.core.Response.Status
     // causes a null pointer exception and causes the api to return a
     // 500 Internal Server Error
     @Status(HttpStatus.MULTI_STATUS)
     public String multiStatus(){
         return "multiStatus";
     }
  1. Deploy app as AWS Lambda (java8 runtime)
  2. Create AWS ALB and TargetGroup
  3. Make Http request

Environment Information

Env: AWS ALB with AWS Lambda Java8 runtime
Micronaut Version: 2.4.2
JDK Version: 1.8

A potential solution(?): #1168

Example Application

No response

Version

2.4.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant