"report cancelled" error for 4mb data



  • Hi,
    I'm trying to generate a report, sending 4mb data data in the /render.
    After a few minutes, the generation fails, and I get the following log error:

    2022-08-15T15:55:36.732Z - info: reporter initialized
    2022-08-15T15:55:53.767Z - info: Render request 1 queued for execution and waiting for available worker rootId=dd30d141iypw1v3, id=dd30d141iypw1v3
    2022-08-15T15:55:54.363Z - info: Starting rendering request 1 (user: null) rootId=dd30d141iypw1v3, id=dd30d141iypw1v3
    2022-08-15T15:55:54.363Z - info: Rendering template { name: test, recipe: chrome-pdf, engine: handlebars, preview: false } rootId=dd30d141iypw1v3, id=dd30d141iypw1v3
    2022-08-15T15:55:54.365Z - debug: Inline data specified. rootId=dd30d141iypw1v3, id=dd30d141iypw1v3
    2022-08-15T15:55:54.366Z - debug: Base url not specified, skipping its injection. rootId=dd30d141iypw1v3, id=dd30d141iypw1v3
    2022-08-15T15:55:54.366Z - debug: Rendering engine handlebars rootId=dd30d141iypw1v3, id=dd30d141iypw1v3
    2022-08-15T15:55:56.254Z - debug: Executing recipe chrome-pdf rootId=dd30d141iypw1v3, id=dd30d141iypw1v3
    2022-08-15T15:55:56.689Z - debug: Converting with chrome HeadlessChrome/98.0.4758.0 using chrome-pool strategy rootId=dd30d141iypw1v3, id=dd30d141iypw1v3
    2022-08-15T15:55:56.887Z - debug: Page request: GET (document) file:///C:/Users/ADMINI~1/AppData/Local/Temp/2/jsreport/autocleanup/cc656170-e701-4ac3-a0b5-c7c8b751f092-chrome-pdf.html rootId=dd30d141iypw1v3, id=dd30d141iypw1v3
    2022-08-15T15:59:14.783Z - debug: Page request finished: GET (document) file:///C:/Users/ADMINI~1/AppData/Local/Temp/2/jsreport/autocleanup/cc656170-e701-4ac3-a0b5-c7c8b751f092-chrome-pdf.html rootId=dd30d141iypw1v3, id=dd30d141iypw1v3
    2022-08-15T15:59:17.302Z - debug: Running chrome with params {"printBackground":true,"timeout":597393,"margin":{}} rootId=dd30d141iypw1v3, id=dd30d141iypw1v3
    2022-08-15T16:05:53.592Z - warn: Report render failed: Report cancelled Error: Report cancelled
        at Object.close (C:\Users\Administrator\shlomit\jsreportapp\node_modules\@jsreport\advanced-workers\lib\threadWorker.js:147:21)
        at Object.release (C:\Users\Administrator\shlomit\jsreportapp\node_modules\@jsreport\advanced-workers\lib\pool.js:38:22)
        at EventEmitter.<anonymous> (C:\Users\Administrator\shlomit\jsreportapp\node_modules\@jsreport\jsreport-core\lib\main\reporter.js:398:18)
        at Object.onceWrapper (node:events:641:28)
        at EventEmitter.emit (node:events:527:28)
        at EventEmitter.emit (node:domain:475:12)
        at Socket.<anonymous> (C:\Users\Administrator\shlomit\jsreportapp\node_modules\@jsreport\jsreport-express\lib\routes.js:68:20)
        at Object.onceWrapper (node:events:642:26)
        at Socket.emit (node:events:539:35)
        at Socket.emit (node:domain:475:12) rootId=dd30d141iypw1v3, id=dd30d141iypw1v3
    2022-08-15T16:05:53.594Z - info: Async report render finished with error undefined
    2022-08-15T16:05:53.606Z - warn: Error during processing request at http://localhost:8001/api/report, details: Report cancelled, stack: Error: Report cancelled
        at Object.close (C:\Users\Administrator\shlomit\jsreportapp\node_modules\@jsreport\advanced-workers\lib\threadWorker.js:147:21)
        at Object.release (C:\Users\Administrator\shlomit\jsreportapp\node_modules\@jsreport\advanced-workers\lib\pool.js:38:22)
        at EventEmitter.<anonymous> (C:\Users\Administrator\shlomit\jsreportapp\node_modules\@jsreport\jsreport-core\lib\main\reporter.js:398:18)
        at Object.onceWrapper (node:events:641:28)
        at EventEmitter.emit (node:events:527:28)
        at EventEmitter.emit (node:domain:475:12)
        at Socket.<anonymous> (C:\Users\Administrator\shlomit\jsreportapp\node_modules\@jsreport\jsreport-express\lib\routes.js:68:20)
        at Object.onceWrapper (node:events:642:26)
        at Socket.emit (node:events:539:35)
        at Socket.emit (node:domain:475:12)
    

    When I use the same /render for 1mb data - it's working.
    I don't think it's a timeout issue - because I already handled it.
    It doesn't look like memory issue either.
    There is no error here, so I don't know where to search.
    Can I get some help, please?

    Thanks



  • This error means that the client actually closed the connection before the report finished.

    You can either look at the client/network why its closing the connection, or use the async reports that doesn't require client to wait for the end
    https://jsreport.net/learn/reports#async



  • Thanks.
    Is there a way to send the render data as a blob, or it must be a json?
    since I need to render a huge amount of data, and the node is incapable of defining such a big variable



  • The api/report expects just JSON.
    How the blob would be useful? Don't you need to anyway parse it then so you can loop over it?

    However, you can use beforeRender script to actively fetch the data as you want and process it as you want.
    https://jsreport.net/learn/scripts



  • ok, so actually I use afterRender to fetch the data in chunks, render the chunks and then use the append operation to concatenate the render responses. Just as explained in the documentation (https://jsreport.net/learn/pdf-utils, 'Usage in script' section).
    The problem is that append operation adds a page break, so the data chunks are appended in the final pdf but with page breaks. How can I avoid it, and append the data consecutively?



  • The problem is that append operation adds a page break, so the data chunks are appended in the final pdf but with page breaks.

    Hm, I'm afraid I don't have the solution here. The append works on page bases.

    Is this really necessary? It's the first time I hear the input data are so big it doesn't fit into memory. Do you project the data you really need?



  • I'm still trying to fully figure out the jsreport capabilities, so I'm challenging it to determine the limits.
    Thanks.


Log in to reply
 

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