FlowFuse tries to start the same Node-RED instance more than once which results in a crash loop
- Dominant language
- JavaScript
- Stars
- 400
- Forks
- 89
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 149
Description
### Current Behavior
```
18/02/2025 21:04:11 [system] Node-RED exited rc=1 signal=null
18/02/2025 21:04:11 [system] Node-RED unexpectedly stopped after: 9s
18/02/2025 21:04:11 [system] Starting Node-RED
18/02/2025 21:04:11 [system] Starting health check monitor (7.5s)
18/02/2025 21:04:13 [info] Welcome to Node-RED
===================
18/02/2025 21:04:13 [info] Node-RED version: v3.1.15
18/02/2025 21:04:13 [info] Node.js version: v18.20.5
18/02/2025 21:04:13 [info] Linux 5.10.230-223.885.amzn2.aarch64 arm64 LE
18/02/2025 21:04:14 [info] Loading palette nodes
18/02/2025 21:04:15 [info] FlowFuse Assistant Plugin loaded
18/02/2025 21:04:15 [info] FlowFuse HTTP Authentication Plugin loaded
18/02/2025 21:04:15 [info] FlowFuse Team Library Plugin loaded
18/02/2025 21:04:15 [info] FlowFuse Light Theme Plugin loaded
18/02/2025 21:04:15 [info] FlowFuse Dark Theme Plugin loaded
18/02/2025 21:04:15 [info] FlowFuse Metrics Plugin loaded
18/02/2025 21:04:19 [] spawnSync locale ENOENT
18/02/2025 21:04:20 [warn] ------------------------------------------------------
18/02/2025 21:04:20 [warn] [@flowfuse/nr-file-nodes/file] 'file in' already registered by module node-red
18/02/2025 21:04:20 [warn] ------------------------------------------------------
18/02/2025 21:04:20 [info] Settings file : /data/settings.js
18/02/2025 21:04:20 [info] Context store : 'memory' [module=memory]
18/02/2025 21:04:20 [info] Context store : 'persistent' [module=custom]
18/02/2025 21:04:20 [error] Unable to listen on http://127.0.0.1:1880/
18/02/2025 21:04:20 [error] Error: port in use
18/02/2025 21:04:20 [system] Node-RED exited rc=1 signal=null
18/02/2025 21:04:20 [system] Node-RED unexpectedly stopped after: 10s
18/02/2025 21:04:20 [system] Node-RED restart loop detected whilst in safe mode. Stopping.
18/02/2025 21:32:37 [info] Disconnected yX7adHFbYk3nAASyAAAB due to transport error
18/02/2025 21:33:01 [system] Stopping Node-RED
18/02/2025 21:33:11 [system] Node-RED stop timed-out. Sending SIGKILL
```
### Expected Behavior
No matter what a user clicks in the interface, they should not be able to get an instance into this state.
### Steps To Reproduce
We (actually @hardillb) speculated that this might be possible if the restart / start button is pressed at exactly the right time more than once.
That should not be possible.
### Environment
- FlowFuse version:
- Node.js version:
- npm version:
- Platform/OS:
- Browser:
### Have you provided an initial effort estimate for this issue?
I have provided an initial effort estimate
Contributor guide
Research direction
No source file or test is named. Start by tracing the interface handlers for the start and restart buttons and the Node-RED process lifecycle, then reproduce the problem with repeated clicks at startup. Done means user actions cannot launch duplicate instances or leave the instance in a port-conflict crash loop.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- backend, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100