{"record":{"id":"e8c46302c4288ae8","repo":"GoogleContainerTools/skaffold","slug":"unable-to-re-marshal-yaml-without-dotted-keys-w","errorCode":null,"errorMessage":"unable to re-marshal YAML without dotted keys: %w","messagePattern":"unable to re-marshal YAML without dotted keys: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/schema/versions.go","lineNumber":239,"sourceCode":"\tif config, err := ParseConfig(file); err == nil && config != nil {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// ParseConfig reads a configuration file.\nfunc ParseConfig(filename string) ([]util.VersionedConfig, error) {\n\tbuf, err := misc.ReadConfiguration(filename)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"read skaffold config: %w\", err)\n\t}\n\tfactories, err := configFactoryFromAPIVersion(buf)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbuf, err = removeYamlAnchors(buf)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to re-marshal YAML without dotted keys: %w\", err)\n\t}\n\treturn parseConfig(buf, factories)\n}\n\n// ParseConfigAndUpgrade reads a configuration file and upgrades it to a given version.\nfunc ParseConfigAndUpgrade(filename string) ([]util.VersionedConfig, error) {\n\tconfigs, err := ParseConfig(filename)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn UpgradeTo(configs, latest.Version)\n}\n\n// configFactoryFromAPIVersion checks that all configs in the input stream have the same API version, and returns a function to create a config with that API version.\nfunc configFactoryFromAPIVersion(buf []byte) ([]func() util.VersionedConfig, error) {\n\t// This is to quickly check that it's possibly a skaffold.yaml,\n\t// without parsing the whole file.","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/schema/versions.go#L221-L257","documentation":"During parsing, Skaffold re-marshals the YAML after removing anchors/dotted keys so downstream decoders see normalized YAML. If that re-marshal step fails, ParseConfig returns this wrapped error. It indicates the YAML round-trip could not be serialized, usually due to unsupported constructs produced by the decode step.","triggerScenarios":"Calling ParseConfig on a file whose YAML, after removeYamlAnchors processing, cannot be re-marshaled — e.g. exotic key types or constructs the marshal step cannot represent.","commonSituations":"Highly unusual YAML in skaffold.yaml (odd key types, corrupt encoding); a bug/edge case in the anchor-removal pipeline triggered by unusual document structure.","solutions":["Simplify the YAML in skaffold.yaml: remove dotted keys and non-standard constructs","Replace YAML anchors/merge keys with explicit values to avoid the rewrite path","Bisect by halving the config file to find the offending document/section","Inspect the wrapped cause (%w) for the marshal error detail"],"exampleFix":"# before (dotted key)\n.x-custom: value\napiVersion: skaffold/v4beta7\n# after\napiVersion: skaffold/v4beta7","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"configs, err := schema.ParseConfig(cfgPath)\nif err != nil {\n\tvar reErr *fmt.Errorf\n\tif strings.Contains(err.Error(), \"re-marshal YAML without dotted keys\") {\n\t\t// simplify YAML: remove dotted keys/anchors, then retry once\n\t}\n\treturn err\n}","preventionTips":["Avoid dotted top-level keys and exotic YAML constructs in skaffold.yaml","Prefer explicit values over anchors/merge keys","Keep a canonical, lint-clean skaffold.yaml"],"tags":["skaffold","config-loading","yaml-parsing"],"backgroundTag":"yaml-parse-error","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}