jsreport MVC throws timeout error in server hosting



  • Hi,
    I am a beginner in jsreport... Trying some report samples before start to develop our new project...
    I download jsreport MVC sample application from github (https://github.com/jsreport/jsreport-dotnet-example-net-webapp) and create my own sample report. It is working fine in local machine and the iis hosting too. Then i publish and host in the server iis (windows server 2008 R2 and iis 7.5). It throws an error.
    'Error rendering report: instance has been daemonized and initialized successfully (pid: 9552)A critical error occurred while trying to execute the render command: Timeout Error: pdf generation not completed after 30000ms (1). caused by error (1) -> meta = {"remoteStack":"Error: Timeout Error: pdf generation not completed after 30000ms\n at Timeout.setTimeout (jsreportRuntime.js:151795:19)\n at ontimeout (timers.js:482:11)\n at tryOnTimeout (timers.js:317:5)\n at Timer.listOnTimeout (timers.js:277:5)"}, stack = Error: at responseToBuffer ([eval]:72595:29) at concat ([eval]:72648:40) at ConcatStream.<anonymous> ([eval]:17182:43) at emitNone (events.js:111:20) at ConcatStream.emit (events.js:208:7) at finishMaybe ([eval]:97353:14) at afterWrite ([eval]:97215:3) at _combinedTickCallback (internal/process/next_tick.js:144:20) at process._tickCallback (internal/process/next_tick.js:180:9)'
    Then I set the timeout by 'cfg.TemplatingEngines.Timeout = 260000' along with upgrade the 'jsreport.Types' to '2.4' and fix the error.
    Now I am getting another error,
    'Error rendering report: A critical error occurred while trying to execute the render command: Timeout Error: pdf generation not completed after 30000ms (1). caused by error (1) -> meta = {"remoteStack":"Error: Timeout Error: pdf generation not completed after 30000ms\n at Timeout.setTimeout (jsreportRuntime.js:151795:19)\n at ontimeout (timers.js:482:11)\n at tryOnTimeout (timers.js:317:5)\n at Timer.listOnTimeout (timers.js:277:5)"}, stack = Error: at responseToBuffer ([eval]:72595:29) at concat ([eval]:72648:40) at ConcatStream.<anonymous> ([eval]:17182:43) at emitNone (events.js:111:20) at ConcatStream.emit (events.js:208:7) at finishMaybe ([eval]:97353:14) at afterWrite ([eval]:97215:3) at _combinedTickCallback (internal/process/next_tick.js:144:20) at process._tickCallback (internal/process/next_tick.js:180:9)'
    I added .KillRunningJsReportProcesses(), but it also failed.
    What I am missing....? I install the jsreport cli again...
    which also gave same error...
    What I do now...? Please help...

    While calling the report each time, it executing 2 instances of jsreport.exe in server...

    Thanks in Advance
    Jayasankar Ramachandran



  • We will need to isolate the problem.

    • Does it hang also for a simple report? Just a "hello" HTML?

    • What if you temporary disable antivirus if you have one?

    • What if you try to run a full jsreport on that server, the one through the node or the binary. Does it start and render reports properly?
      https://jsreport.net/on-prem

    • Try to configure the jsreport temp directory somewhere to your AppData, does it help?
      https://jsreport.net/learn/dotnet-local#temp-files



  • Thanks for your reply....
    Will try all the points and update you..

    One strange thing happened yesterday that the report works fine at night from desktop, laptop and mobile devices.... Is this because of the server performance issue..?



  • The IIS is strange, running jsreport inside may not be the best idea. Or at least people report such problems as you and I haven't found a way to replicate them so far.
    If you have the option, I would recommend running jsreport outside as standalone windows service. Then you can easily configure your app in this way to connect to it.

    nuget install jsreport.Client
    
    public static void RegisterGlobalFilters(GlobalFilterCollection filters)
    {
               // with local embedded jsreport
               /* filters.Add(new JsReportFilterAttribute(new LocalReporting()
                    .UseBinary(JsReportBinary.GetBinary())
                    .AsUtility()
                    .Create()));*/
    
               //with external jsreport
               filters.Add(new JsReportFilterAttribute(new ReportingService("HTTP://localhost:5488"))        
    }
    


  • Sorry... I didn't get you....
    Means I need to call the report template generated from jsreport studio... right..?



  • Means I need to call the report template generated from jsreport studio... right..?

    No.

    Right now you use jsreport.Local and jsreport.Binary nugets. These embeds jsreport binary inside and start it from inside your application running inside iis. This can be problematic. I proposed you start jsreport outside iis as a normal process and connect to it from your app. It should be just one line change for you as I demonstrated.
    Here is how you can start jsreport
    https://jsreport.net/on-prem


Log in to reply
 

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