My config in a 8 core, 8 Gb Ram machine. Pls review and suggest if i doing something wrong. I using version 2.10.0.
{
"httpPort": 5488,
"reportTimeout": 600000,
"enableRequestReportTimeout":true,
"logger": {
"console": {
"transport": "console",
"level": "error"
},
"file": {
"transport": "file",
"level": "info",
"filename": "logs/reporter.log"
},
"error": {
"transport": "file",
"level": "error",
"filename": "logs/error.log"
}
},
"allowLocalFilesAccess": true,
"store": {
"provider": "memory"
},
"blobStorage": {
"provider": "memory"
},
"trustUserCode": false,
"templatingEngines": {
"numberOfWorkers": 8,
"strategy": "in-process"
},
"chrome": {
"launchOptions": {
"args": [
"--no-sandbox",
"--disable-setuid-sandbox"
]
}
},
"workers": {
"numberOfWorkers": 2
},
"extensions": {
"authentication": {
"cookieSession": {
"secret": "place_holder_password@cenTos",
"cookie": {
"secure": true
}
},
"admin": {
"username": "place_holder_admin",
"password": "place_holder_password"
},
"authorizationServer": {"tokenValidation": {"endpoint": "http://place_holder_url:3000/api/jsreport","auth": false}},
"enabled": true
},
"chrome-pdf": {
"timeout": 600000,
"strategy": "chrome-pool",
"numberOfWorkers": 8
}
}
}
I only got this error on pm2 log:
2022-09-13T00:00:49: pdf utils failed to remove the hidden marks from pdf, this has no significant impact, but please report the issue. Error: incorrect header check
at Zlib.zlibOnError [as onerror] (node:zlib:189:17)
at processChunkSync (node:zlib:457:12)
at zlibBufferSync (node:zlib:178:12)
at Object.syncBufferWrapper [as unzipSync] (node:zlib:792:14)
at processStream (/jsreportapp/node_modules/jsreport-pdf-utils/lib/utils/processText.js:50:22)
at processStream (/jsreportapp/node_modules/jsreport-pdf-utils/lib/utils/processText.js:74:13)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async processStream (/jsreportapp/node_modules/jsreport-pdf-utils/lib/utils/processText.js:74:7)
at async module.exports (/jsreportapp/node_modules/jsreport-pdf-utils/lib/utils/processText.js:215:7)
at async Object.postprocess (/jsreportapp/node_modules/jsreport-pdf-utils/lib/utils/pdfManipulator.js:104:7)
at async module.exports (/jsreportapp/node_modules/jsreport-pdf-utils/lib/scriptPdfProcessing.js:83:5)
at async scriptExecModuleWrapper (/jsreportapp/node_modules/jsreport-core/lib/scriptExecModuleWrapper.js:34:20) {
errno: -3,
code: 'Z_DATA_ERROR'
}
ecosystem.config.js
module.exports = {
apps: [{
name: "jsreport-server",
script: "./server.js",
instances: 1,
exec_mode : "cluster",
autorestart: true,
time: true,
node_args: "--max_old_space_size=1024",
max_memory_restart:"1024M"
}]
}
my server.js running by pm2
const jsreport = require('jsreport')()
if (process.env.JSREPORT_CLI) {
// export jsreport instance to make it possible to use jsreport-cli
module.exports = jsreport
} else {
jsreport.init().then(() => {
// running
}).catch((e) => {
// error during startup
console.error(e.stack)
process.exit(1)
})
}