-
Notifications
You must be signed in to change notification settings - Fork 54
Desktop App: Daemon crashes on startup (exit code 1) - liveness-fd pipe closes prematurely on Windows #850
Description
Environment
- OS: Windows 10 (10.0.26100)
- Factory Desktop: v0.41.0 (also reproduced on v0.40.0)
- Droid binary: v0.86.0
- CLI droid: v0.86.0 (works fine)
Symptom
The desktop app spawns the daemon with:
droid.exe daemon --droid-path <path> --enable-code-server --remote-access --liveness-fd 3
The daemon crashes with exit code 1 within 6-8 seconds of spawning. The desktop retries 3 times then gives up with "Crashed too many times, giving up".
The desktop app UI loads but shows no active daemon/sessions.
Root Cause Analysis
-
Daemon works perfectly when run manually:
droid.exe daemon --debug --port 9999 --enable-code-server --remote-accessStarts and stays running indefinitely with full WebSocket connectivity.
-
The
--liveness-fd 3flag is the trigger. When tested with--liveness-fd 0(stdin), the daemon starts successfully but shuts down immediately when the pipe closes -- confirming fd monitoring logic works correctly. -
The desktop app's liveness pipe on fd 3 appears to close prematurely, causing the daemon to detect parent disconnect and exit.
-
No port conflicts -- port 8080 is free, no stale processes blocking.
-
No antivirus interference detected.
-
Daemon produces zero stderr/stdout when crashing via desktop, making diagnosis difficult.
Logs
From %APPDATA%\Factory\logs\desktop-droid.log:
[2026-03-26T01:25:17.179Z] INFO: [daemon] Starting daemon
[2026-03-26T01:25:17.216Z] INFO: [daemon] Process spawned | pid: 101256
[2026-03-26T01:25:19.234Z] WARN: [daemon] Health check failed | attempt: 1
[2026-03-26T01:25:21.241Z] WARN: [daemon] Health check failed | attempt: 2
[2026-03-26T01:25:23.401Z] WARN: [daemon] Exited unexpectedly | code: 1
[2026-03-26T01:25:23.401Z] INFO: [daemon] Scheduling restart | attempt: 1
... (repeats 3 times, then gives up)
Workaround
The droid CLI from the terminal works fine -- only the desktop app daemon launch is broken.
Steps to Reproduce
- Install Factory Desktop v0.41.0 on Windows 10
- Launch the desktop app
- Observe daemon crash loop in
desktop-droid.log - Confirm daemon works standalone:
droid.exe daemon --debug --port 9999