{"record":{"id":"7841c34d940e3462","repo":"multica-ai/multica","slug":"not-authenticated","errorCode":null,"errorMessage":"not authenticated","messagePattern":"not authenticated","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_login.go","lineNumber":97,"sourceCode":"\t\treturn nil\n\t}\n\n\tfmt.Fprintf(os.Stderr, \"\\n→ Run 'multica daemon start' to start your local agent runtime.\\n\")\n\treturn nil\n}\n\nfunc autoWatchWorkspaces(cmd *cobra.Command) error {\n\t// runLogin has already passed the human/local command guard and saved the\n\t// newly authenticated profile. Read that exact profile here rather than the\n\t// general task-safe resolvers, which intentionally fail closed on a lone\n\t// MULTICA_DAEMON_PORT signal.\n\tprofile := resolveProfile(cmd)\n\tcfg, err := cli.LoadCLIConfigForProfile(profile)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif cfg.Token == \"\" {\n\t\treturn fmt.Errorf(\"not authenticated\")\n\t}\n\tif cfg.ServerURL == \"\" {\n\t\treturn fmt.Errorf(\"server URL not configured\")\n\t}\n\n\tclient := cli.NewAPIClient(normalizeAPIBaseURL(cfg.ServerURL), \"\", cfg.Token)\n\tctx, cancel := cli.APIContext(context.Background())\n\tdefer cancel()\n\n\tvar workspaces []struct {\n\t\tID   string `json:\"id\"`\n\t\tName string `json:\"name\"`\n\t}\n\tif err := client.GetJSON(ctx, \"/api/workspaces\", &workspaces); err != nil {\n\t\treturn fmt.Errorf(\"list workspaces: %w\", err)\n\t}\n\n\tif len(workspaces) == 0 {","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_login.go#L79-L115","documentation":"Thrown by autoWatchWorkspaces after `multica login` when the freshly saved profile config has an empty token. The function deliberately loads the exact profile via LoadCLIConfigForProfile (not the task-safe resolvers) and fails closed if authentication state is missing, aborting the post-login workspace auto-watch step.","triggerScenarios":"Login flow completes but the token fails to persist to the profile config file; the config file is unreadable/corrupted in a way that yields an empty Token; a profile flag pointing at a profile that was never actually written; filesystem permissions blocking the config write.","commonSituations":"Home or config directory read-only (containers, restricted CI); XDG/config path misconfiguration; concurrent logins overwriting the profile; auth backend returning success without a token.","solutions":["Inspect the profile config file for the active profile and confirm the token field is populated","Verify write permissions on the CLI config directory; fix the filesystem issue and re-run `multica login`","Ensure --profile matches the profile you authenticated against","Re-run `multica login` after correcting the environment"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# bash: confirm the profile config actually holds a token after login\nmultica config show --output json 2>/dev/null | jq -e '.token | length > 0' >/dev/null \\\n  || { echo \"login did not persist a token — check config dir permissions\" >&2; exit 2; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure the CLI config directory is writable (containers/CI especially)","Authenticate and use the same --profile consistently","Verify the config file after first login"],"tags":["cli","auth","config"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}