jsreport / jsreport-dotnet

jsreport .NET sdk home repository
https://jsreport.net
MIT License
63 stars 9 forks source link

.NET Core Windows Server 2008 R2 Standard IIS rendering timeout LocalReporting #50

Closed wggley closed 2 years ago

wggley commented 4 years ago

Versions used:

    <PackageReference Include="jsreport.AspNetCore" Version="2.0.2" />
    <PackageReference Include="jsreport.Binary" Version="2.7.1" />
    <PackageReference Include="jsreport.Client" Version="3.0.1" />
    <PackageReference Include="jsreport.Local" Version="2.2.2" />
    <PackageReference Include="jsreport.Shared" Version="2.1.0" />
    <PackageReference Include="jsreport.Types" Version="2.7.0" />

Windows Server 2008 R2 Standard - Service Pack 1 64-bit - 32 GB RAM

Startup.cs:

 services.AddJsReport(new LocalReporting()
            .UseBinary(JsReportBinary.GetBinary())
            .KillRunningJsReportProcesses()
            .AsUtility()
            .Create());

Exception: jsreport.Local.JsReportBinaryException: Error rendering report: instance has been daemonized and initialized successfully (pid: 5596)rendering has finished with errors: A critical error occurred while trying to execute the render command (2). Timeout Error: pdf generation not completed after 30000ms (1). caused by error (2): -> stackError: at onCriticalError (D:\snapshot\jsreport\node_modules\jsreport-cli\lib\commands\render.js:302:19) at D:\snapshot\jsreport\node_modules\jsreport-cli\lib\commands\render.js:256:14 at processTicksAndRejections (internal/process/task_queues.js:93:5)caused by error (1): -> stackError: at Client.render (D:\snapshot\jsreport\node_modules\jsreport-client\lib\client.js) at processTicksAndRejections (internal/process/task_queues.js:93:5) at async startRender (D:\snapshot\jsreport\node_modules\jsreport-cli\lib\commands\render.js:319:24) at async D:\snapshot\jsreport\node_modules\jsreport-cli\lib\commands\render.js:226:22 at async Commander.executeCommand (D:\snapshot\jsreport\node_modules\jsreport-cli\lib\commander.js:242:22)Remote stack: Error: at Timeout._onTimeout (D:\snapshot\jsreport\node_modules\jsreport-chrome-pdf\lib\conversion.js:202:19) at listOnTimeout (internal/timers.js:531:17) at processTimers (internal/timers.js:475:7)

I tried to change timeout to 100000ms but no success. It works locally and on Windows Server 2012 normally.

pofider commented 4 years ago

Could you try to install on that server normal full jsreport and check if pdf print works there for you?

It looks the chrome.exe process is somehow blocked on your server. Not sure what it can cause.

wggley commented 4 years ago

I'm actually trying this approach now but no success yet. Jsreport can be installed but I have a lot of errors.

It's saying I don't have puppetteer:

PS D:\jsreportapp> jsreport start
An error has occurred when trying to initialize jsreport (2). Error when loading extension chrome-pdf@1.7.1
Error: Cannot find module 'puppeteer'
Require stack:
- D:\jsreportapp\node_modules\jsreport-chrome-pdf\lib\chrome.js
- D:\jsreportapp\node_modules\jsreport-core\lib\extensions\extensionsManager.js
- D:\jsreportapp\node_modules\jsreport-core\lib\reporter.js
- D:\jsreportapp\node_modules\jsreport-core\index.js
- D:\jsreportapp\node_modules\jsreport-cli\lib\instanceHandler.js
- D:\jsreportapp\node_modules\jsreport-cli\lib\commander.js
- C:\Users\wallace\AppData\Roaming\npm\node_modules\jsreport-cli\cli.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:957:15)
    at Function.Module._load (internal/modules/cjs/loader.js:840:27)
    at Module.require (internal/modules/cjs/loader.js:1019:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.module.exports (D:\jsreportapp\node_modules\jsreport-chrome-pdf\lib\chrome.js:120:107)
    at Object._useOne (D:\jsreportapp\node_modules\jsreport-core\lib\extensions\extensionsManager.js:194:75)
    at Object._useMany (D:\jsreportapp\node_modules\jsreport-core\lib\extensions\extensionsManager.js:98:20)
    at async Reporter.init (D:\jsreportapp\node_modules\jsreport-core\lib\reporter.js:229:7)
    at async Commander.executeCommand (D:\jsreportapp\node_modules\jsreport-cli\lib\commander.js:242:22) (1).
caused by error (2):
-> stack
Error:
    at D:\jsreportapp\node_modules\jsreport-cli\lib\instanceHandler.js:31:29
    at async Commander.executeCommand (D:\jsreportapp\node_modules\jsreport-cli\lib\commander.js:242:22)
caused by error (1):
-> stack
Error: Error when loading extension chrome-pdf@1.7.1
Error: Cannot find module 'puppeteer'
Require stack:
- D:\jsreportapp\node_modules\jsreport-chrome-pdf\lib\chrome.js
- D:\jsreportapp\node_modules\jsreport-core\lib\extensions\extensionsManager.js
- D:\jsreportapp\node_modules\jsreport-core\lib\reporter.js
- D:\jsreportapp\node_modules\jsreport-core\index.js
- D:\jsreportapp\node_modules\jsreport-cli\lib\instanceHandler.js
- D:\jsreportapp\node_modules\jsreport-cli\lib\commander.js
- C:\Users\wallace\AppData\Roaming\npm\node_modules\jsreport-cli\cli.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:957:15)
    at Function.Module._load (internal/modules/cjs/loader.js:840:27)
    at Module.require (internal/modules/cjs/loader.js:1019:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.module.exports (D:\jsreportapp\node_modules\jsreport-chrome-pdf\lib\chrome.js:120:107)
    at Object._useOne (D:\jsreportapp\node_modules\jsreport-core\lib\extensions\extensionsManager.js:194:75)
    at Object._useMany (D:\jsreportapp\node_modules\jsreport-core\lib\extensions\extensionsManager.js:98:20)
    at async Reporter.init (D:\jsreportapp\node_modules\jsreport-core\lib\reporter.js:229:7)
    at async Commander.executeCommand (D:\jsreportapp\node_modules\jsreport-cli\lib\commander.js:242:22)
    at Object._useOne (D:\jsreportapp\node_modules\jsreport-core\lib\extensions\extensionsManager.js:216:15)
    at Object._useMany (D:\jsreportapp\node_modules\jsreport-core\lib\extensions\extensionsManager.js:98:20)
    at async Reporter.init (D:\jsreportapp\node_modules\jsreport-core\lib\reporter.js:229:7)
    at async Commander.executeCommand (D:\jsreportapp\node_modules\jsreport-cli\lib\commander.js:242:22)

When I try to install as a service:

PS D:\jsreportapp> jsreport win-install
Platform is win32
To install app as windows service you need to have a "start" script or a "main" field in package.json file
pofider commented 2 years ago

I'm afraid later nodejs doesn't work on windows server 2008 so jsreport doesn't as well.