multica-ai/multica · error
workspace not found
Error message
workspace not found
What it means
Error "workspace not found" thrown in multica-ai/multica.
Source
Thrown at server/internal/middleware/workspace.go:45
// WorkspaceIDFromContext returns the workspace ID injected by the workspace middleware.
func WorkspaceIDFromContext(ctx context.Context) string {
id, _ := ctx.Value(ctxKeyWorkspaceID).(string)
return id
}
// SetMemberContext injects workspace ID and member into the context.
// This is useful for handlers that resolve the workspace from an entity lookup
// and want to share the member with downstream code.
func SetMemberContext(ctx context.Context, workspaceID string, member db.Member) context.Context {
ctx = context.WithValue(ctx, ctxKeyWorkspaceID, workspaceID)
ctx = context.WithValue(ctx, ctxKeyMember, member)
return ctx
}
// errWorkspaceNotFound is returned when a slug was provided but doesn't match
// any workspace. This lets the middleware distinguish "no identifier provided"
// (400) from "identifier provided but invalid" (404).
var errWorkspaceNotFound = errors.New("workspace not found")
// ResolveWorkspaceIDFromRequest returns the workspace UUID for an HTTP
// request using the same priority order as the workspace middleware. This is
// the single source of truth for "which workspace is this request targeting?",
// shared by middleware-protected routes (via context fast path) and
// middleware-less routes (e.g. /api/upload-file) that must resolve the slug
// themselves.
//
// Priority:
// 1. task-token binding (X-Actor-Source == "task_token") — authoritative,
// server-set, cannot be re-negotiated by the client (MUL-2600)
// 2. middleware-injected context (fast path for middleware-protected routes)
// 3. X-Workspace-Slug header → GetWorkspaceBySlug → UUID (post-refactor frontend)
// 4. ?workspace_slug query → GetWorkspaceBySlug → UUID
// 5. X-Workspace-ID header (CLI/daemon compat)
// 6. ?workspace_id query (CLI/daemon compat)
//
// Returns "" when no identifier was provided OR a slug was provided butView on GitHub (pinned to 2c0912b6ec)
Solutions
- Verify the workspace id or slug and that you are a member of that workspace.
When it happens
Trigger: Thrown at server/internal/middleware/workspace.go:45 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15).
Data as JSON: /api/errors/2b8fbb8e8d75b50e.
Report an issue: GitHub.