{"record":{"id":"15b30a4d07cec198","repo":"multica-ai/multica","slug":"get-workspace-w-15b30a","errorCode":null,"errorMessage":"get workspace: %w","messagePattern":"get workspace: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_workspace.go","lineNumber":501,"sourceCode":"\twsID, err := resolveWorkspaceArg(cmd, args)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif wsID == \"\" {\n\t\treturn fmt.Errorf(\"workspace ID is required: pass an id/slug/prefix as argument or set MULTICA_WORKSPACE_ID\")\n\t}\n\n\tclient, err := newAPIClient(cmd)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tctx, cancel := cli.APIContext(context.Background())\n\tdefer cancel()\n\n\tvar ws map[string]any\n\tif err := client.GetJSON(ctx, \"/api/workspaces/\"+wsID, &ws); err != nil {\n\t\treturn fmt.Errorf(\"get workspace: %w\", err)\n\t}\n\n\treturn printWorkspace(cmd, ws)\n}\n\nfunc printWorkspace(cmd *cobra.Command, ws map[string]any) error {\n\toutput, _ := cmd.Flags().GetString(\"output\")\n\tif output == \"table\" {\n\t\tdesc := strVal(ws, \"description\")\n\t\tif utf8.RuneCountInString(desc) > 60 {\n\t\t\trunes := []rune(desc)\n\t\t\tdesc = string(runes[:57]) + \"...\"\n\t\t}\n\t\twsContext := strVal(ws, \"context\")\n\t\tif utf8.RuneCountInString(wsContext) > 60 {\n\t\t\trunes := []rune(wsContext)\n\t\t\twsContext = string(runes[:57]) + \"...\"\n\t\t}","sourceCodeStart":483,"sourceCodeEnd":519,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_workspace.go#L483-L519","documentation":"Wrapped failure of the HTTP GET to /api/workspaces/{id} performed by the `multica workspace get` CLI command. The underlying error (network failure, 404 for an unknown id/slug/prefix, 401/403 for bad credentials) is chained with %w, so `errors.Unwrap` reveals the API client's cause. This is a transport/server-side error, not local validation.","triggerScenarios":"Running `multica workspace get <id>` when the workspace id/slug/prefix does not match any workspace (404), the API token is missing or invalid (401), the user lacks access (403), or the server at the configured base URL is unreachable / returns a 5xx.","commonSituations":"Typo'd or stale workspace slug after a workspace was renamed or deleted; MULTICA_API_TOKEN pointing at a different environment; server base URL misconfigured so the client hits the wrong host; expired auth token.","solutions":["Verify the workspace exists with `multica workspace list` and re-run get with the exact id or slug","Check API connectivity and credentials (base URL env var, token) with any cheap command such as `multica workspace list`","If the server returned 404, confirm the prefix/slug resolution rules — a too-ambiguous prefix may not resolve to a single workspace","Inspect the wrapped error with `multica workspace get <id> -v` (or check stderr) to see the HTTP status and body from the server"],"exampleFix":"// before\nmultica workspace get my-workspace\n# get workspace: unexpected status 404\n\n// after\nmultica workspace list\n# locate exact slug, then\nmultica workspace get 42f1c8e0-... ","handlingStrategy":"try-catch","validationCode":"ws := os.Getenv(\"MULTICA_WORKSPACE_ID\")\nif ws == \"\" {\n    log.Fatal(\"workspace id required\")\n}\n// avoid obviously invalid identifiers\nif strings.ContainsAny(ws, \" /?#\") {\n    log.Fatal(\"workspace id contains URL-unsafe characters\")\n}","typeGuard":null,"tryCatchPattern":"if err := runWorkspaceGet(cmd, args); err != nil {\n    var httpErr *apiclient.HTTPError\n    if errors.As(err, &httpErr) {\n        switch httpErr.StatusCode {\n        case 404:\n            log.Fatalf(\"workspace %q not found\", wsID)\n        case 401, 403:\n            log.Fatal(\"check MULTICA_API_TOKEN and permissions\")\n        default:\n            log.Fatalf(\"server error: %v\", err)\n        }\n    }\n    log.Fatal(err)\n}","preventionTips":["Always resolve identifiers with `multica workspace list` before scripting get/update commands","Export MULTICA_WORKSPACE_ID in CI jobs so commands never run without a target","Prefer full workspace IDs over short prefixes in automation to avoid ambiguity"],"tags":["cli","http","workspace","api-client"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}