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

connect EAGAIN /home/user/.pm2/rpc.sock #5969

Open
webhype opened this issue Mar 28, 2025 · 0 comments
Open

connect EAGAIN /home/user/.pm2/rpc.sock #5969

webhype opened this issue Mar 28, 2025 · 0 comments

Comments

@webhype
Copy link

webhype commented Mar 28, 2025

Under high load (lots of apps running, like 250, each eating 50 - 60 MB of memory on a 128 GB Ubuntu 22.04 box, with 128 GB VM), this happens almost daily when issuing pm2 list or any other pm2 command:

connect EAGAIN /home/user/.pm2/rpc.sock
node:events:497
      throw er; // Unhandled 'error' event
      ^

Error: connect EAGAIN /home/user/.pm2/rpc.sock
    at PipeConnectWrap.afterConnect [as oncomplete] (node:net:1607:16)
Emitted 'error' event on ReqSocket instance at:
    at Socket.<anonymous> (/usr/local/lib/node_modules/pm2/node_modules/pm2-axon/lib/sockets/sock.js:201:49)
    at Socket.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -11,
  code: 'EAGAIN',
  syscall: 'connect',
  address: '/home/user/.pm2/rpc.sock'
}

Node.js v20.17.0

After that the pm2 list "disappears", somehow the processes still run in an unattached "zombie" state and do their thing, but the connection to the pm2 command line app is broken until I issue pm2 update which sometimes re-links them, and sometimes not, so all I can do to get control of my apps again is kill -9 them, kill PM2 God Process (of which there are strangely multiple, is that expected?), kill everything like Kylo Ren. Sometimes rm -rf ~/.pm2 also helps but the zombie processes often are still there and keep resurrecting.

I mean perhaps the system is overwhelmed by launching so many apps, but all exceptions should be caught and handled gracefully, right?

Otherwise great software, I don't know what I'd do without it. That's what makes this so difficult!

@webhype webhype changed the title connect EAGAIN /home/tmbot1/.pm2/rpc.sock connect EAGAIN /home/user/.pm2/rpc.sock Mar 28, 2025
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

1 participant