{"record":{"id":"850b54a5025cb986","repo":"rustfs/rustfs","slug":"there-can-only-be-one-prefix-in-the-filter-rule","errorCode":null,"errorMessage":"There can only be one 'prefix' in the filter rule","messagePattern":"There can only be one 'prefix' in the filter rule","errorType":"validation","errorClass":"ParseConfigError","httpStatus":null,"severity":"error","filePath":"crates/notify/src/rules/xml_config.rs","lineNumber":31,"sourceCode":"// limitations under the License.\n\nuse crate::rules::pattern;\nuse hashbrown::HashSet;\nuse rustfs_s3_types::EventName;\nuse rustfs_targets::arn::{ARN, ArnError, TargetIDError};\nuse serde::{Deserialize, Serialize};\nuse std::io::Read;\nuse thiserror::Error;\n\n#[derive(Debug, Error)]\npub enum ParseConfigError {\n    #[error(\"XML parsing error:{0}\")]\n    XmlError(#[from] quick_xml::errors::serialize::DeError),\n    #[error(\"Invalid filter value:{0}\")]\n    InvalidFilterValue(String),\n    #[error(\"Invalid filter name: {0}, only 'prefix' or 'suffix' is allowed\")]\n    InvalidFilterName(String),\n    #[error(\"There can only be one 'prefix' in the filter rule\")]\n    DuplicatePrefixFilter,\n    #[error(\"There can only be one 'suffix' in the filter rule\")]\n    DuplicateSuffixFilter,\n    #[error(\"Missing event name\")]\n    MissingEventName,\n    #[error(\"Duplicate event name:{0}\")]\n    DuplicateEventName(String), // EventName is usually an enum, and here String is used to represent its text\n    #[error(\"Repeated queue configuration: ID={0:?}, ARN={1}\")]\n    DuplicateQueueConfiguration(Option<String>, String),\n    #[error(\"Unsupported configuration types (e.g. Lambda, Topic)\")]\n    UnsupportedConfiguration,\n    #[error(\"ARN not found:{0}\")]\n    ArnNotFound(String),\n    #[error(\"Unknown area:{0}\")]\n    UnknownRegion(String),\n    #[error(\"ARN parsing error:{0}\")]\n    ArnParseError(#[from] ArnError),\n    #[error(\"TargetID parsing error:{0}\")]","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/rustfs/rustfs/blob/35af688cd9d41b4346fbe27dcf7250ba72046c1f/crates/notify/src/rules/xml_config.rs#L13-L49","documentation":"The notification XML declares more than one prefix FilterRule in a single filter. S3 semantics allow at most one prefix and one suffix per filter; the parser rejects the second prefix (sentinel DuplicatePrefixFilter).","triggerScenarios":"Thrown at crates/notify/src/rules/xml_config.rs:31 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Keep only one prefix rule per filter","Combine prefix intent into a single rule"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"35af688cd9d41b4346fbe27dcf7250ba72046c1f","analyzedAt":"2026-08-20T21:57:04.799Z","contentChangedAt":"2026-08-20T21:57:04.799Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}