{"record":{"id":"b55a333847d31bb0","repo":"libnyanpasu/clash-nyanpasu","slug":"field-field-is-not-a-sequence-skipped","errorCode":null,"errorMessage":"field `{field}` is not a sequence, skipped","messagePattern":"field `(.+?)` is not a sequence, skipped","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"backend/nyanpasu-config/src/runtime/executor/overlay.rs","lineNumber":73,"sourceCode":"    value: &ConfigValue,\n    prepend: bool,\n    logs: &mut Vec<StepLogEntry>,\n) -> ConfigValue {\n    let Some(to_merge) = value.as_array_arc() else {\n        logs.push(StepLogEntry::warn(format!(\n            \"merge value for `{field}` is not a sequence, skipped\"\n        )));\n        return config;\n    };\n    let segments = parse_dotted_path(field);\n    let Some(target) = get_at(&config, &segments) else {\n        logs.push(StepLogEntry::warn(format!(\n            \"field `{field}` not found, skipped\"\n        )));\n        return config;\n    };\n    let Some(existing) = target.as_array_arc() else {\n        logs.push(StepLogEntry::warn(format!(\n            \"field `{field}` is not a sequence, skipped\"\n        )));\n        return config;\n    };\n\n    let items: Vec<ConfigValue> = if prepend {\n        to_merge\n            .iter()\n            .cloned()\n            .chain(existing.iter().cloned())\n            .collect()\n    } else {\n        existing\n            .iter()\n            .cloned()\n            .chain(to_merge.iter().cloned())\n            .collect()\n    };","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/libnyanpasu/clash-nyanpasu/blob/f7dbce2997c633e484f54788035e770b3ee99773/backend/nyanpasu-config/src/runtime/executor/overlay.rs#L55-L91","documentation":"This warning is emitted by splice_sequence when an overlay step tries to prepend/append items to a field, but the field exists in the config yet is not an array. The executor is 'never-fail': instead of erroring or panicking, it logs a warning and returns the config unchanged for that step.","triggerScenarios":"Calling apply_overlay with a splice (prepend/append) step whose dotted field path resolves to an object, string, or number rather than an array.","commonSituations":"Config mistakes where a user defines `rules` or `proxies` as a string or mapping instead of a YAML/JSON list; schema migrations changing a field's shape; typos pointing at a scalar field.","solutions":["Verify the target field in the base config is an actual array (e.g. a YAML list, not a string or mapping)","Fix the dotted path in the splice step to point at the correct sequence field","Convert the field to an array in the source profile","Inspect the emitted StepLogEntry logs to identify which step failed and correct that step's field"],"exampleFix":"// before (field holds a string)\nrules: \"MATCH,DIRECT\"\n// after\nrules:\n  - MATCH,DIRECT","handlingStrategy":"validation","validationCode":"if let Some(field) = config.get_path(\"rules\") {\n    if !matches!(field, ConfigValue::Array(_)) {\n        eprintln!(\"splice target `rules` is not a sequence; fix the profile before applying overlay\");\n    }\n}","typeGuard":"fn is_sequence(v: &ConfigValue) -> bool { matches!(v, ConfigValue::Array(_)) }","tryCatchPattern":null,"preventionTips":["Always define list fields (rules, proxies, proxy-groups) as YAML/JSON arrays","Validate the base profile shape before running overlay steps","Check StepLogEntry warnings after apply_overlay to catch skipped splices early"],"tags":["config","overlay","sequence"],"backgroundTag":"config-type-mismatch","analyzedSha":"f7dbce2997c633e484f54788035e770b3ee99773","analyzedAt":"2026-09-08T01:24:59.197Z","contentChangedAt":"2026-09-08T01:24:59.197Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}