{"record":{"id":"1a81514acd03ddb7","repo":"multica-ai/multica","slug":"list-labels-w","errorCode":null,"errorMessage":"list labels: %w","messagePattern":"list labels: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_label.go","lineNumber":97,"sourceCode":"\tclient, err := newAPIClient(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\tctx, cancel := cli.APIContext(context.Background())\n\tdefer cancel()\n\n\tparams := url.Values{}\n\tif client.WorkspaceID != \"\" {\n\t\tparams.Set(\"workspace_id\", client.WorkspaceID)\n\t}\n\tpath := \"/api/labels\"\n\tif len(params) > 0 {\n\t\tpath += \"?\" + params.Encode()\n\t}\n\n\tvar result map[string]any\n\tif err := client.GetJSON(ctx, path, &result); err != nil {\n\t\treturn fmt.Errorf(\"list labels: %w\", err)\n\t}\n\tlabelsRaw, _ := result[\"labels\"].([]any)\n\n\toutput, _ := cmd.Flags().GetString(\"output\")\n\tif output == \"json\" {\n\t\treturn cli.PrintJSON(os.Stdout, labelsRaw)\n\t}\n\n\tfullID, _ := cmd.Flags().GetBool(\"full-id\")\n\theaders := []string{\"ID\", \"NAME\", \"COLOR\", \"CREATED\"}\n\trows := make([][]string, 0, len(labelsRaw))\n\tfor _, raw := range labelsRaw {\n\t\tl, ok := raw.(map[string]any)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tcreated := strVal(l, \"created_at\")\n\t\tif len(created) >= 10 {","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_label.go#L79-L115","documentation":"Wraps a failed GET /api/labels (optionally ?workspace_id=...) during `multica label list`. The inner error is the APIClient transport/server error: connectivity, auth, or server-side failure. Labels are workspace-scoped, and the workspace filter is attached automatically when the client has one configured.","triggerScenarios":"Server unreachable; expired/invalid token (401); no permission for the workspace; server 5xx; or the client has a WorkspaceID that the server rejects.","commonSituations":"Running the CLI against a stopped local server; MULTICA_SERVER/URL env pointing at the wrong host; stale credentials after a password rotation; CI environments without a configured profile.","solutions":["Verify the server is running and reachable at the configured URL (`multica status` or curl the health endpoint)","Re-authenticate: `multica login`","Check the profile/server URL configuration used by the CLI (e.g. --profile flag or env vars)","Retry once for transient network failures"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"# bash: cheap pre-flight before listing\nif ! curl -sf \"$MULTICA_SERVER/health\" >/dev/null; then echo \"server unreachable\" >&2; exit 2; fi","typeGuard":null,"tryCatchPattern":"if err := client.GetJSON(ctx, path, &result); err != nil {\n\tif isTransient(err) { time.Sleep(time.Second); retry once }\n\tif isUnauthorized(err) { hint re-login }\n\treturn fmt.Errorf(\"list labels: %w\", err)\n}","preventionTips":["Pin the server URL via config/env, not memory","Refresh tokens before long sessions","Wrap CLI calls in scripts with a single retry for transient failures"],"tags":["cli","http","labels"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}