{"record":{"id":"cc4a9761f71ae5a9","repo":"zed-industries/zed","slug":"buffer-id-does-not-exist","errorCode":null,"errorMessage":"buffer {id} does not exist","messagePattern":"buffer (.+?) does not exist","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/project/src/project.rs","lineNumber":3414,"sourceCode":"    pub fn unstage_staged_hunks(\n        &mut self,\n        staged_diff: Entity<BufferDiff>,\n        index_ranges: Vec<Range<Anchor>>,\n        cx: &mut Context<Self>,\n    ) -> Result<()> {\n        if self.is_disconnected(cx) {\n            return Err(anyhow!(ErrorCode::Disconnected));\n        }\n        self.git_store.update(cx, |git_store, cx| {\n            git_store.unstage_staged_hunks(staged_diff, index_ranges, cx)\n        })\n    }\n\n    pub fn open_buffer_by_id(\n        &mut self,\n        id: BufferId,\n        cx: &mut Context<Self>,\n    ) -> Task<Result<Entity<Buffer>>> {\n        if let Some(buffer) = self.buffer_for_id(id, cx) {\n            Task::ready(Ok(buffer))\n        } else if self.is_local() || self.is_via_remote_server() {\n            Task::ready(Err(anyhow!(\"buffer {id} does not exist\")))\n        } else if let Some(project_id) = self.remote_id() {\n            let request = self.collab_client.request(proto::OpenBufferById {\n                project_id,\n                id: id.into(),\n            });\n            cx.spawn(async move |project, cx| {\n                let buffer_id = BufferId::new(request.await?.buffer_id)?;\n                project\n                    .update(cx, |project, cx| {\n                        project.buffer_store.update(cx, |buffer_store, cx| {\n                            buffer_store.wait_for_remote_buffer(buffer_id, cx)\n                        })\n                    })?\n                    .await","sourceCodeStart":3396,"sourceCodeEnd":3432,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/project/src/project.rs#L3396-L3432","documentation":"In Project::open_buffer_by_id: the buffer id is not present in the local buffer cache and the project is neither local nor via-remote-server in a way that resolves it, so the fallback reports the buffer does not exist. Fires for stale/already-closed buffer ids.","triggerScenarios":"Thrown at crates/project/src/project.rs:3401 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Open the buffer by path instead","Ensure the buffer was previously created in this session"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}