The current schematron service has a configurable logs directory in the config.json. However, in our docker environments this service is installed in the nodes_module which frequently is set to be readonly for the running application. In order to still have logs processing we need to have a mechanism where the docker machine or whatever has this service installed can specify the logs directory.
I think the best option is to use an environment variable that if present will set where the logs come from. That way our dockers, or any other application that embeds the logs can specify the logs directory for the schematron validation.
Another option is our docker applications need to open and rewrite the config.json to specify where the logs go.
Here is the specific error that is occurring on our dockers:
Error: EACCES: permission denied, mkdir '/var/www/localhost/htdocs/openemr/ccdaservice/node_modules/oe-schematron-service/logs'
at Object.mkdirSync (node:fs:1334:3)
at create (/var/www/localhost/htdocs/openemr/ccdaservice/node_modules/oe-schematron-service/app.js:62:39)
at Object.<anonymous> (/var/www/localhost/htdocs/openemr/ccdaservice/node_modules/oe-schematron-service/app.js:9:14)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 {
errno: -13,
syscall: 'mkdir',
code: 'EACCES',
path: '/var/www/localhost/htdocs/openemr/ccdaservice/node_modules/oe-schematron-service/logs'
}
I'm just going to get rid of it and the config as well. I'll just pass in any config items on start from service start. I was going to do this anyway but never got around to it!
The current schematron service has a configurable logs directory in the config.json. However, in our docker environments this service is installed in the nodes_module which frequently is set to be readonly for the running application. In order to still have logs processing we need to have a mechanism where the docker machine or whatever has this service installed can specify the logs directory.
I think the best option is to use an environment variable that if present will set where the logs come from. That way our dockers, or any other application that embeds the logs can specify the logs directory for the schematron validation.
Another option is our docker applications need to open and rewrite the config.json to specify where the logs go.
Here is the specific error that is occurring on our dockers: