{"record":{"id":"ce6fc6a85ad0c8b5","repo":"neondatabase/neon","slug":"error","errorCode":null,"errorMessage":"Error: {:?}","messagePattern":"Error: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pageserver/client/src/page_service.rs","lineNumber":236,"sourceCode":"\n    pub async fn getpage_send(&mut self, req: PagestreamGetPageRequest) -> anyhow::Result<()> {\n        self.send(PagestreamFeMessage::GetPage(req)).await\n    }\n}\n\nimpl PagestreamReceiver {\n    // TODO: maybe make this impl Stream instead for better composability?\n    pub async fn recv(&mut self) -> anyhow::Result<PagestreamBeMessage> {\n        let next: Option<Result<bytes::Bytes, _>> = self.stream.next().await;\n        let next: bytes::Bytes = next.unwrap()?;\n        PagestreamBeMessage::deserialize(next)\n    }\n\n    pub async fn getpage_recv(&mut self) -> anyhow::Result<PagestreamGetPageResponse> {\n        let next: PagestreamBeMessage = self.recv().await?;\n        match next {\n            PagestreamBeMessage::GetPage(p) => Ok(p),\n            PagestreamBeMessage::Error(e) => anyhow::bail!(\"Error: {:?}\", e),\n            PagestreamBeMessage::Exists(_)\n            | PagestreamBeMessage::Nblocks(_)\n            | PagestreamBeMessage::DbSize(_)\n            | PagestreamBeMessage::GetSlruSegment(_) => {\n                anyhow::bail!(\n                    \"unexpected be message kind in response to getpage request: {}\",\n                    next.kind()\n                )\n            }\n            #[cfg(feature = \"testing\")]\n            PagestreamBeMessage::Test(_) => {\n                anyhow::bail!(\n                    \"unexpected be message kind in response to getpage request: {}\",\n                    next.kind()\n                )\n            }\n        }\n    }","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/neondatabase/neon/blob/8f60b04da47ffefe0e52bda2440134b42874eb75/pageserver/client/src/page_service.rs#L218-L254","documentation":"`PagestreamReceiver::getpage_recv` awaited a GetPage response on the pageserver's pagestream channel but received `PagestreamBeMessage::Error` instead — the pageserver itself rejected or failed the request (bad LSN, missing relation, tenant/timeline issues) and reported the reason in the embedded error struct, which this message formats with Debug.","triggerScenarios":"Sending a getpage request that the pageserver cannot serve: requesting an LSN beyond the timeline, a nonexistent relation/block, or hitting a server-side error while reconstructing the page; the server replies with an Error message rather than GetPage.","commonSituations":"Compute requesting a page at an invalid/too-new LSN; timeline deleted or not yet attached; pageserver layer corruption or read errors during page reconstruction.","solutions":["Inspect the Debug-formatted error struct in the message — it carries the pageserver's actual failure reason and code","Check pageserver logs at the corresponding time for the detailed server-side error","Validate the LSN and relation you request against the timeline's known range before retrying","If the server reports a missing layer/tenant issue, resolve that on the pageserver first"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match pagestream.getpage_recv().await {\n    Ok(page) => { /* use page */ }\n    Err(e) if e.to_string().starts_with(\"Error:\") => {\n        // pageserver-reported failure: inspect reason, validate LSN/relation, then retry or surface\n        return Err(e.context(\"pageserver rejected getpage request\"));\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Validate requested LSNs against the timeline's last record LSN before sending getpage","Correlate client-side pagestream errors with pageserver logs by timestamp","Retry only idempotent reads after confirming the server-side cause"],"tags":["rust","neon","pageserver","pagestream","protocol"],"backgroundTag":"server-error-response","analyzedSha":"8f60b04da47ffefe0e52bda2440134b42874eb75","analyzedAt":"2026-08-16T23:39:28.135Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}