multica-ai/multica · error
get workspace: %w
Error message
get workspace: %w
What it means
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.
Source
Thrown at server/cmd/multica/cmd_workspace.go:501
wsID, err := resolveWorkspaceArg(cmd, args)
if err != nil {
return err
}
if wsID == "" {
return fmt.Errorf("workspace ID is required: pass an id/slug/prefix as argument or set MULTICA_WORKSPACE_ID")
}
client, err := newAPIClient(cmd)
if err != nil {
return err
}
ctx, cancel := cli.APIContext(context.Background())
defer cancel()
var ws map[string]any
if err := client.GetJSON(ctx, "/api/workspaces/"+wsID, &ws); err != nil {
return fmt.Errorf("get workspace: %w", err)
}
return printWorkspace(cmd, ws)
}
func printWorkspace(cmd *cobra.Command, ws map[string]any) error {
output, _ := cmd.Flags().GetString("output")
if output == "table" {
desc := strVal(ws, "description")
if utf8.RuneCountInString(desc) > 60 {
runes := []rune(desc)
desc = string(runes[:57]) + "..."
}
wsContext := strVal(ws, "context")
if utf8.RuneCountInString(wsContext) > 60 {
runes := []rune(wsContext)
wsContext = string(runes[:57]) + "..."
}View on GitHub (pinned to 2c0912b6ec)
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
Example fix
// before multica workspace get my-workspace # get workspace: unexpected status 404 // after multica workspace list # locate exact slug, then multica workspace get 42f1c8e0-...
Defensive patterns
Strategy: try-catch
Validate before calling
ws := os.Getenv("MULTICA_WORKSPACE_ID")
if ws == "" {
log.Fatal("workspace id required")
}
// avoid obviously invalid identifiers
if strings.ContainsAny(ws, " /?#") {
log.Fatal("workspace id contains URL-unsafe characters")
} Try / catch
if err := runWorkspaceGet(cmd, args); err != nil {
var httpErr *apiclient.HTTPError
if errors.As(err, &httpErr) {
switch httpErr.StatusCode {
case 404:
log.Fatalf("workspace %q not found", wsID)
case 401, 403:
log.Fatal("check MULTICA_API_TOKEN and permissions")
default:
log.Fatalf("server error: %v", err)
}
}
log.Fatal(err)
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- get workspace: %w
- update workspace: %w
- list workspace mcp servers: %w
- list members: %w
- list comments: %w
AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15).
Data as JSON: /api/errors/15b30a4d07cec198.
Report an issue: GitHub.