GitoxideLabs/gitoxide · error

encountered non-data line in a data-line only context

Error message

encountered non-data line in a data-line only context

What it means

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.

Solutions

  1. Inspect the server-side logs / re-run the operation; the remote likely aborted the session
  2. Retry the fetch/push — transient network drops commonly cause truncated packet-line streams
  3. Register a sideband progress/error handler so ERR and progress packets are handled instead of surfacing as EOF
  4. Verify connectivity to the remote and any proxy/firewall stability
Defensive patterns

Strategy: retry

Validate before calling

// check connection liveness before protocol work
if reader.peek().is_err() { return Err("remote connection closed".into()); }

Try / catch

match read_result {
    Err(e) if e.kind() == std::io::ErrorKind::UnexpectedEof => {
        // retry the fetch; register sideband handler to see remote ERR packets
    }
    other => other?,
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of GitoxideLabs/gitoxide@e73179060b (2026-09-08). Data as JSON: /api/errors/fe3a539e54ef6461. Report an issue: GitHub.

Appendix: source

Thrown at gix-packetline/src/blocking_io/sidebands.rs:172

                            BandRef::Progress(d) => {
                                let text = TextRef::from(d).0;
                                if handle_progress(false, text).is_break() {
                                    return Err(std::io::Error::other("interrupted by user"));
                                }
                            }
                            BandRef::Error(d) => {
                                let text = TextRef::from(d).0;
                                if handle_progress(true, text).is_break() {
                                    return Err(std::io::Error::other("interrupted by user"));
                                }
                            }
                        }
                    }
                    None => {
                        break match line.as_slice() {
                            Some(d) => (U16_HEX_BYTES, d.len()),
                            None => {
                                return Err(io::Error::new(
                                    io::ErrorKind::UnexpectedEof,
                                    "encountered non-data line in a data-line only context",
                                ));
                            }
                        };
                    }
                }
            };
            self.cap = cap + ofs;
            self.pos = ofs;
        }
        Ok(&self.parent.buf[self.pos..self.cap])
    }

    fn consume(&mut self, amt: usize) {
        self.pos = std::cmp::min(self.pos + amt, self.cap);
    }
}

View on GitHub (pinned to e73179060b)