jsreport/jsreport:2.10.0-full image in lambda - Runtime exited without providing a reason Runtime.ExitError
-
Hi there,
We are doing a POC to host our JSreport instance on AWS Lambda instead of our more traditional VMs.
Following this page here: https://jsreport.net/learn/docker#customize-docker-image
I've got the template working as expected - we have it behind our existing API gateway, it is creating the lambda function, and almost working entirely.
The issue is that when we send a request to the lambda function, the jsreport server appears to immediately fail. The logs indicate that the reporter is initialized, and following, throws this error:
Runtime exited without providing a reason Runtime.ExitError
I believe we're missing a piece, but I don't quite know what.
Below is our dockerfile as well as our jsreport.config.json - please let me know what we're doing wrong!
Dockerfile
FROM jsreport/jsreport:2.10.0 COPY --chown=jsreport:jsreport jsreports/data /app/data COPY --chown=jsreport:jsreport jsreports/license-key.txt /app COPY --chown=jsreport:jsreport jsreports/jsreport.config.json /app CMD ["sh", "-c", "cp -R /app/data /tmp/data&&node server.js"]
Config
{ "httpsPort": 5488, "allowLocalFilesAccess": true, "store": { "provider": "fs" }, "blobStorage": { "provider": "fs", "dataDirectory": "/tmp/storage" }, "logger": { "file": { "silent": true }, "error": { "silent": true } }, "extensions": { "licensing": { "useSavedLicenseInfo": false }, "authentication": { "enabled": false }, "authorization": { "enabled": false }, "cli": { "enabled": false }, "express": { "enabled": false }, "freeze": { "enabled": false }, "fs-store": { "dataDirectory": "/tmp/data" }, "import-export": { "enabled": false }, "public-templates": { "enabled": false }, "sample-template": { "enabled": false }, "studio": { "enabled": false }, "studio-theme-dark": { "enabled": false }, "tags": { "enabled": false }, "version-control": { "enabled": false } } }
-
Could you please check this tutorial? Does it work standalone for you?
https://jsreport.net/learn/aws-lambda-serverless
Do have problems after using the ideas there in your env?
-
Hi Jan,
The above tutorial was beginning to be complicated, as we have a dependency on phantomJS 1.9.8. We've been trying the image route thanks to the provided image of jsreports-2.10.0-full.
That being said, the lambda function did operate as expected when using the base example provided.
Is it possible to get the image working on AWS lambda, or is it not advisable?
-
The lambda didn't support the custom docker image when I was checking it the last time, so I will need to check that again. Hopefully the next week. Please post here if you find out a solution till then.
-
Will do, thanks Jan.
I was receiving an error earlier on about Lambda not supporting the image - I solved that by doing the following (note the first line).
FROM public.ecr.aws/lambda/nodejs:12 FROM jsreport/jsreport:2.10.0 COPY --chown=jsreport:jsreport jsreports/data /app/data COPY --chown=jsreport:jsreport jsreports/license-key.txt /app COPY --chown=jsreport:jsreport jsreports/jsreport.config.json /app CMD ["sh", "-c", "cp -R /app/data /tmp/data&&node server.js"]
Interestingly, though, I have since removed the first dependency and the function continues to work.
Thanks for your help.
-
Hey Jan,
Just a follow up - is there a solution to this we can implement?
Thanks!
Tyler
-
I apologize, I didn't have time to play with lambda using docker yet.