{"record":{"id":"a415474eda038182","repo":"zed-industries/zed","slug":"worktree-creation-was-canceled-a41547","errorCode":null,"errorMessage":"Worktree creation was canceled","messagePattern":"Worktree creation was canceled","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/git_ui_core/src/worktree_service.rs","lineNumber":550,"sourceCode":") -> anyhow::Result<Vec<PathBuf>> {\n    let mut created_paths: Vec<PathBuf> = Vec::new();\n    let mut repos_and_paths: Vec<(Entity<Repository>, PathBuf)> = Vec::new();\n    let mut first_error: Option<anyhow::Error> = None;\n\n    for (repo, new_path, receiver) in creation_infos {\n        repos_and_paths.push((repo.clone(), new_path.clone()));\n        match receiver.await {\n            Ok(Ok(())) => {\n                created_paths.push(new_path);\n            }\n            Ok(Err(err)) => {\n                if first_error.is_none() {\n                    first_error = Some(err);\n                }\n            }\n            Err(_canceled) => {\n                if first_error.is_none() {\n                    first_error = Some(anyhow!(\"Worktree creation was canceled\"));\n                }\n            }\n        }\n    }\n\n    let Some(err) = first_error else {\n        return Ok(created_paths);\n    };\n\n    // Rollback all attempted worktrees\n    let mut rollback_futures = Vec::new();\n    for (rollback_repo, rollback_path) in &repos_and_paths {\n        let receiver = cx\n            .update(|_, cx| {\n                rollback_repo.update(cx, |repo, _cx| {\n                    repo.remove_worktree(rollback_path.clone(), true)\n                })\n            })","sourceCodeStart":532,"sourceCodeEnd":568,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/git_ui_core/src/worktree_service.rs#L532-L568","documentation":"Sentinel raised in await_and_rollback_on_failure: one of the per-repository worktree creation receivers was cancelled (dropped before sending a result), so the creation was interrupted and any partially created worktrees must be rolled back.","triggerScenarios":"Thrown at crates/git_ui_core/src/worktree_service.rs:550 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the worktree creation; it was cancelled before completion","Avoid closing the window or switching workspaces while creation is in progress","Check the first_error reported alongside this cancellation for the underlying cause"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}