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

Quitting device agent after failed node-red start is not possible #251

Closed
Steve-Mcl opened this issue Apr 12, 2024 · 2 comments · Fixed by #252
Closed

Quitting device agent after failed node-red start is not possible #251

Steve-Mcl opened this issue Apr 12, 2024 · 2 comments · Fixed by #252
Assignees
Labels
needs-triage Needs looking at to decide what to do

Comments

@Steve-Mcl
Copy link
Contributor

Current Behavior

When a node-red start up issue occurs (restart loop), exiting via CTRL-C did not quit the agent.

C:\Users\Stephen>flowfuse-device-agent
[AGENT] 12/04/2024 11:21:12 [info] FlowFuse Device Agent
[AGENT] 12/04/2024 11:21:12 [info] ----------------------
[AGENT] 12/04/2024 11:21:12 [info] Agent starting...
[AGENT] 12/04/2024 11:21:12 [info] Version: 2.3.1
[AGENT] 12/04/2024 11:21:12 [info] Mode: Device Mode
[AGENT] 12/04/2024 11:21:12 [info] Device: LlxGYqVarE
[AGENT] 12/04/2024 11:21:12 [info] ForgeURL: https://forge.flowfuse.dev
[AGENT] 12/04/2024 11:21:12 [info] Starting MQTT heartbeat thread. Interval: 30s (±5s)
[AGENT] 12/04/2024 11:21:12 [info] MQTT connected
[AGENT] 12/04/2024 11:21:12 [info] License enabled
[AGENT] 12/04/2024 11:21:12 [info] Enabling developer mode
[AGENT] 12/04/2024 11:21:12 [info] Developer Mode: no flows found - updating to latest snapshot
[AGENT] 12/04/2024 11:21:13 [info] Launching with new settings...
[AGENT] 12/04/2024 11:21:13 [info] Configuration :-
[AGENT] 12/04/2024 11:21:13 [info]   * Application        : g17Pk5LmEk
[AGENT] 12/04/2024 11:21:13 [info]   * Snapshot           : none
[AGENT] 12/04/2024 11:21:13 [info]   * Settings           : 293a4dd6cd619dd0b2dc80470c25b5157f7edf3180405fdde43199c1669ced91
[AGENT] 12/04/2024 11:21:13 [info]   * Operation Mode     : developer
[AGENT] 12/04/2024 11:21:13 [info]   * Target State       : running
[AGENT] 12/04/2024 11:21:13 [info]   * Licensed           : yes
[AGENT] 12/04/2024 11:21:13 [info] Environment :-
[AGENT] 12/04/2024 11:21:13 [info]   * FF_DEVICE_ID       : LlxGYqVarE
[AGENT] 12/04/2024 11:21:13 [info]   * FF_DEVICE_NAME     : Device 1
[AGENT] 12/04/2024 11:21:13 [info]   * FF_DEVICE_TYPE     : Latest Agent 1.12-git
[AGENT] 12/04/2024 11:21:13 [info]   * FF_APPLICATION_ID  : g17Pk5LmEk
[AGENT] 12/04/2024 11:21:13 [info]   * FF_APPLICATION_NAME: Grey's Test area
[AGENT] 12/04/2024 11:21:13 [info]   * FF_SNAPSHOT_ID     : LoWNR74Pl0
[AGENT] 12/04/2024 11:21:13 [info]   * FF_SNAPSHOT_NAME   : with project nodes
[AGENT] 12/04/2024 11:21:13 [info] Updating configuration files
[AGENT] 12/04/2024 11:21:13 [info] Installing dependencies
[AGENT] 12/04/2024 11:21:37 [info] Updating theme files
[AGENT] 12/04/2024 11:21:37 [info] Starting Node-RED
[NR] 12/04/2024 11:21:38 [info]

Welcome to Node-RED
===================

