netbirdio/netbird · error
listen daemon JSON interface
Error message
listen daemon JSON interface: %w
What it means
The optional JSON gateway socket failed to listen after the main control socket was already open. listenDaemonSockets closes the control listener again so the daemon starts nothing half-configured; the inner error says why the JSON socket was refused.
Solutions
- Fix the JSON socket path (stale file, permissions, or collision)
- Ensure --json-socket matches an address usable by the service user
- Restart the daemon after correcting the flag
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at client/cmd/service_controller.go:119 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of netbirdio/netbird@93e97f4bf1 (2026-08-16).
Data as JSON: /api/errors/0adfd7a845bf5fa3.
Report an issue: GitHub.
Appendix: source
Thrown at client/cmd/service_controller.go:119
// so a failed start leaves nothing listening. The returned JSON listener is nil
// when the socket is disabled.
func listenDaemonSockets() (*socketListener, *socketListener, error) {
daemonListener, err := listenOnAddress(daemonAddr)
if err != nil {
return nil, nil, fmt.Errorf("listen daemon interface: %w", err)
}
if !enableJSONSocket {
removeStaleUnixSocketForAddress(jsonSocket)
return daemonListener, nil, nil
}
jsonListener, err := listenOnAddress(jsonSocket)
if err != nil {
if cerr := daemonListener.Close(); cerr != nil {
log.Debugf("close daemon listener: %v", cerr)
}
return nil, nil, fmt.Errorf("listen daemon JSON interface: %w", err)
}
return daemonListener, jsonListener, nil
}
// serve brings up the daemon server on an already-open control socket and blocks
// until it stops. jsonListener is nil when the JSON socket is disabled. A returned
// error means the daemon cannot run at all and the caller is expected to exit; the
// failures it recovers from on its own are logged here.
func (p *program) serve(daemonListener, jsonListener *socketListener) error {
defer daemonListener.Close()
if jsonListener != nil {
defer jsonListener.Close()
}
// chmodUnixSocket is a no-op for a nil listener and for a non-unix one.
if err := daemonListener.chmodUnixSocket("daemon"); err != nil {
log.Error(err)View on GitHub (pinned to 93e97f4bf1)