{"record":{"id":"eaee2604fddb3031","repo":"dani-garcia/vaultwarden","slug":"failed-to-parse-overrides","errorCode":null,"errorMessage":"Failed to parse overrides","messagePattern":"Failed to parse overrides","errorType":"console","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/main.rs","lineNumber":263,"sourceCode":"        let level = caps\n            .get(1)\n            .and_then(|m| log::LevelFilter::from_str(m.as_str()).ok())\n            .ok_or(Error::new(\"Failed to parse global log level\".to_owned(), \"\"))?;\n\n        let levels_override: Vec<(&str, log::LevelFilter)> = caps\n            .get(2)\n            .map(|m| {\n                m.as_str()\n                    .split(',')\n                    .collect::<Vec<&str>>()\n                    .into_iter()\n                    .filter_map(|s| match s.split_once('=') {\n                        Some((log, lvl_str)) => log::LevelFilter::from_str(lvl_str).ok().map(|lvl| (log, lvl)),\n                        _ => None,\n                    })\n                    .collect()\n            })\n            .ok_or(Error::new(\"Failed to parse overrides\".to_owned(), \"\"))?;\n\n        (level, levels_override)\n    } else {\n        err!(format!(\"LOG_LEVEL should follow the format info,vaultwarden::api::icons=debug, invalid: {config_str}\"))\n    };\n\n    // Depending on the main log level we either want to disable or enable logging for hickory.\n    // Else if there are timeouts it will clutter the logs since hickory uses warn for this.\n    let hickory_level = if level >= log::LevelFilter::Debug {\n        level\n    } else {\n        log::LevelFilter::Off\n    };\n\n    // Only show Rocket underscore `_` logs when the level is Debug or higher\n    // Else this will bloat the log output with useless messages.\n    let rocket_underscore_level = if level >= log::LevelFilter::Debug {\n        log::LevelFilter::Warn","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/dani-garcia/vaultwarden/blob/0cefa4cca7c9f2a5579dd290f78193b543818c51/src/main.rs#L245-L281","documentation":"In the same init_logging() pass, capture group 2 carries the comma-separated ',target=level' override tail. This error fires only when caps.get(2) returns None (.ok_or on the Option). The regex lets the group repeat zero times, and a zero-repetition group still participates as an empty match, so Some(\"\") is returned and this branch is effectively unreachable. Individual malformed override pairs are silently dropped by filter_map rather than reported.","triggerScenarios":"Only if the regex or capture layout changes so group 2 does not participate — e.g. a fork rewriting the pattern; the stock parser cannot produce this error for any input string.","commonSituations":"Essentially theoretical; shows up in static analysis / panic-path audits of the expect chain rather than real logs. Real override problems surface as silently dropped overrides or the sibling format error.","solutions":["Treat any occurrence as a build anomaly: diff init_logging() in src/main.rs against upstream","Validate LOG_LEVEL against the documented format and restart","Report upstream if a stock build reproduces it, since it indicates a regex/capture regression"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Same pre-start check; also list overrides so silent drops are visible\npython3 - <<'EOF'\nimport os, re, sys\nlvl = r'off|error|warn|info|debug|trace'\nv = os.environ.get('LOG_LEVEL', 'info').strip().lower()\nm = re.fullmatch(rf'({lvl})((,[^,=]+=({lvl}))*)', v)\nif not m:\n    sys.exit('LOG_LEVEL format invalid')\nfor part in m.group(2).split(','):\n    if part:\n        print('override:', part)\nEOF","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep LOG_LEVEL simple (a global level) unless overrides are needed","Re-test logging config after upgrades; the regex is regenerated from LevelFilter::iter","If forking, re-check capture-group participation after editing the regex"],"tags":["rust","configuration","logging","startup","dead-code"],"backgroundTag":null,"analyzedSha":"0cefa4cca7c9f2a5579dd290f78193b543818c51","analyzedAt":"2026-08-16T07:44:56.102Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}