{"record":{"id":"c39d3b391a3288e8","repo":"multica-ai/multica","slug":"daemon-exited-during-startup","errorCode":null,"errorMessage":"daemon exited during startup.","messagePattern":"daemon exited during startup\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"server/cmd/multica/cmd_daemon.go","lineNumber":796,"sourceCode":"\t}\n\texcerpt := filterDaemonLogNoise(lines, 5)\n\t// Crash output is already raw (panics, the final cobra error line) — no\n\t// noise filter, just cap it like the structured excerpt.\n\tif len(crashLines) > 5 {\n\t\tcrashLines = crashLines[len(crashLines)-5:]\n\t}\n\texcerpt = append(excerpt, crashLines...)\n\tif len(excerpt) > 0 {\n\t\tb.WriteString(\"\\nLog output:\")\n\t\tfor _, line := range excerpt {\n\t\t\tfmt.Fprintf(&b, \"\\n  %s\", line)\n\t\t}\n\t}\n\tfmt.Fprintf(&b, \"\\nFull log: %s\", logs.logPath)\n\tif len(crashLines) > 0 {\n\t\tfmt.Fprintf(&b, \"\\nCrash output: %s\", logs.errLogPath)\n\t}\n\treturn errors.New(b.String())\n}\n\n// filterDaemonLogNoise drops DBG/INF log lines from an excerpt, keeping\n// WRN/ERR entries and plain (non-slog) lines such as the final error the\n// child printed before exiting, capped to the last max lines.\nfunc filterDaemonLogNoise(lines []string, max int) []string {\n\tout := make([]string, 0, len(lines))\n\tfor _, line := range lines {\n\t\tif strings.Contains(line, \" DBG \") || strings.Contains(line, \" INF \") {\n\t\t\tcontinue\n\t\t}\n\t\tout = append(out, line)\n\t}\n\tif len(out) > max {\n\t\tout = out[len(out)-max:]\n\t}\n\treturn out\n}","sourceCodeStart":778,"sourceCodeEnd":814,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_daemon.go#L778-L814","documentation":"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.","triggerScenarios":"`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.","commonSituations":"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.","solutions":["Open the Full log path printed in the error — it contains the complete startup attempt.","Check the Crash output path (daemon.err.log) for the Go panic or cobra 'Error:' line; that names the root cause.","Re-run `multica login` and confirm the server URL is correct even if the heuristic missed the auth failure shape.","Move aside/reset the daemon state directory if logs show corruption, then retry `multica daemon start`.","If the panic persists, capture the crash tail and file it with the daemon version string."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := waitForDaemonReady(ctx, child, logs)\nif err != nil {\n  return daemonStartupFailureError(logs, err, profile, serverURL) // already includes log paths + filtered excerpt\n}","preventionTips":["Read the printed Full log and Crash output paths first — they contain the root cause for this fallback branch.","Run `multica login` after token rotation to avoid the auth-rejection variant.","Keep daemon state and log directories writable by the daemon user.","Smoke-test `multica daemon start` after every upgrade in a scratch profile."],"tags":["daemon","startup","process-exit","go","diagnostics"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}