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

{} size overflow

Error message

{} size overflow

What it means

The running byte counter for a downloaded artifact (artifact_bytes + chunk_bytes, computed with u64::checked_add) overflowed, which is mathematically impossible in a correct transfer. The code treats this as an internal invariant violation and aborts, because it indicates corrupted accounting state rather than a network problem.

Source

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

                    }
                    Ok(None) => break,
                    Ok(Some(Err(error))) => {
                        writer.flush().await.map_err(|flush_error| {
                            anyhow!(
                                "Failed to preserve {} after stream error: {}",
                                artifact.filename,
                                flush_error
                            )
                        })?;
                        return Err(anyhow!("Download stream failed for {}: {}", artifact.filename, error));
                    }
                    Ok(Some(Ok(chunk))) => chunk,
                };

                let chunk_bytes = chunk.len() as u64;
                let next_artifact_bytes = artifact_bytes
                    .checked_add(chunk_bytes)
                    .ok_or_else(|| anyhow!("{} size overflow", artifact.filename))?;
                if next_artifact_bytes > artifact.exact_bytes {
                    writer.flush().await.map_err(|error| {
                        anyhow!("Failed to preserve {} after overlong response: {}", artifact.filename, error)
                    })?;
                    return Err(anyhow!(
                        "{} response exceeds its exact {} byte size",
                        artifact.filename,
                        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

View on GitHub (pinned to a2cb62e827)

Solutions

  1. Clear the partially downloaded model file and download-state so the resume offset resets to 0
  2. Check the persisted resume metadata (byte offset) is a sane value < exact_bytes
  3. Restart the app to reset in-memory counters and retry the download
  4. Report as a bug with logs — this indicates corrupted internal state

Example fix

// before
.ok_or_else(|| anyhow!("{} size overflow", artifact.filename))?;
// after
// validate resume offset when loading state:
anyhow::ensure!(resume_offset <= artifact.exact_bytes, "corrupt resume offset for {}", artifact.filename);
Defensive patterns

Strategy: validation

Validate before calling

// validate persisted resume offset before resuming
let offset: u64 = load_resume_offset(artifact_id)?;
anyhow::ensure!(offset <= artifact.exact_bytes, "corrupt resume offset for {}", artifact.filename);

Try / catch

match result {
    Err(e) if e.to_string().contains("size overflow") => {
        // corrupted accounting: reset state and restart download cleanly
        clear_download_state();
        restart_download_from_scratch()
    }
    other => other,
}

Prevention

When it happens

Trigger: artifact_bytes or chunk_bytes are corrupted (e.g. chunk.len() misreported, artifact_bytes initialized from a bogus resume offset near u64::MAX) so checked_add wraps in the loop at parakeet_engine.rs:1033-1035.

Common situations: A buggy resume path seeding artifact_bytes with a wrong/huge persisted offset; memory corruption or an incorrectly deserialized download-state file; artificial test injection of extreme values.

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/6b3569bcb9713bdc. Report an issue: GitHub.