Open imranjalali opened 1 year ago
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<!DOCTYPE html>\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 <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
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. (C:\snapshot\jsreport\packages\jsreport-cli\lib\keepAliveProcess.js:157:27) at Object.listener (C:\snapshot\jsreport\node_modules\eventemitter2\lib\eventemitter2.js:251:10) at Object.emit (C:\snapshot\jsreport\node_modules\eventemitter2\lib\eventemitter2.js:339:22) at Object._onData (C:\snapshot\jsreport\node_modules\nssocket\lib\nssocket.js:454:8) at Lazy. (C:\snapshot\jsreport\node_modules\lazy\lazy.js:91:13) at Lazy. (C:\snapshot\jsreport\node_modules\lazy\lazy.js:73:19) at Lazy.emit (node:events:390:28) at Lazy. (C:\snapshot\jsreport\node_modules\lazy\lazy.js:74:22) at Lazy.emit (node:events:390:28) at yieldTo (C:\snapshot\jsreport\node_modules\lazy\lazy.js:181:18)Remote Instance Error: Error: at C:\snapshot\jsreport\packages\jsreport-cli\lib\instanceHandler.js:31:29 at processTicksAndRejections (node:internal/process/task_queues:96:5)Remote Instance Error: Error: at Server.setupListenHandle [as _listen2] (node:net:1334:16) at listenInCluster (node:net:1382:12) at Server.listen (node:net:1469:7) at C:\snapshot\jsreport\packages\jsreport-express\lib\main.js:22:12 at new Promise () at startAsync (C:\snapshot\jsreport\packages\jsreport-express\lib\main.js:16:10) at C:\snapshot\jsreport\packages\jsreport-express\lib\main.js:50:14 at Object.start (C:\snapshot\jsreport\packages\jsreport-express\lib\main.js:125:13) at Object. (C:\snapshot\jsreport\packages\jsreport-express\lib\main.js:327:30) at async ListenerCollection.fire (C:\snapshot\jsreport\packages\jsreport-core\lib\shared\listenerCollection.js:157:21)
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\jsreport