[NR] 12/04/2024 11:21:38 [info] Node-RED version: v3.1.7
[NR] 12/04/2024 11:21:38 [info] Node.js  version: v18.20.2
[NR] 12/04/2024 11:21:38 [info] Windows_NT 10.0.22631 x64 LE
[NR] 12/04/2024 11:21:38 [error] Failed to start server:
[NR] 12/04/2024 11:21:38 [error] Error: spawn EINVAL
    at ChildProcess.spawn (node:internal/child_process:414:11)
    at spawn (node:child_process:761:9)
    at Object.execFile (node:child_process:351:17)
    at C:\opt\flowfuse-device\project\node_modules\@node-red\registry\lib\installer.js:581:27
    at new Promise (<anonymous>)
    at Object.checkPrereq (C:\opt\flowfuse-device\project\node_modules\@node-red\registry\lib\installer.js:580:16)
    at Object.load (C:\opt\flowfuse-device\project\node_modules\@node-red\registry\lib\index.js:59:22)
    at C:\opt\flowfuse-device\project\node_modules\@node-red\runtime\lib\index.js:162:29
[AGENT] 12/04/2024 11:21:38 [info] Node-RED stopped unexpectedly - restarting
[AGENT] 12/04/2024 11:21:38 [info] Starting Node-RED
[NR] 12/04/2024 11:21:39 [info]

<< SNIP FOR BREVETY >>

Welcome to Node-RED
===================

[NR] 12/04/2024 11:21:41 [info] Node-RED version: v3.1.7
[NR] 12/04/2024 11:21:41 [info] Node.js  version: v18.20.2
[NR] 12/04/2024 11:21:41 [info] Windows_NT 10.0.22631 x64 LE
[NR] 12/04/2024 11:21:41 [error] Failed to start server:
[NR] 12/04/2024 11:21:41 [error] Error: spawn EINVAL
    at ChildProcess.spawn (node:internal/child_process:414:11)
    at spawn (node:child_process:761:9)
    at Object.execFile (node:child_process:351:17)
    at C:\opt\flowfuse-device\project\node_modules\@node-red\registry\lib\installer.js:581:27
    at new Promise (<anonymous>)
    at Object.checkPrereq (C:\opt\flowfuse-device\project\node_modules\@node-red\registry\lib\installer.js:580:16)
    at Object.load (C:\opt\flowfuse-device\project\node_modules\@node-red\registry\lib\index.js:59:22)
    at C:\opt\flowfuse-device\project\node_modules\@node-red\runtime\lib\index.js:162:29
[AGENT] 12/04/2024 11:21:41 [info] Node-RED restart loop detected - stopping
[AGENT] 12/04/2024 11:24:22 [info] Stopping Node-RED. Reason: shutdown
[AGENT] 12/04/2024 11:24:22 [info] Stopping Node-RED. Reason: shutdown
[AGENT] 12/04/2024 11:24:32 [system] Node-RED stop timed-out. Sending SIGKILL
Node-RED stop timed-out. Sending SIGKILL

Line [AGENT] 12/04/2024 11:24:22 [info] Stopping Node-RED. Reason: shutdown is in response to a CTRL-C in the console

Expected Behavior

Should quit on CTRL-C signal

Steps To Reproduce

On windows, cause node-red to fail to start, operate CTRL-C

Environment

  • FlowFuse version: NA
  • Node.js version: 18
  • npm version: 10
  • Platform/OS: Windows
  • Browser: NA
@Steve-Mcl Steve-Mcl added the needs-triage Needs looking at to decide what to do label Apr 12, 2024
@Steve-Mcl Steve-Mcl moved this to In Progress in 🛠 Development Apr 15, 2024
@Steve-Mcl Steve-Mcl self-assigned this Apr 15, 2024
@Steve-Mcl Steve-Mcl moved this from In Progress to Review in 🛠 Development Apr 15, 2024
@Steve-Mcl Steve-Mcl moved this from Review to Needs Verification in 🛠 Development Apr 16, 2024
@joepavitt
Copy link
Contributor

@Steve-Mcl can we mark this as "Done" now?

@Steve-Mcl
Copy link
Contributor Author

yeah, been out in the wild for a couple of weeks & has been thoroughly tested on win + *nix by Ben.

@joepavitt joepavitt moved this from Needs Verification to Done in 🛠 Development Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Needs looking at to decide what to do
Projects
Status: Closed / Done
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants