Port address already in use error.
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 43.3k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
I'm reading the documentation but can not find what requirements does an application need to meet in order to be managed by PM2 in cluster mode?
I'm trying to run 'gatsby serve' in cluster mode, but when attempting to 'reload' the application, I see errors in the logs related to the port already being in use:
Error: listen EADDRINUSE: address already in use 127.0.0.1:9000
at Server.setupListenHandle [as _listen2] (node:net:1330:16)
at listenInCluster (node:net:1378:12)
at GetAddrInfoReqWrap.doListen (node:net:1516:7)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:73:8)
Emitted 'error' event on Server instance at:
at emitErrorNT (node:net:1357:8)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
code: 'EADDRINUSE',
errno: -98,
syscall: 'listen',
address: '127.0.0.1',
port: 9000
}
The application doesn't start after reload command, but PM2 shows the status as "online," which is incorrect.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing gatsby serve under PM2 cluster mode, then run a reload and inspect the reported EADDRINUSE logs alongside PM2's online status. Done means the application reloads without the port conflict, or PM2 accurately reports the failed application state.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100