API Timeout | JsReportOnline



  • I am currently using the API for JsReport Online.
    There is a 20s timeout for chrome-pdf and a 10s timeout for html-to-xlsx.
    I'm using the free version right now for development but when this goes into production we were thinking we would AT LEAST need the silver $100 per month subscription. If we move off of the free version will that help with the timeout times?

    It's a school software so in the example of a school printing something that involves all the students the 20s timeout is not enough. Plus multiple users could be queering at the same time.


  • administrators

    hi! right now changing the plan does not have any effect in the chrome, templating engines compilation timeout.. the better plan gives you better render throttling (it let you process more renders) and allows you to store mote entities.

    however this is not the first time that timeouts is asked to be configurable, the problem is a bit tricky because right now those kind of configuration is global in the whole jsreport server which is something that won't work in the jsreportonline case because a configuration like that should be per user/tenant in the service.

    we opened an issue recently with some thoughts about how to make this work, you can check it here and subscribe to get notifications about progress. we don't have any timeline when that will be done, but it should be soon after we release the next version of jsreport (which we are currently preparing)



  • I talked to my boss about this. The 1000s throttle could also be an issue. If we had 300 users submit a request for a report within 5 minutes it would be an issue. Is the 1000s throttle something that could be changed? We might be able to live with the timeout issue.

    Another question is since I am using the API is there a way to know how many credits a report is using? I'd like to have that value returned somehow so I can store it.



  • Is the 1000s throttle something that could be changed?

    This is something we could change for specific customers, however, this would be done in a rare case. Perhaps you could just implement a retry mechanism on your client end and it would be enough.

    Another question is since I am using the API is there a way to know how many credits a report is using? I'd like to have that value returned somehow so I can store it.

    The response contains header JO-Credits-Spent


    You can start with jsreportonline and we try together to cover your use case. And if it turns out you need a better scalable solution. You can spin it in your own servers with jsreport on premise. The migration is typically just about some clicks and exporting templates from jsreportonline and importing into yours.



  • Do you have an example of getting that? I keep getting "undefined" when I try a few different ways to access the response header.

    My code looks like this..

    jsreport.renderAsync(request).then(function(res) {
        console.log( "in async...." );
        var html = '<html>' +
            '<style>html,body {padding:0;margin:0;} iframe {width:100%;height:100%;border:0}</style>' +
            '<body>' +
            '<iframe type="application/pdf" src="' +  res.toDataURI() + '"></iframe>' +
            '</body></html>';
        var a = window.open("about:blank", "Report")
    
        a.document.write(html)
        a.document.close();


  • I can't find any way to get the header "JO-Credits-Spent".



  • Unfortunately, you can't get response headers using browser client at this moment.

    However, in the real production, you would anyway use another method to make rest request and you can easily get the headers there.



  • Hello. Has there been any movement on the timeout configuration option? I'm getting the following timeout error for a report whose data is steadily growing for our client each week:

    Timeout
    Error: Timeout at /app/node_modules/phantom-workers/lib/phantomManager.js:116:29 at /app/node_modules/phantom-workers/lib/phantomWorker.js:103:24 at /app/node_modules/phantom-workers/lib/phantomWorker.js:124:20 at Socket. (/app/node_modules/phantom-workers/lib/checkPortStatus.js:45:9) at Socket.emit (events.js:311:20) at TCP. (net.js:668:12)

    +0 Starting rendering request 90298 (user: undefined)
    +6 Rendering template { name: tm_PayrollReconcileV1, recipe: phantom-pdf, engine: handlebars, preview: false }
    +9 Inline data specified.
    +9 Resources not defined for this template.
    +15 Replaced assets ["tm_PayrollReconcileV1.css"]
    +15 Rendering engine handlebars using dedicated-process strategy
    +709 Compiled template not found in the cache, compiling
    +3451 Executing recipe phantom-pdf
    +4101 Starting child request to render pdf header
    +5441 Starting rendering request 90300 (user: undefined)
    +5450 Rendering anonymous template { recipe: html, engine: handlebars }
    +5453 Inline data specified.
    +5454 Resources not defined for this template.
    +5478 Replaced assets ["tm_PayrollReconcileV1.css"]
    +5483 Rendering engine handlebars using dedicated-process strategy
    +6301 Compiled template not found in the cache, compiling
    +6541 Executing recipe html
    +6542 Skipping storing report.
    +6544 Rendering request 90300 finished in 1103 ms
    +7195 Starting child request to render pdf footer
    +8417 Starting rendering request 90303 (user: undefined)
    +8429 Rendering anonymous template { recipe: html, engine: handlebars }
    +8431 Inline data specified.
    +8431 Resources not defined for this template.
    +8438 Rendering engine handlebars using dedicated-process strategy
    +8893 Compiled template not found in the cache, compiling
    +8975 Executing recipe html
    +8976 Skipping storing report.
    +8977 Rendering request 90303 finished in 560 ms



  • Hello again. To add to my previous comment, in your API documentation (https://jsreport.net/learn/api), there is a section about Timeout. Does this option exist in the SaaS version? It appears that there is a global value defined that can then be overwritten for a given request. If that's the case, this would work for us. The majority of our reports render just fine within the global timeout. However, there is a payroll reconciliation report that our clients use that has steadily been growing in size week by week (which is a good thing for us). If we had the ability to increase the timeout for this report, that would suffice.

    As a whole, your SaaS service has been great, with this one exception. Not being able to render a report due to a timeout is causing issues for our clients.

    :: Thanks



  • @Rogelio-Arichabala jsreportonline has some timeouts limits you can't change. See the description here https://jsreport.net/learn/online-limits
    If your phantomjs rendering takes longer than 20s, you can either try to optimize your report or migrate to your own jsreport instance.
    There is no documentation for optimizing report. It always depends on a particular case. You can try to remove some styles, try using a different charting library, and see if the performance gets better. This part is usually very tricky.
    The migration to your own jsreport instance should be easily in case you decide for this approach. You can simply export the data from jsreport online and import it to your own instance.



  • @jan_blaha Understood, that's disappointing. We're going to have to install our own jsreport instance then. I've avoided that option mainly because I'm concerned of the time it will take for my team to get it installed and setup correctly in our AWS EC2 environment. I see you offer support plans. As part of that, would your team be available to do the installation for us for a cost? Once it's up and running, we would take it from there. I'm just looking to fast track the installation and configuration process. Either that, or if you could provide the configuration settings / installation recipes / etc.. that mirror the online environment. In reality, it's not the creation of the server or installation of the software that concerns me... it's setting it up / configuring it so behaves like your SaaS version does. Please advise.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.