Two node.exe processes hang when jsreport service is stopped
-
Hi,
Currently, we are running jsreport on our servers as a service. When we start jsreport server, we don't see any error, however, in the backend, it continuously spits out errors saying "Port is already in use" which increases CPU utilization rate close to 100%. When we stop service, it fails to stop all node.exe processes. Two node.exe processes hang in the backend and we get Access denied error when we try to stop the processes.
Can someone please help us figure out why the action of stopping jsreport service causes processes to hang on the port?
Thanks
-
Can you share the logs?
How do you start and install the service?
Do you use commandjsreport win-install
as administrator ?
Is the port actually free? Does the user running the service have permission to open that port?
-
Hi Jan-
We are using jsreport version 1.4.0. We installed jsreport using command "node server.js install" from jsreport folder. "jsreport win-install" is not working with version 1.4.0We have checked, the port is dedicated to jsreport processes only. The weird part is that whenever we stop jsreport-server service, it kills the processes and immediately starts two node processes on the same port. We have checked, user have all the permissions to open that port
I tried uninstalling and installing the service again. When i install it, I see following error
<code>
C:..\jsreport>node server --install
Platform is win32
installing windows service jsreport-server.
2018-08-24T12:24:47.040Z - info: Initializing jsreport@1.4.0 in development mode
using configuration file dev.config.json
2018-08-24T12:24:47.055Z - info: Searching for available extensions in C:..\jsreport
2018-08-24T12:24:47.055Z - info: Extensions location cache contains up to date i
nformation, skipping crawling in C:..\jsreport\node_mo
dules\jsreport\node_modules
2018-08-24T12:24:48.974Z - info: Found 29 extensions
starting windows service jsreport-server.
2018-08-24T12:24:49.021Z - debug: Writing extension locations cache to C:..\Temp\jsreport-temp\extensions\locations.json
2018-08-24T12:24:49.021Z - debug: Discovered 29 extensions
2018-08-24T12:24:49.021Z - info: Using extension import-export
2018-08-24T12:24:49.879Z - info: Using extension ejs
2018-08-24T12:24:49.879Z - debug: Extension authentication is disabled, skipping2018-08-24T12:24:49.879Z - info: Using extension templates
2018-08-24T12:24:49.895Z - info: Using extension tags
2018-08-24T12:24:49.910Z - info: Using extension jsrender
2018-08-24T12:24:49.910Z - info: Using extension handlebars
2018-08-24T12:24:49.910Z - info: Using extension debug
2018-08-24T12:24:49.910Z - info: Using extension express
2018-08-24T12:24:50.160Z - info: Using extension fop-pdf
2018-08-24T12:24:50.175Z - info: Using extension reports
2018-08-24T12:24:50.191Z - info: Using extension fs-store
2018-08-24T12:24:50.721Z - info: Using extension html-to-xlsx
2018-08-24T12:24:50.909Z - info: Using extension images
2018-08-24T12:24:50.940Z - info: Using extension text
2018-08-24T12:24:50.955Z - info: Using extension child-templates
2018-08-24T12:24:50.971Z - info: Using extension licensing
2018-08-24T12:24:51.252Z - info: Using extension phantom-pdf
2018-08-24T12:24:51.314Z - info: Using extension authorization
2018-08-24T12:24:51.330Z - debug: Extension authorization was disabled
2018-08-24T12:24:51.330Z - info: Using extension data
2018-08-24T12:24:51.330Z - info: Using extension resources
2018-08-24T12:24:51.345Z - info: Using extension browser-client
2018-08-24T12:24:51.345Z - debug: Extension studio is disabled, skipping
2018-08-24T12:24:51.345Z - info: Using extension scripts
2018-08-24T12:24:51.345Z - info: Using extension scheduling
2018-08-24T12:24:51.392Z - info: Using extension assets
2018-08-24T12:24:51.408Z - info: Using extension xlsx
2018-08-24T12:24:51.439Z - error: Error when loading extension SyntaxError: C:..\jsreport\node_modules\jsreport\node_modules\file-type
\index.js:2
module.exports = input => {
^^
Unexpected token =>
C:..\jsreport\node_modules\jsreport\node_modules\file-
type\index.js:2
module.exports = input => {
^^
SyntaxError: Unexpected token =>
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (C:..\jsreport\node_modules
jsreport\node_modules\jsreport-xlsx\lib\decompress.js:9:16)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (C:..\jsreport\node_modules
jsreport\node_modules\jsreport-xlsx\lib\serialize.js:31:19)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (C:...\node_modules
jsreport\node_modules\jsreport-xlsx\lib\index.js:9:18)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
2018-08-24T12:24:51.439Z - info: Using extension sample-template
2018-08-24T12:24:51.439Z - info: Using extension public-templates
2018-08-24T12:24:51.470Z - debug: Extension public-templates was disabled
2018-08-24T12:24:51.470Z - info: Initializing fs storage at C:..\jsreport\data
service jsreport-server is running. go to http://localhost:[port_number]</code>
-
Here is the error we see when restarting service
<code>
2018-08-16T23:52:13.186Z - error: Error when starting http server on port ..
Error: listen EADDRINUSE :::[port_number]
at Object.exports._errnoException (util.js:1022:11)
at exports._exceptionWithHostPort (util.js:1045:20)
at Server._listen2 (net.js:1259:14)
at listen (net.js:1295:10)
at Server.listen (net.js:1391:5)
...
</code>
-
The first error complains old node.js. Is it possible for you to update node.js to the 8.x?
It seems that a dependency somewhere deep down requires it.
-
Our reporting services depend on jsreport. If we update the version, is it going to impact the existing templates or functionality?
-
It should work the same with the node 8.x as with the older node.
However your jsreport version is quite old so not 100% sure.
The best would be to try it out on your test environment.