kubernetes/kops · info

error hashing manifest: %v

Error message

error hashing manifest: %v

What it means

When the addons file is a direct (non-Addons) manifest, ParseAddons hashes the raw manifest content with utils.HashString to derive a stable ManifestHash. This wraps a hashing failure, which is effectively unreachable in practice but kept as defensive error handling.

Source

Thrown at channels/pkg/channels/addons.go:68

	objects, err := kubemanifest.LoadObjectsFrom([]byte(configString))
	if err != nil {
		return nil, fmt.Errorf("error parsing addons or manifest: %v", err)
	}

	apiObject := &api.Addons{}
	if len(objects) == 0 {
		// No objects (empty, whitespace, or comment-only content): nothing to apply.
	} else if gvk := objects[0].GroupVersionKind(); gvk.Kind == "Addons" && gvk.Group == "" && gvk.Version == "" {
		// Reuse the document already parsed by LoadObjectsFrom instead of parsing it again.
		if err := objects[0].Reparse(apiObject); err != nil {
			return nil, fmt.Errorf("error parsing addons: %v", err)
		}
	} else {
		manifest := location.String()
		manifestHash, err := utils.HashString(configString)
		if err != nil {
			return nil, fmt.Errorf("error hashing manifest: %v", err)
		}
		manifestLocationHash, err := utils.HashString(manifest)
		if err != nil {
			return nil, fmt.Errorf("error hashing manifest location: %v", err)
		}
		addonName := "manifest-" + manifestLocationHash[:12]
		addonSpec := &api.AddonSpec{
			Name:         &addonName,
			Manifest:     &manifest,
			ManifestHash: manifestHash,
		}

		apiObject.Kind = "Addons"
		apiObject.ObjectMeta.Name = addonName
		apiObject.Spec.Addons = []*api.AddonSpec{addonSpec}
	}

	return &Addons{ChannelName: name, ChannelLocation: *location, APIObject: apiObject}, nil

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Rebuild/reinstall the kops or channels binary.
  2. Retry the operation; the failure is transient at worst.
  3. If reproducible, file an upstream bug including the manifest input, since HashString should never fail on strings.
Defensive patterns

Strategy: fallback

Try / catch

addons, err := channels.ParseAddons(name, location, data)
if err != nil {
	if strings.Contains(err.Error(), "error hashing manifest") {
		// not input-related; treat as internal failure and retry
		retryWithBackoff(2, func() error { _, err = channels.ParseAddons(name, location, data); return err })
	}
	return err
}

Prevention

When it happens

Trigger: LoadAddons -> ParseAddons on the else-branch (direct manifest) where utils.HashString(configString) returns non-nil. HashString has no realistic failure mode for string input; only a corrupted binary or allocator failure could trigger it.

Common situations: Practically never hit by users; would indicate a corrupted build or out-of-memory condition rather than bad input.

Related errors


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