Timeout in jsreport v2 / .net sdk v2



  • Thank you for the reply.

    This really seem strange. the jsreport cli seems to be working fine. both the sample reports are being generated. even the above mentioned template is working fine

    but when after testing the cli, I tried the .net app again I am still getting the same error.



  • any pointers where I should be looking to fix it?



  • Hm. I don't know. You can try to stop an antivirus if it helps.

    Does the asp.net core sample work for you?
    https://github.com/jsreport/jsreport-dotnet-example-webapp

    If it does, what is the difference in yours setup?



  • Getting the timeout error from the sample:

    JsReportBinaryException: Error rendering report: instance has been daemonized and initialized successfully (pid: 3152)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:134749: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]:42206:29) at concat ([eval]:42259:40) at ConcatStream.<anonymous> ([eval]:13929:43) at emitNone (events.js:111:20) at ConcatStream.emit (events.js:208:7) at finishMaybe ([eval]:88932:14) at afterWrite ([eval]:88794:3) at _combinedTickCallback (internal/process/next_tick.js:144:20) at process._tickCallback (internal/process/next_tick.js:180:9)
    
    jsreport.Local.Internal.LocalUtilityReportingService+<RenderAsync>d__10.MoveNext()
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    System.Runtime.CompilerServices.TaskAwaiter.GetResult()
    jsreport.AspNetCore.JsReportMiddleware+<Invoke>d__3.MoveNext()
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+<InvokeNextResourceFilter>d__22.MoveNext()
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
    Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
    Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+<InvokeFilterPipelineAsync>d__17.MoveNext()
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+<InvokeAsync>d__15.MoveNext()
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    Microsoft.AspNetCore.Builder.RouterMiddleware+<Invoke>d__4.MoveNext()
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware+<Invoke>d__7.MoveNext()


  • Also, I dont have any anti-virus running.

    the jsrepot-cli is running fine, but the not the .net version.

    Also, I am facing this issue on Windows 7. The .net version seems to work fine on another PC with windows 10.



  • Also, I dont have any anti-virus running.

    Not even a windows defender?

    Please try to close VS and delete this folder
    C:\Users[your user]\AppData\Local\Temp\jsreport

    Then try to start and run the sample jsreport project again.

    If it won't help I try to get a windows 7 vm in azure and try it out there.



  • no, not even windows defender.

    I tired after deleting the folder, but still getting the same error.



  • Hm. I guess you don't have access to another Windows 7 machine right?
    Just that we would know it is about Windows 7 or something particular on your pc.
    I wanted to create windows 7 vm in azure but seems it is not available and I currently don't have space for another VM on my local.

    Additionally...

    Somewhere here should be the binary the .net uses
    c:\Users\janbl\AppData\Local\Temp\jsreport\dotnet\binary-default-xxx\jsreport.exe
    That one is able to render chrome for you?



  • I found the exe at the path, but What do you mean by: "That one is able to render chrome for you?"

    and yes, unfortunately, that is the only windows 7 machine available for me.



  • Run something like this in cmd

    c:\Users\janbl\AppData\Local\Temp\jsreport\dotnet\binary-default-2.1.0.0>echo foo > in.html
    
    c:\Users\janbl\AppData\Local\Temp\jsreport\dotnet\binary-default-2.1.0.0>jsreport.exe render --template.content=in.html --template.engine=handlebars --template.recipe=chrome-pdf --out=out.pdf
    starting rendering process..
    rendering has finished successfully and saved in: c:\Users\janbl\AppData\Local\Temp\jsreport\dotnet\binary-default-2.1.0.0\out.pdf
    


  • This works, generates the pdf with foo.

    C:\Users\xxx\AppData\Local\Temp\jsreport\dotnet\binary-default-2.3.1.0>echo foo > in.html
    
    C:\Users\xxx\AppData\Local\Temp\jsreport\dotnet\binary-default-2.3.1.0>jsreport.exe render --template.content=in.html --template.engine=handlebars --template.recipe=chrome-pdf --out=out.pdf
    starting rendering process..
    rendering has finished successfully and saved in: C:\Users\xxx\AppData\Local\Temp\jsreport\dotnet\binary-default-2.3.1.0\out.pdf
    
    C:\Users\xxx\AppData\Local\Temp\jsreport\dotnet\binary-default-2.3.1.0>


  • It seems something with jsreport .net package on windows 7 maybe. I installed windows 7 on vmware on a windows 10 PC, and had the same timeout issue, with the .net core example.



  • Thank you very much for trying this out.

    Is there any plan for you to update to windows 10?

    I am not sure if our full schedule will let us find out what is the reason it doesn't work on windows 7 soon.
    It can be some dependency issue we won't be able to solve anyway.



  • No, it seems there is no near future plans to upgrade to windows 10



  • so, should we expect any fix, like this month, or move to using jsreport.Client with raw jsreport-cli?



  • If you can use the other options than waiting for us to check win 7, please do it. I cannot guarantee timeframe we get to it.

    Or if you have some time you can try to debug jsreport.Local code.
    We start the jsreport.exe process somewhere here
    https://github.com/jsreport/jsreport-dotnet-local/blob/master/jsreport.Local/Internal/BinaryProcess.cs#L123

    You see we are removing some strange environment variables which likely VS adds.
    It was causing some issues in the past for the jsreport.exe
    It could be that there are some other strange environment variables your system is passing and we may need to remove them as well.



  • I tried checking around jsreport.Local Repo. The issue only happens with the chrome-pdf recipe. test and html recipe work fine.

    The error occurs at the following point in jsReport.Local:

    An unhandled exception occurred while processing the request.
    JsReportBinaryException: 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:134749: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]:42206:29) at concat ([eval]:42259:40) at ConcatStream.<anonymous> ([eval]:13929:43) at emitNone (events.js:111:20) at ConcatStream.emit (events.js:208:7) at finishMaybe ([eval]:88932:14) at afterWrite ([eval]:88794:3) at _combinedTickCallback (internal/process/next_tick.js:144:20) at process._tickCallback (internal/process/next_tick.js:180:9)
    
    jsreport.Local.Internal.LocalUtilityReportingService+<RenderAsync>d__10.MoveNext() in LocalUtilityReportingService.cs, line 74
    
    Stack Query Cookies Headers 
    
    JsReportBinaryException: 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:134749: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]:42206:29) at concat ([eval]:42259:40) at ConcatStream.<anonymous> ([eval]:13929:43) at emitNone (events.js:111:20) at ConcatStream.emit (events.js:208:7) at finishMaybe ([eval]:88932:14) at afterWrite ([eval]:88794:3) at _combinedTickCallback (internal/process/next_tick.js:144:20) at process._tickCallback (internal/process/next_tick.js:180:9)
        jsreport.Local.Internal.LocalUtilityReportingService+<RenderAsync>d__10.MoveNext() in LocalUtilityReportingService.cs
    
                    var metaDictionary = new Dictionary<string, string>();
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    System.Runtime.CompilerServices.TaskAwaiter.GetResult()
    jsreport.AspNetCore.JsReportMiddleware+<Invoke>d__3.MoveNext()
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+<InvokeNextResourceFilter>d__22.MoveNext()
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
    Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
    Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+<InvokeFilterPipelineAsync>d__17.MoveNext()
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+<InvokeAsync>d__15.MoveNext()
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    Microsoft.AspNetCore.Builder.RouterMiddleware+<Invoke>d__4.MoveNext()
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
    System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware+<Invoke>d__7.MoveNext()
    

    This is the final list of env variables on the VM:

    https://www.dropbox.com/s/neylkhs5qduibxt/env3.txt?dl=0

    I also tried after two additional similar variables I found in the initial list, but it didn't helped either:

     worker.StartInfo.EnvironmentVariables.Remove("COMPLUS_ForceENC");
     worker.StartInfo.EnvironmentVariables.Remove("COMPLUS_MDA");
    

    any other pointers to look for?



  • It doesn't seems to be the issue with the environment variables, as I compared all the ones available on the win10 machine, and win 7 vm, and nearly all of them are same. I also tried removing all the ones that are different, but it doesn't changes anything.



  • You see in debug exactly what command is called... What if you take it and run it in the separate command line manually. Does it also timeout?



  • Yes, still getting a timeout. below is the command and the response
    
    
    C:\Users\Saad\AppData\Local\Temp\jsreport\dotnet\binary-default-2.3.1.0>jsreport render --keepAlive --request="C:\Users\Saad\AppData\Local\Temp\jsreport\autocleanup\req9799b535-f5c3-4eb4-8dcb-ceeac90442a3.json" --out="C:\Users\Saad\AppData\Local\Temp\jsreport\autocleanup\out673df5ac-04d7-4090-9b20-9312bf1ced8a" --meta="C:\Users\Saad\AppData\Local\Temp\jsreport\autocleanup\meta0d98e9b2-28c8-4010-8533-54b1bdb643db"
    instance has been daemonized and initialized successfully (pid: 4112)
    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:134749: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]:42206:29)
    at concat ([eval]:42259:40)
    at ConcatStream.<anonymous> ([eval]:13929:43)
    at emitNone (events.js:111:20)
    at ConcatStream.emit (events.js:208:7)
    at finishMaybe ([eval]:88932:14)
    at afterWrite ([eval]:88794:3)
    at _combinedTickCallback (internal/process/next_tick.js:144:20)
    at process._tickCallback (internal/process/next_tick.js:180:9)

Log in to reply
 

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