Error
I am facing the following error, I am rendering HTML as PDF (Download). Can anyone help?
Error rendering report: An error ocurred while trying to execute "render" command (3). A critical error occurred while trying to execute the render command (2). An error occurred while trying to start daemonized process: An error has occurred when trying to initialize jsreport, seems like there is already a server running in port: 5488 (1). caused by error (3):-> stackError: at startCLI (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:127:19) at async startCommand (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:67:5) at async startProcessing (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startProcessing.js:195:3)caused by error (2):-> stackError: at onCriticalError (C:\snapshot\jsreport\packages\jsreport-cli\lib\commands\render.js:304:19) at C:\snapshot\jsreport\packages\jsreport-cli\lib\commands\render.js:258:14 at async executeCommand (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\executeCommand.js:22:20) at async Object.handler (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\registerCommand.js:76:9) at async parseCLI (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:156:3) at async startCLI (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:121:20) at async startCommand (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:67:5) at async startProcessing (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startProcessing.js:195:3)caused by error (1):-> meta = {"code":"EADDRINUSE"}-> stackError: An error has occurred when trying to initialize jsreport, seems like there is already a server running in port: 5488 at Object.
seems like there is already a server running in port: 5488
There is another jsreport instance. Kill it from the taskmgr (node process).
You can also let .net kill all other jsreport node processes using
var rs = new LocalReporting()
.UseBinary(JsReportBinary.GetBinary())
.KillRunningJsReportProcesses()
...
Thank you for your prompt reply.
I am already doing it ... from the previous posts.
var rs = new LocalReporting() .UseBinary(JsReportBinary.GetBinary()) .KillRunningJsReportProcesses() .TempDirectory(Path.Combine((string)AppDomain.CurrentDomain.GetData("DataDirectory"), "jsreport-temp")) .AsUtility() .Create();
But that doesn't solve the problem....
Did you try to kill node processes in the taskmgr?
Did you try to kill node processes in the taskmgr?
Yes I did!

