Closed malbanesi-ascii closed 4 years ago
These seem like different errors to me – the first is a parsing error.
It's your "something AWS Lambda allows" statement that I'm confused by – can you explain what you mean by that?
"something AWS Lambda allows" I meant that the code I'm working on, did NOT implement the RequestHandler interface - and it was running on AWS Lambda with the java8 runtime in production for months.
The lambci/lambda:java11
base image reported the class didn't implement the necessary interface immediately. But lambci/lambda:java8
failed without any helpful message as to the cause of the problem.
I think if it runs on the AWS Lambda java8 runtime, then it should run on docker-lambda too. If it doesn't, then there's something up.
Does your code run on the Lambda java11 runtime?
Btw, are you sure you're using the same handler with docker-lambda as you are on AWS Lambda?
If you're using a POJO, then you have to specify the method name as part of your handler. ie, com.company.product.Handler::handleRequest
.
If you don't specify the method name, then Lambda will assume that you're implementing RequestHandler
.
I think this should be the same on production Lambda?
The error output on the java8 runtime should be cleaner now. I'm going to close this, but feel free to reopen if you keep running into trouble
I've lost an evening on this mystifying
null
printed in red color, right afterSTART RequestId...
, using thelambci/lambda:java8
image:But the issue was immediately identified when running the Java 11 base image:
The cause of the problem was this lambda did not implement the
RequestHandler
interface - someting AWS Lambda allows, but the java8 image rejects with the unhelpful error above.Could the validations added to
:java11
be backported to:java8
to prevent others from tripping over this?Thank you