{"record":{"id":"f10ceca4da7bc19d","repo":"cloudflare/pingora","slug":"dial9-max-file-size-must-be-greater-than-zero","errorCode":null,"errorMessage":"dial9 max_file_size must be greater than zero","messagePattern":"dial9 max_file_size must be greater than zero","errorType":"validation","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"pingora-runtime/src/lib.rs","lineNumber":319,"sourceCode":"\n    #[cfg(not(tokio_unstable))]\n    let _ = (builder, opts);\n}\n\n#[cfg(feature = \"dial9\")]\nfn 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(","sourceCodeStart":301,"sourceCodeEnd":337,"githubUrl":"https://github.com/cloudflare/pingora/blob/0046038bd402bc82912da862dadf9a479f31e9f1/pingora-runtime/src/lib.rs#L301-L337","documentation":"build_dial9_runtime() in pingora-runtime validates Dial9RuntimeOpts before constructing the dial9 traced Tokio runtime that writes rotating trace files. max_file_size is the per-file cap of the rotating trace writer, and 0 is rejected up front with ErrorKind::InvalidInput. The error is returned (not a panic) at runtime construction time, so it fails fast during startup.","triggerScenarios":"Building the dial9 traced runtime through pingora-runtime with Dial9RuntimeOpts { max_file_size: 0, .. }, typically because the field was left at its zero default or a config file supplied 0.","commonSituations":"Wiring Dial9RuntimeOpts from YAML/env where max_file_size was forgotten; a config schema change that stopped populating the field; copy-pasting an options struct literal with placeholder zeros.","solutions":["Set max_file_size to a positive size in bytes (e.g. 64 * 1024 * 1024 per trace file)","Satisfy the sibling checks in the same validation block: max_total_size > 0, max_file_size <= max_total_size, worker_poll_interval None or positive","Populate these fields from a validated config loader instead of raw optional deserialization"],"exampleFix":"// before\nlet opts = Dial9RuntimeOpts { max_file_size: 0, max_total_size: 1 << 30, ..Default::default() };\n\n// after\nlet opts = Dial9RuntimeOpts { max_file_size: 64 << 20, max_total_size: 1 << 30, ..Default::default() };","handlingStrategy":"validation","validationCode":"// Mirror the library's checks at config-load time\nfn validate_dial9(opts: &Dial9RuntimeOpts) -> std::io::Result<()> {\n    if opts.max_file_size == 0 {\n        return Err(std::io::Error::new(std::io::ErrorKind::InvalidInput, \"max_file_size must be > 0\"));\n    }\n    if opts.max_total_size == 0 {\n        return Err(std::io::Error::new(std::io::ErrorKind::InvalidInput, \"max_total_size must be > 0\"));\n    }\n    if opts.max_file_size > opts.max_total_size {\n        return Err(std::io::Error::new(std::io::ErrorKind::InvalidInput, \"max_file_size must be <= max_total_size\"));\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Give dial9 size fields explicit non-zero defaults in your config layer","Reject 0 values at config load with a clear message naming the field","Unit-test your config parsing against the same constraints pingora-runtime enforces"],"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"}