It works fine with sample source code you have provided. But when I deploy in IIS the above error is throwing.
Now when I kill the node manually following error is appearing?
Error rendering report: rendering has finished with errors:An error ocurred while trying to execute "render" command (3). A critical error occurred while trying to execute the render command (2). spawn EPERM (1). caused by error (3):-> stackError: at startCLI (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:127:19) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async startCommand (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:67:5) at async startProcessing (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startProcessing.js:195:3)caused by error (2):-> stackError: at onCriticalError (C:\snapshot\jsreport\packages\jsreport-cli\lib\commands\render.js:304:19) at C:\snapshot\jsreport\packages\jsreport-cli\lib\commands\render.js:258:14 at processTicksAndRejections (node:internal/process/task_queues:96:5) at async executeCommand (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\executeCommand.js:22:20) at async Object.handler (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\registerCommand.js:76:9) at async parseCLI (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:156:3) at async startCLI (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:121:20) at async startCommand (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:67:5) at async startProcessing (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startProcessing.js:195:3)caused by error (1):-> stackError: at Client.render (C:\snapshot\jsreport\packages\nodejs-client\lib\client.js:92:17) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async startRender (C:\snapshot\jsreport\packages\jsreport-cli\lib\commands\render.js:321:24) at async C:\snapshot\jsreport\packages\jsreport-cli\lib\commands\render.js:228:22 at async executeCommand (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\executeCommand.js:22:20) at async Object.handler (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\registerCommand.js:76:9) at async parseCLI (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:156:3) at async startCLI (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:121:20) at async startCommand (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:67:5) at async startProcessing (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startProcessing.js:195:3)Remote stack: Error: at ChildProcess.spawn (node:internal/child_process:412:11) at Object.spawn (node:child_process:698:9) at Object.spawn (pkg/prelude/bootstrap.js:1963:27) at BrowserRunner.start (C:\snapshot\jsreport\node_modules\puppeteer\lib\cjs\puppeteer\node\BrowserRunner.js:119:34) at ChromeLauncher.launch (C:\snapshot\jsreport\node_modules\puppeteer\lib\cjs\puppeteer\node\ChromeLauncher.js:76:16) at async createBrowser (C:\snapshot\jsreport\packages\jsreport-chrome-pdf\lib\chromePoolStrategy.js:98:26) at async allocateBrowser (C:\snapshot\jsreport\packages\jsreport-chrome-pdf\lib\chromePoolStrategy.js:113:5) at async getBrowser (C:\snapshot\jsreport\packages\jsreport-chrome-pdf\lib\chromePoolStrategy.js:23:30) at async C:\snapshot\jsreport\packages\jsreport-chrome-pdf\lib\conversion.js:11:19 at async execute (C:\snapshot\jsreport\packages\jsreport-chrome-pdf\lib\chromePoolStrategy.js:20:22) looking for previously daemonized instance in: C:\inetpub\wwwroot\TanFile\App_Data\jsreport-temp\cli\wSock cwd: C:\inetpub\wwwroot\TanFile\bin\jsreportthere is no previously daemonized instance in: C:\inetpub\wwwroot\TanFile\App_Data\jsreport-temp\cli\wSock cwd: C:\inetpub\wwwroot\TanFile\bin\jsreportinstance has been daemonized and initialized successfully (pid: 7280)remote server options:{ "url": "http://localhost:5488/"}rendering with options:{
I found something strange when I kill Node JS there is different error with partial HTML Rendered.
Here is the output. Error rendering report: rendering has finished with errors:An error ocurred while trying to execute "render" command (3). A critical error occurred while trying to execute the render command (2). spawn EPERM (1). caused by error (3):-> stackError: at startCLI (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:127:19) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async startCommand (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:67:5) at async startProcessing (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startProcessing.js:195:3)caused by error (2):-> stackError: at onCriticalError (C:\snapshot\jsreport\packages\jsreport-cli\lib\commands\render.js:304:19) at C:\snapshot\jsreport\packages\jsreport-cli\lib\commands\render.js:258:14 at processTicksAndRejections (node:internal/process/task_queues:96:5) at async executeCommand (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\executeCommand.js:22:20) at async Object.handler (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\registerCommand.js:76:9) at async parseCLI (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:156:3) at async startCLI (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:121:20) at async startCommand (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:67:5) at async startProcessing (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startProcessing.js:195:3)caused by error (1):-> stackError: at Client.render (C:\snapshot\jsreport\packages\nodejs-client\lib\client.js:92:17) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async startRender (C:\snapshot\jsreport\packages\jsreport-cli\lib\commands\render.js:321:24) at async C:\snapshot\jsreport\packages\jsreport-cli\lib\commands\render.js:228:22 at async executeCommand (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\executeCommand.js:22:20) at async Object.handler (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\registerCommand.js:76:9) at async parseCLI (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:156:3) at async startCLI (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:121:20) at async startCommand (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startCommand.js:67:5) at async startProcessing (C:\snapshot\jsreport\packages\jsreport-cli\lib\commander\startProcessing.js:195:3)Remote stack: Error: at ChildProcess.spawn (node:internal/child_process:412:11) at Object.spawn (node:child_process:698:9) at Object.spawn (pkg/prelude/bootstrap.js:1963:27) at BrowserRunner.start (C:\snapshot\jsreport\node_modules\puppeteer\lib\cjs\puppeteer\node\BrowserRunner.js:119:34) at ChromeLauncher.launch (C:\snapshot\jsreport\node_modules\puppeteer\lib\cjs\puppeteer\node\ChromeLauncher.js:76:16) at async createBrowser (C:\snapshot\jsreport\packages\jsreport-chrome-pdf\lib\chromePoolStrategy.js:98:26) at async allocateBrowser (C:\snapshot\jsreport\packages\jsreport-chrome-pdf\lib\chromePoolStrategy.js:113:5) at async getBrowser (C:\snapshot\jsreport\packages\jsreport-chrome-pdf\lib\chromePoolStrategy.js:23:30) at async C:\snapshot\jsreport\packages\jsreport-chrome-pdf\lib\conversion.js:11:19 at async execute (C:\snapshot\jsreport\packages\jsreport-chrome-pdf\lib\chromePoolStrategy.js:20:22) looking for previously daemonized instance in: C:\Users\DefaultAppPool\AppData\Local\Temp\jsreport\cli\wSock cwd: C:\inetpub\wwwroot\TanFile\bin\jsreportthere is no previously daemonized instance in: C:\Users\DefaultAppPool\AppData\Local\Temp\jsreport\cli\wSock cwd: C:\inetpub\wwwroot\TanFile\bin\jsreportinstance has been daemonized and initialized successfully (pid: 10144)remote server options:{ "url": "http://localhost:5488/"}rendering with options:{ "$id": "1", "template": { "$id": "2", "content": "\r\n\r\n\r\n\r\n<html dir="rtl" lang="ar">\r\n
\r\n <meta charset="UTF-8" />\r\n\r\n <p class="bold block">رقم الإشعار: 157\r\n <p class="bold block">تاريخ الإشعار: 11/13/2022 3:56:00 PM م\r\n \r\n <div class="col-xs-3">\r\n \r\n \r\n <div class="col-xs-5 pm-certified text-center" style="padding-right: 30px">\r\n <span class="pm-empty-space block">\r\n <img src="/test/Content/images/GAC-logo-1.svg" alt="GAC logo" />\r\n \r\n \r\n \r\n\r\n <div class="pm-certificate-title col-xs-12 text-center">\r\n
\r\n <h3 style="font-weight: 700; color: #6f7576">إنذار أولي بسداد غرامة مالية\r\n \r\n \r\n \r\n\r\n <div class="row pm-certificate-body">\r\n <div class="pm-certificate-block">\r\n <div class="col-xs-12">\r\n <div class="col-xs-12">\r\n <div class="row">\r\n <table class="table" style="border-collapse: separate; border-spacing: 10px">\r\n
\r\n اسم المنشأة\r\n
<span style="font-size: 80%">الصادر بØÙ‚ها الغرامة المالية\r\n \r\n <td class="pm-english-text grey-bg" style="border: 1px solid #ddd">تجريبي\r\n
<span style="font-size: 80%">رقم السجل التجاري: 2035807359\r\n \r\n
العنوان الوطني\r\n \r\n <td class="pm-english-text grey-bg" style="border: 1px solid #ddd">\r\n (6545) Ù…ØÙ…د برناوي - ØÙŠ Ø§Ù„Ø±ÙˆØ¶Ø¯Ø© - الرياض الرمز البريدي (11492) الإضاÙÙŠ (6545)\r\n \r\n
المهلة Ø§Ù„Ù…ØØ¯Ø¯Ø© للسداد\r\n \r\n <td class="pm-english-text grey-bg" style="border: 1px solid #ddd">(15) يوم عمل من تاريخ هذا الإشعار\r\n
مقدار الغرامة المالية\r\n \r\n <td class="pm-english-text grey-bg" style="border: 1px solid #ddd">\r\n ()
<span style="font-size: 80%">(ØµÙØ± ريال)\r\n \r\n
رقم القرار / الØÙƒÙ… وتاريخه
<span style="font-size: 80%">الصادر بØÙ‚ المنشأة\r\n \r\n <td class="pm-english-text grey-bg" style="border: 1px solid #ddd">\r\n قرار لجنة Ø§Ù„ÙØµÙ„ ÙÙŠ Ù…Ø®Ø§Ù„ÙØ§Øª نظام Ø§Ù„Ù…Ù†Ø§ÙØ³Ø©
<span style="font-size: 100%">رقم (000) وتاريخ 11/8/2022 12:00:00 AM م\r\n \r\n
قنوات السداد\r\n \r\n <td class="pm-english-text grey-bg" style="border: 1px solid #ddd">\r\n <ul style="text-align: right">\r\n <li style="padding-bottom: 10px">\r\n بموجب شيك مصرÙÙŠ (مصدّق) باسم الهيئة العامة Ù„Ù„Ù…Ù†Ø§ÙØ³Ø©/ الغرامات، يسلم للهيئة العامة Ù„Ù„Ù…Ù†Ø§ÙØ³Ø©.\r\n \r\n <li style="padding-bottom: 10px">\r\n أو الإيداع ÙÙŠ ØØ³Ø§Ø¨ الهيئة العامة Ù„Ù„Ù…Ù†Ø§ÙØ³Ø© لدى البنك المركزي رقم (SA6801100001230401000017) مع تزويد الهيئة بإشعار من البنك\r\n ÙŠÙيد بسداد مبلغ الغرامة.\r\n \r\n
Ù„Ù„Ø§Ø³ØªÙØ³Ø§Ø±Ø§Øª\r\n \r\n <td class="pm-english-text grey-bg" style="border: 1px solid #ddd">\r\n البريد الإلكتروني: [email protected]
<span style="font-size: 100%">الهاتÙ: (0114406666) تØÙˆÙŠÙ„Ø© رقم 21547\r\n \r\n
هذه الوثيقة مرسلة من النظام الآلي ولا ØªØØªØ§Ø¬ إلى توقيع
\r\n\r\n <div class="row">\r\n <img src="/test/Content/images/socials-footer.svg" width="550px" alt="" />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n <script src="/test/Scripts/bootstrap.min.js">\r\n
Don't you have IIS number of worker processes configured to higher than 1?"
It's configured as 1

Late yesterday, I mange to render by adding
` var rs = new LocalReporting() .UseBinary(JsReportBinary.GetBinary()) .KillRunningJsReportProcesses() .TempDirectory(Path.Combine((string)AppDomain.CurrentDomain.GetData("DataDirectory"), "jsreport-temp")) .Configure(cfg => cfg.AllowedLocalFilesAccess().BaseUrlAsWorkingDirectory()) .AsUtility().KeepAlive(false) .Create();
filters.Add(new JsReportFilterAttribute(new ReportingService("http://10.112.8.21:5488/")));`
Now it is showing...

Hmm, I will need some instructions on how to replicate this.
I cloned and compiled this example https://github.com/jsreport/jsreport-dotnet-example-net-webapp
I created a new website in IIS without doing any extra configs. I open the app and things work for me.
Could you give me some steps on how to replicate your issue? The best is to start from scratch, create a new VM lets say in Azure, with windows server xxx, install IIS, and deploy an app...
I'm having the same issue here. Works awesome on my local machine but the minute I publish it to EC2 windows IIS same thing happens. Do you guys have any solution ?
Here is also peace of my code.

@kajdzo I would love to replicate it and fix it. Would you please provide me with the exact steps on what to do to replicate this? What exact image do you use? Windows Server 2022 base? What do you do in VM, do you provide the user running the app the permissions to write to the app folder? Do you use the default website in IIS or do you create a new one? Do you configure IIS in any way? What .net version do you use?
First of all, thanks for quick response. I'm on Windows Server 2022. Using default IIS site. .NET 6. Pretty much everything is out of the box. While debugging this issue I have added user with Full access to everything.
My code is pasted in previous post. And here is a list of my nugets.
I also installed nodejs on the VM.
I've tried it and have had no issues. Please try the same and let me know if it works. We will need to find out what is different to isolate the problem.
The app
https://github.com/jsreport/jsreport-dotnet-example-webapp I used publish to file system

The server
I have a fresh EC2 Windows Server 2022 Base T2 medium
I've installed IIS there using Server Manager and "Add roles and features"
I've installed also .net ASP.NET Core Runtime 6.0.11 Windows Hosting Bundle from the link here
https://dotnet.microsoft.com/en-us/download/dotnet/6.0
In IIS I used "Add Website.." with the new app pool and targetting the folder with the app deployment and explicit port 5000
Then I opened the app, and I see the pdf renders fine.
I won't be able to test it untill tomorrow but as soon as I do I'll post results. Thanks!