Unitech / pm2

Node.js Production Process Manager with a built-in Load Balancer.
https://pm2.keymetrics.io/docs/usage/quick-start/
Other
41.34k stars 2.61k forks source link

rpc.sock ENOENT (No such file or directory) #5211

Open Ekhrapykin opened 2 years ago

Ekhrapykin commented 2 years ago

What's going wrong?

Running upgrade via ansible:

- name: install latest pm2 package
  command: npm install pm2@latest -g

- name: update im-memory version PM2
  command: pm2 updatePM2

Process just stuck. If run it manually it works fine. Trace report:

epoll_wait(13, [], 1024, 0)             = 0
epoll_wait(13, [], 1024, 0)             = 0
epoll_wait(13, [], 1024, 5000)          = 0
socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 20
connect(20, {sa_family=AF_UNIX, sun_path="/home/rig/.pm2/rpc.sock"}, 110) = -1 ENOENT (No such file or directory)
socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 21
connect(21, {sa_family=AF_UNIX, sun_path="/home/rig/.pm2/rpc.sock"}, 110) = -1 ENOENT (No such file or directory)
epoll_ctl(13, EPOLL_CTL_DEL, 20, 0x7fff52d93be4) = -1 ENOENT (No such file or directory)
close(20)                               = 0
epoll_ctl(13, EPOLL_CTL_DEL, 21, 0x7fff52d93be4) = -1 ENOENT (No such file or directory)
close(21)                               = 0

Supporting information

$ pm2 report
rig@test-tool-pi:~$ pm2 report
[PM2] Spawning PM2 daemon with pm2_home=/home/rig/.pm2
[PM2] PM2 Successfully daemonized
[PM2][Module] Starting NPM module pm2-logrotate
[PM2][WARN] Applications pm2-logrotate not running, starting...
[PM2] App [pm2-logrotate] launched (1 instances)

--- PM2 report ----------------------------------------------------------------
Date                 : Tue Oct 26 2021 02:21:51 GMT+0000 (Coordinated Universal Time)
===============================================================================
--- Daemon -------------------------------------------------
pm2d version         : 5.1.2
node version         : 14.18.1
node path            : /home/rig/n/bin/pm2
argv                 : /home/rig/n/bin/node,/home/rig/n/lib/node_modules/pm2/lib/Daemon.js
argv0                : node
user                 : rig
uid                  : 1001
gid                  : 100
uptime               : 0min
===============================================================================
--- CLI ----------------------------------------------------
local pm2            : 5.1.2
node version         : 14.18.1
node path            : /home/rig/n/bin/pm2
argv                 : /home/rig/n/bin/node,/home/rig/n/bin/pm2,report
argv0                : node
user                 : rig
uid                  : 1001
gid                  : 100
===============================================================================
--- System info --------------------------------------------
arch                 : x64
platform             : linux
type                 : Linux
cpus                 : Intel(R) Xeon(R) E-2246G CPU @ 3.60GHz
cpus nb              : 2
freemem              : 293965824
totalmem             : 1008898048
home                 : /home/rig
===============================================================================
--- PM2 list -----------------------------------------------
┌─────┬──────────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id  │ name             │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
└─────┴──────────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
Module
┌────┬──────────────────────────────┬───────────────┬──────────┬──────────┬──────┬──────────┬──────────┬──────────┐
│ id │ module                       │ version       │ pid      │ status   │ ↺    │ cpu      │ mem      │ user     │
├────┼──────────────────────────────┼───────────────┼──────────┼──────────┼──────┼──────────┼──────────┼──────────┤
│ 0  │ pm2-logrotate                │ 2.7.0         │ 12315    │ online   │ 0    │ 0%       │ 25.8mb   │ rig      │
└────┴──────────────────────────────┴───────────────┴──────────┴──────────┴──────┴──────────┴──────────┴──────────┘
===============================================================================
--- Daemon logs --------------------------------------------
/home/rig/.pm2/pm2.log last 20 lines:
PM2        | 2021-10-26T02:15:14: PM2 log: pid=12176 msg=process killed
PM2        | 2021-10-26T02:15:14: PM2 log: PM2 successfully stopped
PM2        | 2021-10-26T02:21:51: PM2 log: ===============================================================================
PM2        | 2021-10-26T02:21:51: PM2 log: --- New PM2 Daemon started ----------------------------------------------------
PM2        | 2021-10-26T02:21:51: PM2 log: Time                 : Tue Oct 26 2021 02:21:51 GMT+0000 (Coordinated Universal Time)
PM2        | 2021-10-26T02:21:51: PM2 log: PM2 version          : 5.1.2
PM2        | 2021-10-26T02:21:51: PM2 log: Node.js version      : 14.18.1
PM2        | 2021-10-26T02:21:51: PM2 log: Current arch         : x64
PM2        | 2021-10-26T02:21:51: PM2 log: PM2 home             : /home/rig/.pm2
PM2        | 2021-10-26T02:21:51: PM2 log: PM2 PID file         : /home/rig/.pm2/pm2.pid
PM2        | 2021-10-26T02:21:51: PM2 log: RPC socket file      : /home/rig/.pm2/rpc.sock
PM2        | 2021-10-26T02:21:51: PM2 log: BUS socket file      : /home/rig/.pm2/pub.sock
PM2        | 2021-10-26T02:21:51: PM2 log: Application log path : /home/rig/.pm2/logs
PM2        | 2021-10-26T02:21:51: PM2 log: Worker Interval      : 30000
PM2        | 2021-10-26T02:21:51: PM2 log: Process dump file    : /home/rig/.pm2/dump.pm2
PM2        | 2021-10-26T02:21:51: PM2 log: Concurrent actions   : 2
PM2        | 2021-10-26T02:21:51: PM2 log: SIGTERM timeout      : 1600
PM2        | 2021-10-26T02:21:51: PM2 log: ===============================================================================
PM2        | 2021-10-26T02:21:51: PM2 log: App [pm2-logrotate:0] starting in -fork mode-
PM2        | 2021-10-26T02:21:51: PM2 log: App [pm2-logrotate:0] online
sarvalabs-sai commented 1 month ago

Any luck with this issue @Ekhrapykin?. i couldn't find rpc.sock file in ~/.pm2 which prevents me from using pm2