Unitech / Unitech/pm2

Got error while trying to bind Error: listen EINVAL: invalid argument /home/.../.pm2/pub.sock

Open
#5,386 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
43.3k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

What's going wrong?

Pm2 not launched when used as a dependency with package.json (cloud provider).
It looks like this issue but both /home/hosting-user/.pm2 and ../node_modules/pm are owned by hosting-user.

What am I missing ?

Log in node :

Found a start script in your `package.json` file.
[PM2] Spawning PM2 daemon with pm2_home=/home/hosting-user/.pm2

Debian 9.13
Node v14.19.3
Pm2 ^5.2.0 in package.json but couldn't have anything from command >pm2 -v

Supporting information

$ pm2 report
[PM2] Spawning PM2 daemon with pm2_home=/home/hosting-user/.pm2

$ DEBUG=* pm2 list
  pm2:paths pm2 home resolved to /home/hosting-user/.pm2 /home/hosting-user +0ms
  pm2:conf Using 2 parallelism (CONCURRENT_ACTIONS) +0ms
  pm2:client Using RPC file /home/hosting-user/.pm2/rpc.sock +0ms
  pm2:client Using PUB file /home/hosting-user/.pm2/pub.sock +0ms
  interactor:client [PING INTERACTOR] Trying to connect to Interactor daemon +0ms
  axon:sock connect attempt null:/home/hosting-user/.pm2/interactor.sock +0ms
  pm2:client [PING PM2] Trying to connect to server +5ms
  axon:sock connect attempt null:/home/hosting-user/.pm2/rpc.sock +2ms
  axon:sock error ENOENT +4ms
  axon:sock ignored ENOENT +1ms
  axon:sock error ENOENT +0ms
  axon:sock ignored ENOENT +0ms
  axon:sock attempting reconnect +103ms
  axon:sock closing +0ms
  axon:sock closing 0 connections +1ms
  pm2:client Daemon not launched +109ms
  axon:sock connect attempt null:/home/hosting-user/.pm2/rpc.sock +0ms
[PM2] Spawning PM2 daemon with pm2_home=/home/hosting-user/.pm2
  axon:sock attempting reconnect +11ms
  axon:sock closing +0ms
  axon:sock closing 0 connections +0ms
  interactor:client Interactor Daemon not launched +124ms
  axon:sock connect attempt null:/home/hosting-user/.pm2/interactor.sock +0ms
  axon:sock error ENOENT +1ms
  axon:sock ignored ENOENT +0ms
  axon:sock error ENOENT +0ms
  axon:sock ignored ENOENT +0ms

In pm2/log :

pm2:paths pm2 home resolved to /home/hosting-user/.pm2 /home/hosting-user
pm2:conf Using 2 parallelism (CONCURRENT_ACTIONS)
axon:sock bind null:/home/hosting-user/.pm2/pub.sock
axon:sock bind null:/home/hosting-user/.pm2/rpc.sock
axon:sock Got error while trying to bind Error: listen EINVAL: invalid argument /home/hosting-user/.pm2/pub.sock
    at Server.setupListenHandle [as _listen2] (net.js:1314:21)
    at listenInCluster (net.js:1379:12)
    at Server.listen (net.js:1476:5)
    at PubSocket.Socket.bind (/srv/data/web/vhosts/default/node_modules/pm2-axon/lib/sockets/sock.js:413:15)
    at module.exports.Daemon.innerStart (/srv/data/web/vhosts/default/node_modules/pm2/lib/Daemon.js:104:30)
    at Domain.<anonymous> (/srv/data/web/vhosts/default/node_modules/pm2/lib/Daemon.js:63:10)
    at Domain.run (domain.js:378:15)
    at module.exports.Daemon.start (/srv/data/web/vhosts/default/node_modules/pm2/lib/Daemon.js:62:5)
    at Object.<anonymous> (/srv/data/web/vhosts/default/node_modules/pm2/lib/Daemon.js:454:10)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the dependency-based launch on Debian 9 with Node v14, then trace the reported path through node_modules/pm2-axon/lib/sockets/sock.js and pm2/lib/Daemon.js. Done means identifying the cause of the EINVAL socket bind failure and verifying a reliable launch behavior or documented workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.