{"record":{"id":"096525c32412859c","repo":"influxdata/influxdb","slug":"invalid-gen1-duration-0-must-be-one-of-1m-5m-10m","errorCode":null,"errorMessage":"invalid gen1 duration {0}. Must be one of 1m, 5m, 10m","messagePattern":"invalid gen1 duration (.+?)\\. Must be one of 1m, 5m, 10m","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"influxdb3_wal/src/lib.rs","lineNumber":55,"sourceCode":"    #[error(\"wal buffer full with {0} ops\")]\n    BufferFull(usize),\n\n    #[error(\"error writing wal file: {0}\")]\n    WriteError(String),\n\n    #[error(\"deserialize error: {0}\")]\n    Serialize(#[from] crate::serialize::Error),\n\n    #[error(\"join error: {0}\")]\n    Join(#[from] tokio::task::JoinError),\n\n    #[error(\"object store error: {0}\")]\n    ObjectStoreError(#[from] ::object_store::Error),\n\n    #[error(\"wal is shutdown and not accepting writes\")]\n    Shutdown,\n\n    #[error(\"invalid gen1 duration {0}. Must be one of 1m, 5m, 10m\")]\n    InvalidGen1Duration(String),\n\n    #[error(\"invalid WAL file path\")]\n    InvalidWalFilePath,\n}\n\npub type Result<T, E = Error> = std::result::Result<T, E>;\n\n#[async_trait]\npub trait Wal: Debug + Send + Sync + 'static {\n    /// Buffer writes ops into the buffer, but returns before the operation is persisted to the WAL.\n    async fn write_ops_unconfirmed(&self, op: Vec<WalOp>) -> Result<(), Error>;\n\n    /// Writes the ops into the buffer and waits until the WAL file is persisted. When this returns\n    /// the operations are durable in the configured object store and the file notifier has been\n    /// called, which puts it into the queryable memory buffer.\n    async fn write_ops(&self, ops: Vec<WalOp>) -> Result<(), Error>;\n","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_wal/src/lib.rs#L37-L73","documentation":"Error::InvalidGen1Duration is thrown when a gen1 duration value is supplied that is not one of the three allowed values: 1 minute, 5 minutes, or 10 minutes. The gen1 duration determines the granularity of the parquet file generations the WAL produces, and the library intentionally restricts it to a fixed allowlist. The offending value is included in the message so you can see what was rejected.","triggerScenarios":"Parsing a duration string with Gen1Duration::from_str that is not '1m', '5m', or '10m' (lib.rs:234), or calling Gen1Duration::try_from(Duration) with a Duration that is not 60s, 300s, or 600s (lib.rs:245).","commonSituations":"A config file or CLI flag like --gen1-duration set to '30s', '1h', or '2m'; an environment variable with a typo; passing a programmatically computed Duration that lands on an unsupported value.","solutions":["Change the configured value to exactly one of the allowed strings: '1m', '5m', or '10m'.","If the value comes from a Duration, snap it to 60, 300, or 600 seconds before calling try_from.","Validate the duration at config load time and fail fast with the allowlist in the message.","If you need other values, this is not configurable in this version — pick the closest allowed value or upgrade the library."],"exampleFix":"// before\nlet d: Gen1Duration = \"30s\".parse()?; // InvalidGen1Duration(\"30s\")\n// after\nlet d: Gen1Duration = \"1m\".parse()?; // ok: 1m | 5m | 10m only","handlingStrategy":"validation","validationCode":"const ALLOWED: [&str; 3] = [\"1m\", \"5m\", \"10m\"];\nfn validate_gen1(s: &str) -> Result<(), String> {\n    if ALLOWED.contains(&s) { Ok(()) } else { Err(format!(\"invalid gen1 duration {s}: must be one of 1m, 5m, 10m\")) }\n}","typeGuard":"fn is_valid_gen1(s: &str) -> bool { matches!(s, \"1m\" | \"5m\" | \"10m\") }","tryCatchPattern":null,"preventionTips":["Validate gen1 duration at config-load time, before the server starts.","Keep duration values in config as strings from the allowlist; never compute them arithmetically.","Document the 1m/5m/10m restriction next to the CLI flag/config key."],"tags":["rust","config","duration","validation"],"backgroundTag":"invalid-duration-format","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}