Closed nadavye closed 5 years ago
Please note that when istanbul was used (without nyc) everything worked correctly. I assume it is related to 'spawn-wrap'?
spawn-wrap would be my first suspect as well. I've never seen it used in clusters.
I would try implementing a no-op spawn-wrap wrapper, and use it to wrap some trivial cluster implementation. If stuff breaks, we know this needs to be fixed up stream
@jamestalmage - thanks for your answer. So basically, you suggest that I'll implement the no-op spawn, replace the module in the node_modules so nyc will pick it up and try to run the cluster?
@nadavye @jamestalmage If you isolate the problem to spawn-wrap
, I'd be happy to introduce a --no-spawn-wrap
flag to nyc that disables it for you; just let me know where you ended up debugging this issue.
HI, Attached a reproduction of this issue and logs of pm2. when i run 'pm2 start config.sh' I get this error, but when I run 'nyc server.js' there is no error. log `PM2 | [2018-05-27 11:53:13] PM2 log: Node.js version : 8.10.0 PM2 | [2018-05-27 11:53:13] PM2 log: Current arch : x64 PM2 | [2018-05-27 11:53:13] PM2 log: PM2 home : /home/roni/.pm2 PM2 | [2018-05-27 11:53:13] PM2 log: PM2 PID file : /home/roni/.pm2/pm2.pid PM2 | [2018-05-27 11:53:13] PM2 log: RPC socket file : /home/roni/.pm2/rpc.sock PM2 | [2018-05-27 11:53:13] PM2 log: BUS socket file : /home/roni/.pm2/pub.sock PM2 | [2018-05-27 11:53:13] PM2 log: Application log path : /home/roni/.pm2/logs PM2 | [2018-05-27 11:53:13] PM2 log: Process dump file : /home/roni/.pm2/dump.pm2 PM2 | [2018-05-27 11:53:13] PM2 log: Concurrent actions : 2 PM2 | [2018-05-27 11:53:13] PM2 log: SIGTERM timeout : 1600 PM2 | [2018-05-27 11:53:13] PM2 log: =============================================================================== PM2 | [2018-05-27 11:53:24] PM2 log: Starting execution sequence in -cluster mode- for app name:hello-world id:0 PM2 | [2018-05-27 11:53:25] PM2 log: App name:hello-world id:0 online PM2 | [2018-05-27 11:53:25] PM2 error: (node:7657) [DEP0007] DeprecationWarning: worker.suicide is deprecated. Please use worker.exitedAfterDisconnect. PM2 | Server running at http://127.0.0.1:1337/
/home/roni/.pm2/logs/hello-world-error-0.log last 15 lines:
0|hello-wo | at Module._compile (module.js:652:30)
0|hello-wo | at Object.Module._extensions..js (module.js:663:10)
0|hello-wo | at Module.load (module.js:565:32)
0|hello-wo | at tryModuleLoad (module.js:505:12)
0|hello-wo | Error: spawn EACCES
0|hello-wo | at _errnoException (util.js:1022:11)
0|hello-wo | at ChildProcess.spawn (internal/child_process.js:323:11)
0|hello-wo | at ChildProcess.wrappedSpawn [as spawn] (/home/roni/projects/nodejs-hello-world/node_modules/nyc/node_modules/spawn-wrap/index.js:91:15)
0|hello-wo | at exports.spawn (child_process.js:502:9)
0|hello-wo | at module.exports (/home/roni/projects/nodejs-hello-world/node_modules/nyc/node_modules/foreground-child/index.js:39:15)
0|hello-wo | at Object.
/home/roni/.pm2/logs/hello-world-out-0.log last 15 lines: 0|hello-wo | File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | 0|hello-wo | ----------|----------|----------|----------|----------|-------------------| 0|hello-wo | All files | 0 | 0 | 0 | 0 | | 0|hello-wo | ----------|----------|----------|----------|----------|-------------------| 0|hello-wo | ----------|----------|----------|----------|----------|-------------------| 0|hello-wo | File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | 0|hello-wo | ----------|----------|----------|----------|----------|-------------------| 0|hello-wo | All files | 0 | 0 | 0 | 0 | | 0|hello-wo | ----------|----------|----------|----------|----------|-------------------| 0|hello-wo | -----------|----------|----------|----------|----------|-------------------| 0|hello-wo | File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | 0|hello-wo | -----------|----------|----------|----------|----------|-------------------| 0|hello-wo | All files | 17.65 | 0 | 0 | 17.65 | | 0|hello-wo | server.js | 17.65 | 0 | 0 | 17.65 |... 23,26,27,28,29 | 0|hello-wo | -----------|----------|----------|----------|----------|-------------------| ` reproduction.zip
Hi, any chance someone looked into this?
Hi Guys, Any update on this? Have you had a chance to look at @RoniSegal reproduction?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Ping
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Guys, is there a chance to get some info about how to add this flag? Which area should be modified? It will allow us to try and resolve that by ourselves.
Please use the template provided below, when reporting bugs:
Here in Sealights, we develop a SAAS quality dashboard that shows among the rest Coverage Information for end-2-end tests.
As part of the development of our NodeJS agent, we are using NYC and we have noticed that it doesn't play well with PM2. We have issues with its Cluster Mode & Logs of the application under test.
Expected Behavior
PM2 supports "Cluster Mode" which allow several node JS processes to share the same port number. When used with NYC, it is expected that the functionallity work as useusal, meaning, allow to start few instances of the same microservice on the same network port.
In addition, when using "pm2 logs" we expect to see the logs of the application under test.
Observed Behavior
Forensic Information
Operating System: the operating system you observed the issue on. CentOS Linux release 7.2.1511 (Core)
Environment Information: information about your project's environment, see instructions below:
v6.5.0 5.0.3 @sealights/sl-cloud-api-gateway@1.0.169 /opt/sealights/node_modules/@sealights/sl-cloud-api-gateway ├── UNMET DEPENDENCY @sealights/sl-cloud-infra@^1.0.311 ├── UNMET DEPENDENCY @sealights/swagger-restify@^1.1.1 ├── UNMET DEPENDENCY @types/mongodb@^2.1.37 ├── UNMET DEPENDENCY @types/mongoose@^4.7.3 ├── UNMET DEPENDENCY columnify@^1.5.4 ├── UNMET DEPENDENCY jsonwebtoken@^7.1.7 ├── UNMET DEPENDENCY jwk-to-pem@^1.2.6 ├── UNMET DEPENDENCY md5@^2.2.1 ├── UNMET DEPENDENCY on-finished@^2.3.0 ├── UNMET DEPENDENCY on-headers@^1.0.1 ├── UNMET DEPENDENCY request@^2.74.0 ├── UNMET DEPENDENCY restify@^4.0.3 └── UNMET DEPENDENCY restify-jwt@^0.4.0