Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pm2 cluster.js assertionError on node v0.11.14 #818

Closed
pedrofranceschi opened this issue Nov 14, 2014 · 9 comments
Closed

pm2 cluster.js assertionError on node v0.11.14 #818

pedrofranceschi opened this issue Nov 14, 2014 · 9 comments

Comments

@pedrofranceschi
Copy link

I'm running a process using pm2 0.11.1, node v0.11.14 and the following command:

pm2 start bin/server.js --name api --merge-logs -i max -e /home/deploy/logs/stderr.log -o /home/deploy/logs/stdout.log -- -p 8000

But after sending a request to port 8000, pm2 and the server.js dies and I get the following log when running pm2 logs api:

[PM2] [[[[ PM2/God daemon launched ]]]]
[PM2] BUS system [READY] on port /home/deploy/.pm2/pub.sock
[PM2] RPC interface [READY] on port /home/deploy/.pm2/rpc.sock
[PM2] Starting execution sequence in -cluster mode- for app name:api id:0
[PM2] App name:api id:0 online
[PM2] AssertionError: false == true
[PM2]     at SharedHandle.add (cluster.js:97:3)
[PM2]     at queryServer (cluster.js:461:12)
[PM2]     at Worker.onmessage (cluster.js:419:7)
[PM2]     at ChildProcess.<anonymous> (cluster.js:673:8)
[PM2]     at ChildProcess.emit (events.js:129:20)
[PM2]     at handleMessage (child_process.js:323:10)
[PM2]     at Pipe.channel.onread (child_process.js:351:11)
[PM2] [[[[ PM2/God daemon launched ]]]]
[PM2] BUS system [READY] on port /home/deploy/.pm2/pub.sock
[PM2] RPC interface [READY] on port /home/deploy/.pm2/rpc.sock

Any ideas about how to solve this issue?

Thanks!

@pedrofranceschi
Copy link
Author

Apparently PM2 daemon is dying:

deploy@api-prod-test:~/api$ pm2 status
┌──────────┬────┬─────────┬──────┬────────┬───────────┬────────┬─────────────┬──────────┐
│ App name │ id │ mode    │ PID  │ status │ restarted │ uptime │      memory │ watching │
├──────────┼────┼─────────┼──────┼────────┼───────────┼────────┼─────────────┼──────────┤
│ api      │ 0  │ cluster │ 1454 │ online │         0 │ 8s     │ 91.160 MB   │ disabled │
└──────────┴────┴─────────┴──────┴────────┴───────────┴────────┴─────────────┴──────────┘
 Use `pm2 desc[ribe] <id>` to get more details

... server (port 8000) gets a request ...

deploy@api-prod-test:~/api$ pm2 status
[PM2] Spawning PM2 daemon
[PM2] Success
┌──────────┬────┬──────┬─────┬────────┬───────────┬────────┬────────┬──────────┐
│ App name │ id │ mode │ PID │ status │ restarted │ uptime │ memory │ watching │
└──────────┴────┴──────┴─────┴────────┴───────────┴────────┴────────┴──────────┘
 Use `pm2 desc[ribe] <id>` to get more details

@Unitech
Copy link
Owner

Unitech commented Nov 14, 2014

Can you show me what you're app do?

Use fork mode to temporarily fix this

@pedrofranceschi
Copy link
Author

Nothing special, just an express app with app.listen(port);

Sent from my iPhone

On Fri, Nov 14, 2014 at 8:36 PM, Alexandre Strzelewicz
notifications@github.com wrote:

Can you show me what you're app do?

Use fork mode to temporarily fix this

Reply to this email directly or view it on GitHub:
#818 (comment)

@pedrofranceschi
Copy link
Author

Also, I'm running on Ubuntu 14.04 (server). On Mac OS X Yosemite it's working fine.

@pedrofranceschi
Copy link
Author

This error happened when using fork mode:

[PM2] TypeError: Cannot read property 'repo_path' of null
[PM2]     at /usr/local/lib/node_modules/pm2/lib/Worker.js:20:64
[PM2]     at /usr/local/lib/node_modules/pm2/node_modules/vizion/lib/git.js:106:12
[PM2]     at /usr/local/lib/node_modules/pm2/node_modules/vizion/lib/git.js:98:14
[PM2]     at Object.oncomplete (fs.js:93:15)
[PM2] [PM2] WORKER STARTED with refreshing interval: 30000
[PM2] [[[[ PM2/God daemon launched ]]]]

@greenboxal
Copy link

The issue with the fork mode seems to be real. As for the cluster mode, the issue is with the cluster module and client UDP sockets.
We're tracking this on nodejs/node-v0.x-archive#8195.

@Unitech
Copy link
Owner

Unitech commented Nov 16, 2014

The repo_path issue has been fixed via 2ff51d6

$ npm install git://github.com/Unitech/pm2#master -g

Could you please try it and tell me if it's ok now?
Thanks

@greenboxal
Copy link

Fork mode works fine now.
I think you can close this issue as the cluster module of node 0.11.x is to blame.

@Unitech
Copy link
Owner

Unitech commented Nov 16, 2014

Thanks for your fast feedback. I also have this bug with cluster and UDP, hope it's gonna be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants