To make sure we are compatible.
We need to update the mongo database versions and wanted to make sure there were no problems with this package.
Also, some versions are deprecated and driver 3.6x supports at max node 14
To make sure we are compatible.
We need to update the mongo database versions and wanted to make sure there were no problems with this package.
Also, some versions are deprecated and driver 3.6x supports at max node 14
Hi,
I was checking the dependencies of the mongodb packages.
In here, jsreport-mongodb-store , i've notice the devDependencies of "mongodb": "3.6.5". (https://github.com/jsreport/jsreport/blob/master/packages/jsreport-mongodb-store/package.json)
Is it possible to upgrade it with a newer version? This is the compatibility table: https://www.mongodb.com/docs/drivers/node/current/compatibility/
Note that all version before 4.0 has reached the End of Life, as described here. https://www.mongodb.com/docs/manual/release-notes/
Thank you!
It works,
thank you for your explaination!
Thanks. Now, this jsreport-pdf-utils version correctly ping to 0.5.4, but the version of jsreport is still 2.11.0 that has the dependencies of bugged jsreport-pdf-utils 1.10.1.
Is it possibile to release a new tag of jsreport project with the dependencies of new version of pdf-utils?
I've tried your code, but in jsreport folder i've got the node modules of 1.10.1 related to jsreport, and in the jsreport-pdf-utils folder the right 1.11.1; the jsreport render still using the 1.10.1 with the 'broken' package directory.
Alternatively, is there a way to force the jsreport render to use a particular package version?
Hi,
this error occurs and has been already discussed on https://forum.jsreport.net/topic/2002/pdf-utils-with-custom-font-causes-undefined-name-error/6 but recently it has shown up again.
We suspect it was related to the package dependencies, as the fix has been released in the jsreport-pdfjs with at least the 0.5.3, actually released at 0.5.4; currently, the linked to the jsreport-pdf-utils into the 1.11.0 with 0.5.2 and the previously 1.10.1 has the 0.5.1 on dependencies. In those cases we've still check the error
In the latest tagged and released version of jsreport 2.11.0 (https://github.com/jsreport/jsreport/blob/2.11.0/package.json), there is a stricted dependencies to the 1.10.1 that cause some problem with the npm ci installation of packages, and the following tagged version (that fix the dependencies) is the 3.0.0 that we could not install yet on customers.
Can you please release a new version of js2 (2.11.1) with the dependencies updated, with jsreport-pdf-utils at 1.11.1 that has the dependencies of jsreport-pdfjs of 0.5.4? Or at least give us a procedure to follow in order to solve eventually other dependencies problem?
Thank you.
Hi, after a bit of examination we verified that the error was only by us, as we compiled with different versions of node and then the compatibility was skipped.
We found an error due to the lack of the handlebar package obtained from jsreport-handlebar, and initially, we thought it was due to the fact that in the js-handlebar package was declared only as devDependencies as you can see here:https://github.com/jsreport/jsreport-handlebars/blob/master/package.json
However, by retrying the process of package installation and dependency we found our own discrepancy and resolved. Thanks for the support and sorry for the inconvenience!
Jsreport 2.7.1 - Installing jsreport dependencies with NODE_ENV=production there is an error during startup due to jsreport-handlebars.
The problem is due to the fact that jsreport-handlebars has in dev dependencies handlebars, when it should be in normal dependencies.
This error doesn't appear if I use npm install, as the dev dependencies are installed
I would like to know what customizations in jsreport.config.json have you done except the mongo store?
This is the prod configuration:
{
"certificate": {
"key": "certificates/jsreport.net.key",
"cert": "certificates/jsreport.net.cert"
},
"httpPort": 3001,
"httpsPort": null,
"logger": {
"console": {
"transport": "console",
"level": "debug"
},
"error": {
"transport": "console",
"level": "error"
}
},
"blobStorage": {
"provider": "gridFs"
},
"store": {
"provider": "mongodb"
},
"phantom": {
"defaultPhantomjsVersion": "2.1.1",
"numberOfWorkers": 2,
"strategy": "phantom-server",
"timeout": 60000
},
"allowLocalFilesAccess": false,
"templatingEngines": {
"strategy": "http-server",
"numberOfWorkers": 4,
"timeout": 1800000,
"allowedModules": "*"
},
"chrome": {
"timeout": 40000,
"strategy": "chrome-pool",
"numberOfWorkers": 4,
"launchOptions": {
"args": "--no-sandbox"
}
},
"extensions": {
"mongodb-store": {
"uri": "<mongouri>",
"prefix": "jsreport_"
},
"authentication": {
"cookieSession": {
"secret": "<secret>"
},
"admin": {
"username": "<user>",
"password": "<psw>"
}
},
"scripts": {
"allowedModules": "*",
"timeout": 1800000
},
"sample-template": {
"createSamples": true
},
"chrome-pdf": {
"timeout": 40000,
"strategy": "chrome-pool",
"numberOfWorkers": 4,
"launchOptions": {
"args": "--no-sandbox"
}
}
}
}
What version of jsreport do you use?
Those are the version of the packages:
"jsreport": "2.6.1",
"jsreport-chrome-pdf": "1.6.1",
"jsreport-client-app": "^0.1.1",
"jsreport-fs-store": "2.6.0",
"jsreport-import-export": "1.4.0",
"jsreport-mongodb-store": "1.2.2",
"jsreport-pdf-utils": "1.5.2",
"jsreport-phantom-pdf": "2.2.0",
"jsreport-studio": "2.6.6",
Is it xlsx recipe or html-to-xlsx recipe you use?
The recipe is xlsx, with a custom xslx template used for every excel reports. For pdf reports we always use chrome-pdf (on jsreport settings you'll see phantom just for legacy reports on other customers, but it's not used here)
Do you run jsreport inside docker or it runs directly?
jsreport starts in a docker, with the starting script that just set some env variable and calls jsreport.init()
Do you persist outputs using reports extension?
No, we'll use an API request to create the report using jsreport, then it send back the b64 and we save the pdf in a different folder using a fs.writeFileSync(tmpName, (new Buffer(report, 'base64')).toString('binary'), 'binary');
Can't your code in script or templating engine memory leak? In case you use http-server strategy.
That was our first thought, in fact, we have worked considerably to make a general review for memory leak, but despite this we can not understand why this trend in memory. The strategy is included on the conf that is published before:
"templatingEngines": {
"strategy": "http-server",
"numberOfWorkers": 4,
"timeout": 1800000,
"allowedModules": "*"
},
We could try to change the strategy to the dedicated-process to see if something change.
Thank you for your support; we will stay in touch with you for any further reports or updates.
Good morning, we're monitoring a jsreport installation as we've revealed some anomalies. In particular, the customer informed us that periodically the jsreport service was not responding for a certain period of time.
In fact, we verified that what was happening was a memory saturation. The execution times close to 100% expand exponentially causing a slowdown of the whole system.
We solved the situation momentarily by imposing a restart of the service every night, but especially as a result of a large daily load (there are about 100 users, with a pool of a thousand daily reports executed) or very heavy print runs the phenomenon may reoccur: we noticed that the memory starts to rise inexorably, even on the night where there is no work, however, there is an almost constant increase in memory.
The service is on a 4 core 8 GB ram machine, which instantiates two jsreports balanced with Round Robin with the mongodb store provider to avoid blocking the print queue in case of a print with a high runtime. We installed Grafana to monitor the situation, and this is an example where in the middle of the day there was a forced restart. The two attached graphs include the first one the garbage collector situation and the other one is the busy memory graph, which never seems to empty completely after printing.
What could it be?
Some of the peaks are near reports executed with xlsx recipes, whose template is an excel of about 200 columns for a thousand rows. The doubt that has come to us is that the template remains in memory even after the execution is finished and therefore keeps a part of the memory locked. However it can't be only this, as also the other pdf reports (with chrome-pdf templates) cause a slight increase of memory that then accumulates inexorably. We removed the various console.logs but we don't know what to try anymore.
Thank you for help.
Hello,
there is a way using the xlsx recipe to get the first 2 rows Freezed? I looked in the forum and in the styles.xml of my template if there was any indication but I have not found anything yet.
Can you help me?
Thanks.
It works perfectly, thank you.
The problem is the following: if the jsreport project is on Docker, the pdfCreatePagesGroup and pdfAddPageItem doesn't works correctly. When the header try to use groups, those are null or empty. pdf.groups are created, but doesn't have any data. Note that if this repository is lunched on local (using npm install and node server.js) everything works fine.
I've recreated the issue so that it's easier for you to test, hoping to do something useful. The link to the repository is: https://github.com/dfiorentin/pdfCreatePagesGroup-issue-on-Docker
Thank you for the support.
Yes, it's a good start! If I have n documents in the app you will have to add the function at the beginning of each but it is not a big problem, thank you!
Remaining on the subject, there are 2 other issues related to double-sided management:
Unfortunately, no, because you're manually introducing a counter on the pages. In case the content inserted is too long (You can simulate it by inserting a very long text (such as lorem ipsum) ), you would incur in an automatic pagebreak, and your case does not handle it, while with the solution of jan_blaha yes because the control is done on the number of pages and not on a counter. Thanks anyway for the proposal.
Okay, thanks, I'll think of a solution based on your proposal until I wait for the next release. Thanks again!
Correct. I could know the number of page if i'm in the header/footer, but not in the main report so i can't add the last empty page.
My client does double-sided printing, and wants each report to start on a new page. He has some reports that use pdf-utils to attach reports on append/prepend, but if a report has an odd number of pages, the next report starts on the back of the previous one.
I evaluated adding an empty page via a pagebreak at the end of each report, but I can't find a way to figure out what page I'm on. I also tried to do this in the headers/footers added via the util, first using $pdf.pageNum in the case of renderForEveryPage, then using the mergewholedocument strategy, but if I add a page here and not in the report on which the merge is made there is no kind of rendering.
How can I manage this? Any ideas or suggestions?
Some new information that could help: we save report in fileSystem and not in DB, can be related to this the problem?
Another thing: I noticed that if I run the report, reload the page and reopen the template, the report has the parameters of the util modified. If I turn off and on jsreport again, the configuration of the template returns to the original one. Is there any caching system that creates conflict?
Mmhh there's something strange.
I've try to replicate on the playground https://playground.jsreport.net/w/dfiorentin/KuHWJU0z and it works correctly. However, if I use the same on my configuration, the utils has been overwritten.
My package list is the following:
{
"name": "jsreport-server",
"dependencies": {
"jsreport": "2.3.0",
"jsreport-chrome-pdf": "1.2.2",
"jsreport-pdf-utils": "1.2.1",
"jsreport-studio": "2.3.3"
},
"main": "server.js"
}
So this should be the last jsreportversion (i've done another npm install again just now).
About my jsreport configuration, I've tried to remove all of template's options in search of the problem, but I still have the issue, even with the following configuration:
{
"certificate": {
"key": "certificates/jsreport.net.key",
"cert": "certificates/jsreport.net.cert"
},
"httpPort": 3001,
"license-key": "----",
"store": {
"provider": "fs"
},
"extensions": {
"authentication": {
"cookieSession": {
"secret": "---"
},
"admin": {
"username": "---",
"password": "---"
}
}
}
}
Am I missing something?