{"record":{"id":"4ca4140db1f5d5d0","repo":"libnyanpasu/clash-nyanpasu","slug":"field-field-not-found-skipped","errorCode":null,"errorMessage":"field `{field}` not found, skipped","messagePattern":"field `(.+?)` not found, skipped","errorType":"console","errorClass":"StepLogEntry","httpStatus":null,"severity":"warning","filePath":"backend/nyanpasu-config/src/runtime/executor/overlay.rs","lineNumber":106,"sourceCode":"            .cloned()\n            .chain(to_merge.iter().cloned())\n            .collect()\n    };\n    replace_at(&config, &segments, ConfigValue::Array(Arc::from(items))).unwrap_or(config)\n}\n\nfn override_path(\n    config: ConfigValue,\n    field: &str,\n    value: &ConfigValue,\n    logs: &mut Vec<StepLogEntry>,\n) -> ConfigValue {\n    let segments = parse_dotted_path(field);\n    match replace_at(&config, &segments, value.clone()) {\n        Some(next) => next,\n        None => {\n            // Legacy: override does NOT create missing paths (merge.rs:292-304).\n            logs.push(StepLogEntry::warn(format!(\n                \"field `{field}` not found, skipped\"\n            )));\n            config\n        }\n    }\n}\n\n/// Bare key: deep-merge for maps, wholesale replace otherwise, insert when\n/// absent (merge.rs:8-24, 310-312). Original key case preserved.\nfn bare_key_merge(config: ConfigValue, key: &Arc<str>, data: &ConfigValue) -> ConfigValue {\n    let existing = config\n        .as_object_arc()\n        .and_then(|map| map.get(key.as_ref()))\n        .cloned();\n    let merged = deep_merge_value(existing.as_ref(), data);\n    super::value_util::obj_insert(&config, key.as_ref(), merged)\n}\n","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/libnyanpasu/clash-nyanpasu/blob/f7dbce2997c633e484f54788035e770b3ee99773/backend/nyanpasu-config/src/runtime/executor/overlay.rs#L88-L124","documentation":"This is not a panic but a warning entry pushed into the overlay executor's step log: `override_path` failed to find the dotted path `field` in the config tree, so the override value was skipped. Legacy overlay semantics (matching merge.rs:292-304) intentionally do NOT create missing paths on override — the target key must already exist. The call still succeeds; the skip is recorded for diagnostics.","triggerScenarios":"Calling `apply_overlay`/`override_path` with a patch key whose dotted path does not resolve in the current config, e.g. overriding `verge.some_new_field` when `verge.some_new_field` is absent, or any typo in a nested key name.","commonSituations":"Merge/patch files written for a newer config schema applied to an older config; typos in overlay YAML/JSON keys; profile enhance chains referencing fields removed after a config migration.","solutions":["Check the dotted path spelling and that the parent chain exists in the target config.","Use a `merge`/`set` step (which creates missing paths) instead of `override` when you intend to add new fields.","Run the overlay with step-log inspection enabled and fix each reported 'field not found' key.","Regenerate overlay files against the current config schema after app version upgrades."],"exampleFix":"// before (field absent -> skipped)\noverride:\n  verge.enable_tun_mode: true\n// after (create the field explicitly via set/merge)\nset:\n  verge.enable_tun_mode: true\noverride:\n  verge.existing_field: true","handlingStrategy":"validation","validationCode":"fn field_exists(config: &ConfigValue, field: &str) -> bool {\n    let segments = parse_dotted_path(field);\n    let mut cur = config;\n    for seg in &segments {\n        match cur.get(seg) {\n            Some(next) => cur = next,\n            None => return false,\n        }\n    }\n    true\n}\n// use: field_exists(&config, \"verge.enable_tun_mode\")","typeGuard":null,"tryCatchPattern":"// inspect the step log returned by apply_overlay\nfor entry in result.log.iter().filter(|e| e.level == Warn) {\n    if entry.message.contains(\"not found, skipped\") {\n        eprintln!(\"overlay skipped: {}\", entry.message);\n    }\n}","preventionTips":["Validate overlay keys against the current config schema before applying","Use merge/set steps for new fields; reserve override for existing paths","Review step-log warnings after every enhance chain run","Regenerate overlays after config schema migrations"],"tags":["config","overlay","patch","rust"],"backgroundTag":"missing-config-key","analyzedSha":"f7dbce2997c633e484f54788035e770b3ee99773","analyzedAt":"2026-09-08T01:24:59.197Z","contentChangedAt":"2026-09-08T01:24:59.197Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}