{"record":{"id":"206cc8585f8d6d64","repo":"databendlabs/databend","slug":"semaphore-permit-key-should-have-queue-as-the-se","errorCode":null,"errorMessage":"semaphore permit key should have 'queue' as the second segment: {}","messagePattern":"semaphore permit key should have 'queue' as the second segment: (.+?)","errorType":"validation","errorClass":"InvalidInput","httpStatus":null,"severity":"error","filePath":"src/meta/plugins/semaphore/src/storage/permit_key.rs","lineNumber":72,"sourceCode":"    }\n\n    /// Parse the key from an encoded string.\n    pub fn parse_key(key: &str) -> Result<Self, io::Error> {\n        // split by the last 2 slashes:\n        let parts = key.rsplitn(3, '/').collect::<Vec<_>>();\n\n        if parts.len() != 3 {\n            return Err(io::Error::new(\n                io::ErrorKind::InvalidInput,\n                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,","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/databendlabs/databend/blob/288d84d76e20a2f8f7173bda9691eb6ece301aa9/src/meta/plugins/semaphore/src/storage/permit_key.rs#L54-L90","documentation":"A validation guard in PermitKey::parse_key: the second segment (parts[1]) of the 3-part key must be the literal \"queue\", matching the layout produced by format_key (\"{prefix}/queue/{seq:020}\"). This error fires when a key has three slash-separated segments but its middle segment differs, meaning the string was not produced by format_key or was altered.","triggerScenarios":"Thrown at src/meta/plugins/semaphore/src/storage/permit_key.rs:72 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the key has the 'queue' literal as its second-to-last segment, as emitted by format_key's '{prefix}/queue/{seq}' layout.","If a different prefix layout was used to build the key, parse it with the matching parser instead of PermitKey::parse_key.","Regenerate malformed keys or reject the stored entry so it does not reach parse_key."],"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-16T04:17:20.429Z"}