kubernetes/kops · error

error parsing manifest: %v

Error message

error parsing manifest: %v

What it means

Returned by ParseManifest when the YAML/JSON stream itself cannot be decoded — a syntax error such as bad indentation, tabs, or an invalid scalar — before any document is deserialized into a typed object. The raw manifest is echoed to stderr and klog to aid diagnosis.

Source

Thrown at pkg/model/manifests.go:46

	"k8s.io/klog/v2"
)

// ParseManifest parses a typed set of objects from a []byte
func ParseManifest(data []byte) ([]runtime.Object, error) {
	decoder := yaml.NewYAMLOrJSONDecoder(bytes.NewReader(data), 4096)
	deser := scheme.Codecs.UniversalDeserializer()

	var objects []runtime.Object

	for {
		ext := runtime.RawExtension{}
		if err := decoder.Decode(&ext); err != nil {
			if err == io.EOF {
				break
			}
			fmt.Fprintf(os.Stderr, "%s", string(data))
			klog.Infof("manifest: %s", string(data))
			return nil, fmt.Errorf("error parsing manifest: %v", err)
		}

		obj, _, err := deser.Decode([]byte(ext.Raw), nil, nil)
		if err != nil {
			return nil, fmt.Errorf("error parsing object in manifest: %v", err)
		}

		objects = append(objects, obj)
	}

	return objects, nil
}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Validate the manifest with yamllint or `kubectl apply --dry-run=client -f`
  2. Check multi-document separators (---) and quoting of values kOps expects as strings
  3. Fix the reported line/column in the manifest supplied via AdditionalObjects or addons
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at pkg/model/manifests.go:46 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/62bb299e463aee56. Report an issue: GitHub.