Hmbown/CodeWhale · error
exceeds the tombstone size limit
Error message
{} exceeds the tombstone size limit What it means
Tombstone generation reads the telemetry tombstone file (evidence that telemetry was wiped) but caps how much it reads at MAX_TOMBSTONE_BYTES. If the file is larger than the limit, it bails with this error instead of returning a generation, because an oversized tombstone means something unexpected is in the telemetry directory.
Solutions
- Inspect the file size: ls -l $CODEWHALE_HOME/telemetry/ and identify the oversized tombstone.
- Remove or truncate the tombstone (rm or truncate) if its content isn't needed, then retry the operation.
- Re-run the wipe flow so a fresh, valid tombstone is generated.
- Ensure nothing else writes into the telemetry directory (check cron/scripts pointing there).
Example fix
// before: stale oversized tombstone blocks arming
arm(root, observed_generation, || true)?;
// after: clear an invalid tombstone first
let tomb = telemetry::buffer::tombstone_path(root);
if fs::metadata(&tomb).map(|m| m.len() > MAX_TOMBSTONE_BYTES).unwrap_or(false) {
fs::remove_file(&tomb)?;
}
arm(root, observed_generation, || true)?; Defensive patterns
Strategy: validation
Validate before calling
fn tombstone_is_valid(root: &Path) -> bool {
std::fs::metadata(telemetry::buffer::tombstone_path(root))
.map(|m| m.len() <= MAX_TOMBSTONE_BYTES)
.unwrap_or(true)
} Type guard
fn fits_tombstone_limit(len: u64) -> bool { len <= MAX_TOMBSTONE_BYTES } Try / catch
match telemetry::buffer::wipe(root) {
Err(e) if e.to_string().contains("tombstone size limit") => {
let _ = std::fs::remove_file(telemetry::buffer::tombstone_path(root));
telemetry::buffer::wipe(root)?; // regenerate a valid tombstone
}
r => r?,
} Prevention
- Never write other files into the telemetry directory
- Verify tombstone size after wipe/generation
- Treat oversized telemetry files as corruption and regenerate
- Monitor $CODEWHALE_HOME/telemetry for unexpected content
When it happens
Trigger: arm() or wipe() calls tombstone_generation(root) while $CODEWHALE_HOME/telemetry/tombstone (or the equivalent file) is bigger than MAX_TOMBSTONE_BYTES.
Common situations: User or a script wrote arbitrary large data to the tombstone path; corrupted/concatenated tombstone from a crashed writer; filesystem with wrong file placed at the telemetry path; tampering test fixtures.
Understand the failure class
Background: "File too large" / "file size exceeds limit" errors: why libraries cap file sizes and how to fix them — this error's family across 46 libraries.
Related errors
- evidence metadata exceeds limit
- Input exceeds 64 MiB.
- LSP file exceeds the document limit
- MCP config exceeds the 1 MiB limit
- project config exceeds the 1 MiB limit
AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22).
Data as JSON: /api/errors/6b3ea0e8848f15ca.
Report an issue: GitHub.
Appendix: source
Thrown at crates/telemetry/src/buffer.rs:123
/// Read the exact tombstone generation, or `None` when collection has never
/// been disabled in this home.
pub(crate) fn tombstone_generation(root: &Path) -> Result<Option<TombstoneGeneration>> {
let path = tombstone_path(root);
let file = match File::open(&path) {
Ok(file) => file,
Err(error) if error.kind() == std::io::ErrorKind::NotFound => return Ok(None),
Err(error) => {
return Err(
anyhow::Error::new(error).context(format!("failed to open {}", path.display()))
);
}
};
let mut bytes = Vec::new();
file.take(MAX_TOMBSTONE_BYTES + 1)
.read_to_end(&mut bytes)
.with_context(|| format!("failed to read {}", path.display()))?;
if bytes.len() as u64 > MAX_TOMBSTONE_BYTES {
anyhow::bail!("{} exceeds the tombstone size limit", path.display());
}
Ok(Some(TombstoneGeneration(bytes)))
}
/// Create the telemetry directory `0700`, if it is missing.
pub fn ensure_dir(root: &Path) -> Result<()> {
if root.is_dir() {
return Ok(());
}
let mut builder = DirBuilder::new();
builder.recursive(true);
#[cfg(unix)]
{
use std::os::unix::fs::DirBuilderExt as _;
builder.mode(0o700);
}
builder
.create(root)View on GitHub (pinned to 73e0f67d83)