Application has thrown an uncaught exception and is terminated
nwabdou85 opened this issue · comments
I've a serious problem with this package; it's stop some code from execution and when I remove it , all it's ok; this is the error I ve in the console
Monti APM: completed instrumenting the app
Monti APM: Successfully connected
Mon Jul 09 2018 21:00:32 GMT+0000 (Coordinated Universal Time): Application has thrown an uncaught exception and is terminated:
Error: spawn EPERM
at _errnoException (util.js:1022:11)
at ChildProcess.spawn (internal/child_process.js:323:11)
at exports.spawn (child_process.js:502:9)
at Object.win (D:\home\site\wwwroot\programs\server\npm\node_modules\meteor\montiapm_agent\node_modules\pidusage\lib\stats.js:123:18)
at Object. (D:\home\site\wwwroot\programs\server\npm\node_modules\meteor\montiapm_agent\node_modules\pidusage\index.js:14:28)
at Object.exports.stat (D:\home\site\wwwroot\programs\server\npm\node_modules\meteor\montiapm_agent\node_modules\pidusage\index.js:37:20)
at SystemModel.usageLookup (packages\meteor.js:258:21)
at SystemModel.getUsage (packages\montiapm_agent.js:1999:20)
at SystemModel.buildPayload (packages\montiapm_agent.js:1983:20)
at Object.Kadira._buildPayload (packages\montiapm_agent.js:2406:42)
at packages\montiapm_agent.js:2452:26
How can I fix that ?
Thank's
On windows, the user running the app needs to be able to run wmic
. It is used to get the app's cpu usage.
This package should handle the error and show a warning that it is unable to get the app's cpu usage. Also, node 6 added process.cpuUsage
which we could look into using instead when available.
@zodern So, what the solution ?? the package still prevent some code from running
Thank's
This is fixed in version 2.32.2. Instead of crashing the app, it will show a message in the logs, and the memory and cpu usage will show as 0 in the Monti APM UI.
The command that is failing is:
wmic PROCESS where ProcessId=<insert app PID> get CreationDate,KernelModeTime,ParentProcessId,ProcessId,UserModeTime,WorkingSetSize
You can try running it to see why it is failing. Remember to insert the PID of the app in the command.
Once soyuka/pidusage#63 is implemented it will be able to get the cpu and memory usage in Meteor 1.6 and newer without using wmic
.