multica-ai/multica · critical

daemon exited during startup.

Error message

daemon exited during startup.

What it means

Constructed by daemonStartupFailureError in cmd_daemon.go when the spawned daemon child process exited before ever reporting ready, and the log-tail inspection did not match either recognized failure signature (auth token rejected, or network-unreachable). This is the fallback branch: the final error embeds an exit-code variant when available, a noise-filtered excerpt (WRN/ERR lines plus raw crash output like Go panics), and the full log paths so the user can diagnose directly.

Solutions

  1. Open the Full log path printed in the error — it contains the complete startup attempt.
  2. Check the Crash output path (daemon.err.log) for the Go panic or cobra 'Error:' line; that names the root cause.
  3. Re-run `multica login` and confirm the server URL is correct even if the heuristic missed the auth failure shape.
  4. Move aside/reset the daemon state directory if logs show corruption, then retry `multica daemon start`.
  5. If the panic persists, capture the crash tail and file it with the daemon version string.
Defensive patterns

Strategy: fallback

Try / catch

err := waitForDaemonReady(ctx, child, logs)
if err != nil {
  return daemonStartupFailureError(logs, err, profile, serverURL) // already includes log paths + filtered excerpt
}

Prevention

When it happens

Trigger: `multica daemon start` spawns the child which crashes before the ready signal: panic in daemon initialization, invalid config file, port already bound, missing permissions on state dirs, or any startup failure not matching the auth/network heuristics.

Common situations: Corrupted daemon state directory; config with an invalid value after an upgrade; another process holding the daemon port; binary/arch mismatch after a partial update; permissions changed on the log/state dirs.

Related errors


AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15). Data as JSON: /api/errors/c39d3b391a3288e8. Report an issue: GitHub.

Appendix: source

Thrown at server/cmd/multica/cmd_daemon.go:796

	}
	excerpt := filterDaemonLogNoise(lines, 5)
	// Crash output is already raw (panics, the final cobra error line) — no
	// noise filter, just cap it like the structured excerpt.
	if len(crashLines) > 5 {
		crashLines = crashLines[len(crashLines)-5:]
	}
	excerpt = append(excerpt, crashLines...)
	if len(excerpt) > 0 {
		b.WriteString("\nLog output:")
		for _, line := range excerpt {
			fmt.Fprintf(&b, "\n  %s", line)
		}
	}
	fmt.Fprintf(&b, "\nFull log: %s", logs.logPath)
	if len(crashLines) > 0 {
		fmt.Fprintf(&b, "\nCrash output: %s", logs.errLogPath)
	}
	return errors.New(b.String())
}

// filterDaemonLogNoise drops DBG/INF log lines from an excerpt, keeping
// WRN/ERR entries and plain (non-slog) lines such as the final error the
// child printed before exiting, capped to the last max lines.
func filterDaemonLogNoise(lines []string, max int) []string {
	out := make([]string, 0, len(lines))
	for _, line := range lines {
		if strings.Contains(line, " DBG ") || strings.Contains(line, " INF ") {
			continue
		}
		out = append(out, line)
	}
	if len(out) > max {
		out = out[len(out)-max:]
	}
	return out
}

View on GitHub (pinned to 2c0912b6ec)