{"record":{"id":"29bc4c43dc05b480","repo":"cloudflare/pingora","slug":"dial9-max-total-size-must-be-greater-than-zero","errorCode":null,"errorMessage":"dial9 max_total_size must be greater than zero","messagePattern":"dial9 max_total_size must be greater than zero","errorType":"validation","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"pingora-runtime/src/lib.rs","lineNumber":325,"sourceCode":"fn build_dial9_runtime(\n    builder: Builder,\n    runtime_name: &str,\n    opts: &Dial9RuntimeOpts,\n) -> std::io::Result<(\n    tokio::runtime::Runtime,\n    dial9_tokio_telemetry::telemetry::TelemetryGuard,\n)> {\n    use dial9_tokio_telemetry::telemetry::{RotatingWriter, TracedRuntime};\n    use std::io::{Error, ErrorKind};\n\n    if opts.max_file_size == 0 {\n        return Err(Error::new(\n            ErrorKind::InvalidInput,\n            \"dial9 max_file_size must be greater than zero\",\n        ));\n    }\n    if opts.max_total_size == 0 {\n        return Err(Error::new(\n            ErrorKind::InvalidInput,\n            \"dial9 max_total_size must be greater than zero\",\n        ));\n    }\n    if opts.max_file_size > opts.max_total_size {\n        return Err(Error::new(\n            ErrorKind::InvalidInput,\n            \"dial9 max_file_size must be less than or equal to max_total_size\",\n        ));\n    }\n    if opts.worker_poll_interval == Some(Duration::ZERO) {\n        return Err(Error::new(\n            ErrorKind::InvalidInput,\n            \"dial9 worker_poll_interval must be greater than zero\",\n        ));\n    }\n\n    if let Some(parent) = opts.trace_path.parent() {","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/cloudflare/pingora/blob/0046038bd402bc82912da862dadf9a479f31e9f1/pingora-runtime/src/lib.rs#L307-L343","documentation":"The second validation in build_dial9_runtime() (pingora-runtime/src/lib.rs:325): the total on-disk budget for all dial9 trace files, max_total_size, must be greater than zero. A zero budget would mean the rotating writer could never write a file, so construction returns ErrorKind::InvalidInput instead.","triggerScenarios":"Constructing the dial9 traced runtime with Dial9RuntimeOpts { max_total_size: 0, .. } while max_file_size itself is positive; the check runs right after the max_file_size check.","commonSituations":"Setting only max_file_size in config and leaving the total unset; config templates where the total-budget key was renamed or dropped; disabling rotation by setting the total to 0 (not supported).","solutions":["Set max_total_size to a positive byte budget at least as large as max_file_size (e.g. keep 10-20x the per-file size)","If the intent was unlimited growth, pick a large explicit cap instead of 0","Validate both size fields together at config-load time so the pair is consistent"],"exampleFix":"// before\nlet opts = Dial9RuntimeOpts { max_file_size: 64 << 20, max_total_size: 0, ..Default::default() };\n\n// after\nlet opts = Dial9RuntimeOpts { max_file_size: 64 << 20, max_total_size: 1 << 30, ..Default::default() };","handlingStrategy":"validation","validationCode":"if opts.max_total_size == 0 {\n    return Err(std::io::Error::new(std::io::ErrorKind::InvalidInput,\n        format!(\"dial9 max_total_size must be > 0, got {}\", opts.max_total_size)));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Configure total budget and per-file size together, derived from one value (total = file * N)","Treat a missing/empty total in config as an error rather than defaulting to 0","Validate at startup, before the runtime is built, to fail with your own diagnostics"],"tags":["rust","pingora-runtime","dial9","log-rotation","config-validation"],"backgroundTag":"invalid-config-value","analyzedSha":"0046038bd402bc82912da862dadf9a479f31e9f1","analyzedAt":"2026-08-16T21:33:22.341Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}