{"record":{"id":"8bcf662c8b805805","repo":"multica-ai/multica","slug":"load-cli-config-w","errorCode":null,"errorMessage":"load CLI config: %w","messagePattern":"load CLI config: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_daemon.go","lineNumber":530,"sourceCode":"\n// --- daemon start ---\n\n// daemonExecutable resolves the binary to spawn as the background daemon\n// child. Tests override it: spawning the resolved executable there would fork\n// the test binary itself, which ignores the daemon args and re-runs the suite.\nvar daemonExecutable = selfexec.Resolve\n\n// requireDaemonAuth fails fast when the user never ran `multica login`. The\n// daemon child performs the same check (resolveAuth) and dies immediately,\n// but the background parent can't see that exit — it would poll the health\n// port for the full 45s readiness window and then print a vague \"check logs\"\n// warning. Checking before spawning turns that silent stall into an\n// immediate, actionable error. Mirrors daemon.resolveAuth: the daemon only\n// authenticates via the stored config token, never MULTICA_TOKEN.\nfunc requireDaemonAuth(profile string) error {\n\tcfg, err := cli.LoadCLIConfigForProfile(profile)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"load CLI config: %w\", err)\n\t}\n\tif cfg.Token == \"\" {\n\t\tloginHint := \"multica login\"\n\t\tif profile != \"\" {\n\t\t\tloginHint = fmt.Sprintf(\"multica login --profile %s\", profile)\n\t\t}\n\t\treturn fmt.Errorf(\"you are not logged in. Run '%s' first, then start the daemon\", loginHint)\n\t}\n\treturn nil\n}\n\nfunc runDaemonStart(cmd *cobra.Command, _ []string) error {\n\tif err := requireHumanLocalCommand(\"daemon start\"); err != nil {\n\t\treturn err\n\t}\n\tforeground, _ := cmd.Flags().GetBool(\"foreground\")\n\tif foreground {\n\t\treturn runDaemonForeground(cmd)","sourceCodeStart":512,"sourceCodeEnd":548,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_daemon.go#L512-L548","documentation":"Error \"load CLI config: %w\" thrown in multica-ai/multica.","triggerScenarios":"Thrown at server/cmd/multica/cmd_daemon.go:530 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix or delete the corrupted CLI config file and retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}