-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
Summary
When the Happier daemon starts before DNS is available (e.g., at system boot), machine registration fails with EAI_AGAIN and the daemon continues running without ever retrying registration. This means the machine is invisible to the server and remote session creation from the phone doesn't work — until the daemon is manually restarted.
Steps to Reproduce
- Have
happier daemon startrun at system boot (e.g., via systemd or as part of shell profile) - If the daemon process starts before the network/DNS is fully ready, registration fails:
[WARN] [DAEMON RUN] Machine registration unavailable at startup; continuing without machine sync until next restart {"name":"Error","message":"getaddrinfo EAI_AGAIN api.happier.dev","code":"EAI_AGAIN","method":"POST","url":"https://api.happier.dev/v1/machines"} - The daemon keeps running and works for locally-started sessions (file watcher, session scanner all work fine)
- But the phone/app can't see the machine or start new sessions on it
Expected Behavior
The daemon should retry machine registration with exponential backoff when the initial attempt fails, rather than giving up permanently.
Workaround
Manually restart the daemon after the network is up:
happier daemon stop && happier daemon startEnvironment
- OS: Arch Linux (headless server, starts with lid closed)
- Happier CLI: 0.1.0
- Node: v25.6.1
Suggested Fix
Add a retry loop with exponential backoff to the machine registration step in the daemon startup flow. Something like: retry 5 times with 5s/10s/30s/60s/120s delays before giving up.
🤖 Generated with Claude Code
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels