{"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":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/main.rs","lineNumber":261,"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":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/dani-garcia/vaultwarden/blob/cc67d644f62605cb46f4d16c4a2eed1a861cc8bb/src/main.rs#L243-L279","documentation":"The per-module overrides portion of LOG_LEVEL (comma-separated log=level pairs) is parsed with LevelFilter::from_str per pair; pairs that fail are silently dropped by filter_map, and if none survive (or the captures section fails) this error is returned.","triggerScenarios":"LOG_LEVEL matches the level regex but contains invalid level tokens in the override list, e.g. LOG_LEVEL='info,vaultwarden::api::icons=verbose' or LOG_LEVEL='info,foo='.","commonSituations":"Using levels from other logging libraries ('warning', 'fatal'); trailing commas producing empty tokens; forgetting the '=' in a pair; copying LOG_LEVEL syntax from tracing/env_logger which differs.","solutions":["Use only valid Rust log levels in overrides: off/error/warn/info/debug/trace","Ensure each override is module=level, e.g. vaultwarden::api::icons=debug","Remove empty segments/trailing commas from LOG_LEVEL","Fall back to a plain global level like LOG_LEVEL=info to isolate the bad token"],"exampleFix":"// before\nLOG_LEVEL=info,vaultwarden::api::icons=warning\n// after\nLOG_LEVEL=info,vaultwarden::api::icons=warn","handlingStrategy":"validation","validationCode":"const VALID = ['off','error','warn','info','debug','trace'];\nfor (const part of (process.env.LOG_LEVEL ?? '').split(',').slice(1)) {\n  const [mod, lvl] = part.split('=');\n  if (!mod || !VALID.includes((lvl ?? '').trim().toLowerCase())) throw new Error(`Bad LOG_LEVEL override: \"${part}\"`);\n}","typeGuard":"function parseOverride(part) { const i = part.lastIndexOf('='); const mod = part.slice(0, i); const lvl = part.slice(i + 1); return i > 0 && ['off','error','warn','info','debug','trace'].includes(lvl) ? [mod, lvl] : null; }","tryCatchPattern":null,"preventionTips":["Format overrides strictly as module=level, comma-separated","Use only off/error/warn/info/debug/trace for override levels","Avoid trailing commas and empty segments","Test the full LOG_LEVEL string locally before rollout"],"tags":["logging","config","parsing"],"backgroundTag":"invalid-config-value","analyzedSha":"cc67d644f62605cb46f4d16c4a2eed1a861cc8bb","analyzedAt":"2026-09-19T08:28:46.370Z","contentChangedAt":"2026-09-19T08:28:46.370Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}