{"record":{"id":"fedf86d2c7315ab9","repo":"BloopAI/vibe-kanban","slug":"workspace-not-found","errorCode":null,"errorMessage":"Workspace not found","messagePattern":"Workspace not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/local-deployment/src/container.rs","lineNumber":146,"sourceCode":"        };\n\n        container.spawn_workspace_cleanup();\n\n        container\n    }\n\n    fn map_workspace_manager_error(err: WorkspaceError) -> ContainerError {\n        match err {\n            WorkspaceError::Database(err) => ContainerError::Sqlx(err),\n            WorkspaceError::Worktree(err) => ContainerError::Worktree(err),\n            WorkspaceError::GitService(err) => ContainerError::GitServiceError(err),\n            WorkspaceError::Io(err) => ContainerError::Io(err),\n            WorkspaceError::NoRepositories => {\n                ContainerError::Other(anyhow!(\"No repositories provided\"))\n            }\n            WorkspaceError::Repo(err) => ContainerError::Other(anyhow!(err)),\n            WorkspaceError::WorkspaceNotFound => {\n                ContainerError::Other(anyhow!(\"Workspace not found\"))\n            }\n            WorkspaceError::RepoAlreadyAttached => {\n                ContainerError::Other(anyhow!(\"Repository already attached to workspace\"))\n            }\n            WorkspaceError::BranchNotFound { repo_name, branch } => ContainerError::Other(anyhow!(\n                \"Branch '{}' does not exist in repository '{}'\",\n                branch,\n                repo_name\n            )),\n            WorkspaceError::PartialCreation(msg) => ContainerError::Other(anyhow!(msg)),\n        }\n    }\n\n    async fn workspace_repo_inputs(\n        &self,\n        workspace_id: Uuid,\n    ) -> Result<(Vec<Repo>, Vec<RepoWorkspaceInput>), ContainerError> {\n        let workspace_repos =","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/BloopAI/vibe-kanban/blob/4deb7eca8f381f7cbc1f9d15515a9ab8f8009053/crates/local-deployment/src/container.rs#L128-L164","documentation":"When a workspace operation targets a workspace id that doesn't exist in the workspace manager's store, WorkspaceError::WorkspaceNotFound is mapped to ContainerError::Other with 'Workspace not found'. It means the referenced workspace was never created or has since been deleted.","triggerScenarios":"Calling container APIs (start/stop/pause/delete, etc.) with a workspace id absent from the database — deleted workspace, wrong id, or a row removed by another client while cached locally.","commonSituations":"UI keeps a stale workspace open after deletion in another window, scripts hardcode ids from a previous environment, or DB was reset/migrated losing the workspace rows.","solutions":["Verify the workspace id exists (list workspaces) before operating on it.","Refresh the client's workspace list and retry with a valid id.","If the DB was reset, recreate the workspace.","Handle the not-found case gracefully in the UI (navigate away/offer re-creation) instead of surfacing a raw error."],"exampleFix":"// before\ncontainer.start_workspace(&stale_id).await?;\n// after\nmatch container.start_workspace(&id).await {\n    Ok(()) => {},\n    Err(e) if e.to_string().contains(\"Workspace not found\") => refresh_and_prompt_recreate(),\n    Err(e) => return Err(e.into()),\n}","handlingStrategy":"try-catch","validationCode":"// check existence before operating\nlet exists = workspace_store.get(&workspace_id).await.is_some();\nif !exists {\n    return Err(anyhow!(\"workspace {workspace_id} no longer exists\"));\n}","typeGuard":null,"tryCatchPattern":"match container.start_workspace(&id).await {\n    Err(e) if e.to_string().contains(\"Workspace not found\") => {\n        refresh_workspace_list(); // drop stale id, re-create or navigate away\n    }\n    Err(e) => return Err(e.into()),\n    Ok(v) => v,\n}","preventionTips":["Refresh workspace lists after deletes/mutations to avoid stale ids.","Never hardcode workspace ids in scripts; resolve by name at runtime.","Check whether DB resets/migrations removed workspace rows.","Subscribe to workspace-deleted events if the client framework offers them."],"tags":["workspace","not-found","stale-reference"],"backgroundTag":"resource-not-found","analyzedSha":"4deb7eca8f381f7cbc1f9d15515a9ab8f8009053","analyzedAt":"2026-08-29T09:24:13.446Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}