rustfs/rustfs · error · ParseConfigError

There can only be one 'prefix' in the filter rule

Error message

There can only be one 'prefix' in the filter rule

What it means

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).

Source

Thrown at crates/notify/src/rules/xml_config.rs:31

// limitations under the License.

use crate::rules::pattern;
use hashbrown::HashSet;
use rustfs_s3_types::EventName;
use rustfs_targets::arn::{ARN, ArnError, TargetIDError};
use serde::{Deserialize, Serialize};
use std::io::Read;
use thiserror::Error;

#[derive(Debug, Error)]
pub enum ParseConfigError {
    #[error("XML parsing error:{0}")]
    XmlError(#[from] quick_xml::errors::serialize::DeError),
    #[error("Invalid filter value:{0}")]
    InvalidFilterValue(String),
    #[error("Invalid filter name: {0}, only 'prefix' or 'suffix' is allowed")]
    InvalidFilterName(String),
    #[error("There can only be one 'prefix' in the filter rule")]
    DuplicatePrefixFilter,
    #[error("There can only be one 'suffix' in the filter rule")]
    DuplicateSuffixFilter,
    #[error("Missing event name")]
    MissingEventName,
    #[error("Duplicate event name:{0}")]
    DuplicateEventName(String), // EventName is usually an enum, and here String is used to represent its text
    #[error("Repeated queue configuration: ID={0:?}, ARN={1}")]
    DuplicateQueueConfiguration(Option<String>, String),
    #[error("Unsupported configuration types (e.g. Lambda, Topic)")]
    UnsupportedConfiguration,
    #[error("ARN not found:{0}")]
    ArnNotFound(String),
    #[error("Unknown area:{0}")]
    UnknownRegion(String),
    #[error("ARN parsing error:{0}")]
    ArnParseError(#[from] ArnError),
    #[error("TargetID parsing error:{0}")]

View on GitHub (pinned to 35af688cd9)

Solutions

  1. Keep only one prefix rule per filter
  2. Combine prefix intent into a single rule
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/notify/src/rules/xml_config.rs:31 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of rustfs/rustfs@35af688cd9 (2026-08-20). Data as JSON: /api/errors/850b54a5025cb986. Report an issue: GitHub.