{"record":{"id":"5d26be1ad5ff1088","repo":"mikefarah/yq","slug":"unsupported-node-v","errorCode":null,"errorMessage":"unsupported node %v","messagePattern":"unsupported node (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/yqlib/encoder_properties.go","lineNumber":112,"sourceCode":"\n\tswitch node.Kind {\n\tcase ScalarNode:\n\t\tvar nodeValue string\n\t\tif pe.prefs.UnwrapScalar || !strings.Contains(node.Value, \" \") {\n\t\t\tnodeValue = node.Value\n\t\t} else {\n\t\t\tnodeValue = fmt.Sprintf(\"%q\", node.Value)\n\t\t}\n\t\t_, _, err := p.Set(path, nodeValue)\n\t\treturn err\n\tcase SequenceNode:\n\t\treturn pe.encodeArray(p, node.Content, path)\n\tcase MappingNode:\n\t\treturn pe.encodeMap(p, node.Content, path)\n\tcase AliasNode:\n\t\treturn pe.doEncode(p, node.Alias, path, nil)\n\tdefault:\n\t\treturn fmt.Errorf(\"unsupported node %v\", node.Tag)\n\t}\n}\n\nfunc (pe *propertiesEncoder) appendPath(path string, key interface{}) string {\n\tif path == \"\" {\n\t\treturn fmt.Sprintf(\"%v\", key)\n\t}\n\tswitch key.(type) {\n\tcase int:\n\t\tif pe.prefs.UseArrayBrackets {\n\t\t\treturn fmt.Sprintf(\"%v[%v]\", path, key)\n\t\t}\n\n\t}\n\treturn fmt.Sprintf(\"%v.%v\", path, key)\n}\n\nfunc (pe *propertiesEncoder) encodeArray(p *properties.Properties, kids []*CandidateNode, path string) error {","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/mikefarah/yq/blob/8b5af0694bb82b41d4ae180fac9972029066f90a/pkg/yqlib/encoder_properties.go#L94-L130","documentation":"The properties (.properties) encoder can only emit scalars, sequences, mappings, and aliases; any other node Kind/Tag reaching doEncode's default branch produces 'unsupported node %v' with the node's Tag. Properties files are flat key=value, so exotic node shapes cannot be represented.","triggerScenarios":"Encoding to `-o props`/`-o properties` a document containing a node kind outside the handled set — typically a scalar/null at the root reached through nested doEncode recursion, or custom-typed nodes whose resolved kind falls through.","commonSituations":"Converting YAML with merge-key documents or comment-only documents to properties; encoding a bare scalar document (`yq -o props '.' scalar.yaml`); expressions yielding unusual node structures.","solutions":["Wrap the output in a map: `yq -o props '{value: .}'` so the root is a MappingNode.","Inspect the document shape with `yq -o json '.'` and remove/replace unsupported nodes.","Coerce custom-typed nodes to plain scalars with `tostring` or retag with `tag=\"!!str\"`.","Use json/yaml output for structures properties cannot express."],"exampleFix":"# before\nyq -o props '.' scalar.yaml   # scalar root -> unsupported node\n\n# after\nyq -o props '{\"value\": .}' scalar.yaml","handlingStrategy":"type-guard","validationCode":"kind=$(yq 'kind' file.yaml); case \"$kind\" in mapping|scalar) ;; *) echo \"unsupported for props: $kind\";; esac","typeGuard":"isPropsSafe() { case \"$(yq 'kind' \"$1\")\" in mapping) return 0;; *) return 1;; esac; }","tryCatchPattern":"yq -o props '.' file.yaml || yq -o props '{value: .}' file.yaml","preventionTips":["Wrap scalar/list roots in a map before -o props","Retag custom-typed nodes to plain scalars","Preview shape with -o json first"],"tags":["properties","encoder","node-kind"],"backgroundTag":"encoder-unsupported-node-kind","analyzedSha":"8b5af0694bb82b41d4ae180fac9972029066f90a","analyzedAt":"2026-09-05T10:57:22.766Z","contentChangedAt":"2026-09-05T10:57:22.766Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}