{"record":{"id":"fe3a539e54ef6461","repo":"GitoxideLabs/gitoxide","slug":"encountered-non-data-line-in-a-data-line-only-cont","errorCode":null,"errorMessage":"encountered non-data line in a data-line only context","messagePattern":"encountered non-data line in a data-line only context","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gix-packetline/src/blocking_io/sidebands.rs","lineNumber":172,"sourceCode":"                            BandRef::Progress(d) => {\n                                let text = TextRef::from(d).0;\n                                if handle_progress(false, text).is_break() {\n                                    return Err(std::io::Error::other(\"interrupted by user\"));\n                                }\n                            }\n                            BandRef::Error(d) => {\n                                let text = TextRef::from(d).0;\n                                if handle_progress(true, text).is_break() {\n                                    return Err(std::io::Error::other(\"interrupted by user\"));\n                                }\n                            }\n                        }\n                    }\n                    None => {\n                        break match line.as_slice() {\n                            Some(d) => (U16_HEX_BYTES, d.len()),\n                            None => {\n                                return Err(io::Error::new(\n                                    io::ErrorKind::UnexpectedEof,\n                                    \"encountered non-data line in a data-line only context\",\n                                ));\n                            }\n                        };\n                    }\n                }\n            };\n            self.cap = cap + ofs;\n            self.pos = ofs;\n        }\n        Ok(&self.parent.buf[self.pos..self.cap])\n    }\n\n    fn consume(&mut self, amt: usize) {\n        self.pos = std::cmp::min(self.pos + amt, self.cap);\n    }\n}","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-packetline/src/blocking_io/sidebands.rs#L154-L190","documentation":"This error comes from gix-packetline's sideband-decoding BufRead adapter: in a context that only accepts data lines (demultiplexed sideband channel 1), the parser encountered a non-data packet (or EOF mid-line) and cannot return data. It surfaces as UnexpectedEof from `fill_buf`/`read`, meaning the packet-line stream ended or sent a control/non-data packet where data was required.","triggerScenarios":"Calling `read`/`fill_buf` on a `WithSidebands` reader configured without a progress/error handler while the remote sends a flush packet, an error packet, or the stream ends where a data line was expected.","commonSituations":"Fetch/clone/push conversations where the server terminates mid-response; protocol errors where the remote sends sideband progress or an ERR packet instead of pack data.","solutions":["Inspect the server-side logs / re-run the operation; the remote likely aborted the session","Retry the fetch/push — transient network drops commonly cause truncated packet-line streams","Register a sideband progress/error handler so ERR and progress packets are handled instead of surfacing as EOF","Verify connectivity to the remote and any proxy/firewall stability"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// check connection liveness before protocol work\nif reader.peek().is_err() { return Err(\"remote connection closed\".into()); }","typeGuard":null,"tryCatchPattern":"match read_result {\n    Err(e) if e.kind() == std::io::ErrorKind::UnexpectedEof => {\n        // retry the fetch; register sideband handler to see remote ERR packets\n    }\n    other => other?,\n}","preventionTips":["Always attach sideband progress/error handlers when using WithSidebands","Retry transient network failures with backoff","Check server logs when EOF occurs mid-response"],"tags":["packetline","protocol","sideband","network","eof"],"backgroundTag":"unexpected-eof","analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}