Zackriya-Solutions/meetily · error · anyhow::Error

Streamed byte count overflow

Error message

Streamed byte count overflow

What it means

The engine tracks total streamed bytes across the whole download session with a checked_add on each chunk. If the running count would overflow the u64 counter, this defensive error is thrown. On a normal machine this is essentially impossible (u64 max ≈ 18 exabytes) and indicates corrupted accounting state or a runaway loop, so it is an internal invariant guard.

Source

Thrown at frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs:1061

                        artifact.exact_bytes
                    ));
                }
                let next_confirmed_bytes = confirmed_bytes
                    .checked_add(chunk_bytes)
                    .ok_or_else(|| anyhow!("Progress overflow while downloading {}", artifact.filename))?;
                if next_confirmed_bytes > total_bytes {
                    return Err(anyhow!("Download progress exceeds the catalog total"));
                }

                writer
                    .write_all(&chunk)
                    .await
                    .map_err(|error| anyhow!("Failed to write {}: {}", artifact.filename, error))?;
                artifact_bytes = next_artifact_bytes;
                confirmed_bytes = next_confirmed_bytes;
                streamed_bytes = streamed_bytes
                    .checked_add(chunk_bytes)
                    .ok_or_else(|| anyhow!("Streamed byte count overflow"))?;
                bytes_since_report = bytes_since_report
                    .checked_add(chunk_bytes)
                    .ok_or_else(|| anyhow!("Progress byte count overflow"))?;

                let progress = Self::in_flight_progress(confirmed_bytes, total_bytes, 0.0);
                let elapsed = last_report.elapsed();
                if progress.percent > last_percent
                    || elapsed >= Duration::from_millis(500)
                    || artifact_bytes == artifact.exact_bytes
                {
                    let speed_mbps = if elapsed.as_secs_f64() > 0.0 {
                        bytes_since_report as f64 / (1024.0 * 1024.0) / elapsed.as_secs_f64()
                    } else {
                        0.0
                    };
                    if let Some(callback) = &progress_callback {
                        callback(Self::in_flight_progress(
                            confirmed_bytes,

View on GitHub (pinned to a2cb62e827)

Solutions

  1. Restart the app/retry the download to reset the counter state.
  2. If reproducible, inspect the chunk loop for a failure to reset per-artifact counters, causing unbounded accumulation across artifacts.
  3. Report as a bug with logs if it recurs — it indicates an internal accounting bug, not a user-configurable problem.

Example fix

// before: counter never reset between artifacts
let mut streamed_bytes = 0u64;
for artifact in artifacts {
    // ... accumulates across every retry, never reset
}
// after: reset per artifact
for artifact in artifacts {
    let mut streamed_bytes = 0u64;
    // ...
}
Defensive patterns

Strategy: try-catch

Try / catch

// Treat as an internal bug: log and fail fast, retry once with fresh state
if let Err(e) = result {
    if e.to_string().contains("Streamed byte count overflow") {
        log::error!("Internal accounting overflow in downloader, resetting state");
        reset_download_state();
        return Err(e); // report as bug; retrying without reset will repeat
    }
}

Prevention

When it happens

Trigger: `streamed_bytes.checked_add(chunk_bytes)` returns None in the chunk loop — only reachable if streamed_bytes is already astronomically large, i.e. corrupted accumulator state or a looping download driver.

Common situations: Practically never hit in the field; would only appear with a bug in the download loop (e.g. an infinite loop reusing an unreset counter across many artifacts) or memory corruption.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of Zackriya-Solutions/meetily@a2cb62e827 (2026-09-12). Data as JSON: /api/errors/fa4cf592046f3aa6. Report an issue: GitHub.