{"record":{"id":"70ab361e5bbcd046","repo":"databendlabs/databend","slug":"failed-to-parse-seq-number","errorCode":null,"errorMessage":"failed to parse seq number: {}","messagePattern":"failed to parse seq number: (.+?)","errorType":"validation","errorClass":"InvalidInput","httpStatus":null,"severity":"error","filePath":"src/meta/plugins/semaphore/src/storage/permit_key.rs","lineNumber":82,"sourceCode":"                format!(\n                    \"semaphore permit key should have at least 3 segments: {}\",\n                    key\n                ),\n            ));\n        }\n\n        if parts[1] != \"queue\" {\n            return Err(io::Error::new(\n                io::ErrorKind::InvalidInput,\n                format!(\n                    \"semaphore permit key should have 'queue' as the second segment: {}\",\n                    key\n                ),\n            ));\n        }\n\n        let seq = parts[0].parse::<u64>().map_err(|e| {\n            io::Error::new(\n                io::ErrorKind::InvalidInput,\n                format!(\"failed to parse seq number: {}\", e),\n            )\n        })?;\n\n        Ok(Self {\n            prefix: parts[2].to_string(),\n            seq,\n        })\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    #[test]\n    fn test_display() {","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/databendlabs/databend/blob/288d84d76e20a2f8f7173bda9691eb6ece301aa9/src/meta/plugins/semaphore/src/storage/permit_key.rs#L64-L100","documentation":"A validation guard in PermitKey::parse_key: the first segment of the key (the sequence number) must parse as a u64. This error fires when the leading segment before the last two slashes is not a valid unsigned integer, indicating the key was corrupted or written in a non-standard format rather than by format_key's {:020} formatting.","triggerScenarios":"Thrown at src/meta/plugins/semaphore/src/storage/permit_key.rs:82 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the final path segment is a base-10 u64 sequence number with no whitespace, sign, or padding characters other than the expected zero-padding.","If the seq segment was truncated or corrupted in storage, re-encode the key with format_key.","Strip stray characters before parsing, or reject the key at a higher level if it fails u64::from_str semantics."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"288d84d76e20a2f8f7173bda9691eb6ece301aa9","analyzedAt":"2026-09-11T11:29:36.208Z","contentChangedAt":"2026-09-11T11:29:36.208Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}