{"record":{"id":"c29c8d5b0ba6b7bd","repo":"rustfs/rustfs","slug":"configuration-validation-failed-0","errorCode":null,"errorMessage":"Configuration validation failed: {0}","messagePattern":"Configuration validation failed: (.+?)","errorType":"exception","errorClass":"ConfigError","httpStatus":null,"severity":"error","filePath":"crates/trusted-proxies/src/error/config.rs","lineNumber":39,"sourceCode":"pub enum ConfigError {\n    /// Required environment variable is missing.\n    #[error(\"Missing environment variable: {0}\")]\n    MissingEnvVar(String),\n\n    /// Environment variable exists but could not be parsed.\n    #[error(\"Failed to parse environment variable {0}: {1}\")]\n    EnvParseError(String, String),\n\n    /// A configuration value is logically invalid.\n    #[error(\"Invalid configuration value for {0}: {1}\")]\n    InvalidValue(String, String),\n\n    /// An IP address or CIDR range is malformed.\n    #[error(\"Invalid IP address or network: {0}\")]\n    InvalidIp(String),\n\n    /// Configuration failed overall validation.\n    #[error(\"Configuration validation failed: {0}\")]\n    ValidationFailed(String),\n\n    /// Two or more configuration settings are in conflict.\n    #[error(\"Configuration conflict: {0}\")]\n    Conflict(String),\n\n    /// Error reading or parsing a configuration file.\n    #[error(\"Config file error: {0}\")]\n    FileError(String),\n\n    /// General invalid configuration error.\n    #[error(\"Invalid config: {0}\")]\n    InvalidConfig(String),\n}\n\nimpl From<AddrParseError> for ConfigError {\n    fn from(err: AddrParseError) -> Self {\n        Self::InvalidIp(err.to_string())","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/rustfs/rustfs/blob/35af688cd9d41b4346fbe27dcf7250ba72046c1f/crates/trusted-proxies/src/error/config.rs#L21-L57","documentation":"The trusted-proxy configuration parsed field-by-field but failed overall (semantic) validation. Unlike InvalidIp or EnvParseError, which point at one malformed value, ValidationFailed is raised by the aggregate validate pass and its message names the cross-value rule that was broken.","triggerScenarios":"Calling the config loader's validate() (directly or as part of load) when parsed settings jointly violate an invariant — for example enabling proxy-chain validation while required companion settings (such as the trusted list itself) are absent or empty.","commonSituations":"Partial config after a deploy that added new required settings; env vars overriding a file into an inconsistent state; carrying over old config keys that no longer pass validation with new defaults.","solutions":["Read the message after 'Configuration validation failed:' — it states the exact rule that failed.","Fill in or correct the settings that rule names, then re-run the loader.","Add a pre-deploy config check that calls the same validation (see validationCode) so this fails in CI, not at startup."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// run the crate's own validator in a pre-deploy step\nif let Err(e) = trusted_proxies::config::load() {\n    eprintln!(\"config rejected before deploy: {e}\");\n    std::process::exit(1);\n}","typeGuard":null,"tryCatchPattern":"match config::load() {\n    Err(e @ ConfigError::ValidationFailed(_)) => log_and_abort(e),\n    other => other,\n}","preventionTips":["Exercise full config load in CI with production-like env.","Keep a golden config file that always validates, and diff against it on changes."],"tags":["config","validation","trusted-proxies"],"backgroundTag":"invalid-config-value","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"}