Issues using Chrome-Pdf recipie on IIS
-
I am using the jsreport nuget packages in an asp.net core application. I am able to generate my pdf reports on my local machine however I run into an issue when I try to generate reports with the asp.net core application running in IIS. Whenever I attempt to run a report, it ultimately times out and gives me the following error:
Error rendering report: instance has been daemonized and initialized successfully (pid: 2480)A critical error occurred while trying to execute the render command: Timeout Error: pdf generation not completed after 40000ms
Here is what I have been able to verify so far:
-
I can navigate to the jsreport folder in the deployed asp.net core application, run "jsreport start" from the command line and enter jsreport studio. From there I can run my reports with sample data sizes comparable to what I would expect at runtime, and they export to PDF just fine.
-
I can successfully make a request to the IIS hosted asp.net core application to render a plain HTML report.
-
The reports run just fine when being hosted on my local machine, outside of IIS.
-
I have added an exception to the jsreport.exe file on the IIS machine as well, but that didnt seem to change anything.
Edit: Some additional information..
The IIS app is running under the Network Authority user. I have given the application pool full permissions to the jsreport folder deployed with the ASP.Net Core application, and to the jsreport folder in C:\Windows\Temp
Are there any additional steps I need to take to get chrome-pdf conversion working when hosting with IIS?
-
-
It should work with the defaults on a new windows server and iis.
The default is application pool identity I think, can you try to change your app pool settings? Just to know if it helps.I tried the NetworkService and it works for me. I mean I can render using chrome-pdf from withing asp.net application running in iis.
Maybe you can try to add exception to your antivirus also for these
c:\Windows\Temp\jsreport\compile\jsreport-2.2.0-r17qQMiI7\chrome\chrome.exe
c:\Windows\Temp\jsreport\compile\jsreport-2.2.0-r17qQMiI7\winrun.exe
-
I have the same issue... I managed to workaround it by DISABLING the chrome-pool, e.g. remove
"chrome-pdf": {
"strategy": "chrome-pool",
"numberOfWorkers": 3
}
from the config. It works.It is pity as chrome-pool works perfect when using directly in Kestrel (starting from cmd with dotnet Whatever.dll). It also works on my developer machine under IIS Express, but when I publish it to a staging IIS 10 / Windows Server it constantly gives timeouts :(.
Anyway sticking on the default, which starts "extra new chrome process every time you render a template" makes it work, on the price of slower execution.