I am trying to run jsreport on docker -compose
but I am getting following errror.
jsreport_1 | 2023-02-25T23:42:32.653Z - error: Error occurred during reporter init: Error: Error when loading extension email@example.com
jsreport_1 | Error: EACCES: permission denied, mkdir '/app/data/storage'
jsreport_1 | at Object.mkdirSync (node:fs:1382:3)
jsreport_1 | at module.exports (/app/node_modules/@jsreport/jsreport-fs-store/lib/blobStorageProvider.js:8:8)
jsreport_1 | at Object.module.exports (/app/node_modules/@jsreport/jsreport-fs-store/lib/main.js:36:75)
jsreport_1 | at Object._useOne (/app/node_modules/@jsreport/jsreport-core/lib/main/extensions/extensionsManager.js:226:75)
I've tried the same docker-compose file and it works just fine for me, no errors about the permissions.
I have tried it in two cases:
- having no data folder, in this case, the jsreport docker creates it for me
- having data folder but empty, in this case the jsreport docker creates the rest of child files for me too.
Perhaps if you have an existing data folder with files in there that were created from another place (perhaps another jsreport server instance) and you just copied it to your docker compose directly, there maybe be some permissions checks you should check there, unfortunately, in this case, it is something we can not know what can be wrong with it.
another solution you can try is to add
user: jsreportin your docker-compose to ensure the docker is running with the jsreport user present in the image.
did you tried with
sudo docker-compose up? permissions are tricky, perhaps the way docker was installed on your server requires that you use
unfortunately, i don't have any other ideas to help debug the permissions issue, but it is interesting that when you use the
sudoit throws a different error, there must be something weird going on with your folder permissions.