{"record":{"id":"5ae5b2debc40ffc9","repo":"kubernetes/kops","slug":"error-hashing-manifest-v-5ae5b2","errorCode":null,"errorMessage":"error hashing manifest: %v","messagePattern":"error hashing manifest: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/bootstrapchannelbuilder/addonmanifest.go","lineNumber":115,"sourceCode":"\t\tmanifestBytes, err = addonmanifests.RemapAddonManifest(a.addonSpec, a.modelContext, a.assetBuilder, manifestBytes, a.serviceAccounts)\n\t\tif err != nil {\n\t\t\tklog.Infof(\"invalid manifest: %s\", string(manifestBytes))\n\t\t\treturn fmt.Errorf(\"error remapping manifest %s: %v\", fi.ValueOf(a.Location), err)\n\t\t}\n\t}\n\n\tmanifestBytes = []byte(strings.TrimSpace(string(manifestBytes)))\n\n\tif a.buildPrune {\n\t\tif err := buildPruneDirectives(a.addonSpec, manifestBytes); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to configure pruning for %s: %w\", fi.ValueOf(a.addonSpec.Name), err)\n\t\t}\n\t}\n\n\trawManifest := string(manifestBytes)\n\tmanifestHash, err := utils.HashString(rawManifest)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error hashing manifest: %v\", err)\n\t}\n\ta.addonSpec.ManifestHash = manifestHash\n\ta.Contents = fi.NewBytesResource(manifestBytes)\n\n\treturn nil\n}\n\n// Find returns a sparsely-populated AddonManifest reflecting the stored ManagedFile: only the\n// fields needed by CheckChanges/Render/RenderTerraform (which delegate to toManagedFile) are set.\n// Render-only fields such as addonSpec and source are intentionally left nil since they have no\n// meaning for an already-materialized remote file.\nfunc (a *AddonManifest) Find(c *fi.CloudupContext) (*AddonManifest, error) {\n\tmanagedFile := a.toManagedFile()\n\tactual, err := managedFile.Find(c)\n\tif err != nil || actual == nil {\n\t\treturn nil, err\n\t}\n\ta.PublicACL = managedFile.PublicACL","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/bootstrapchannelbuilder/addonmanifest.go#L97-L133","documentation":"After producing the final raw manifest string, Normalize computes manifestHash via utils.HashString. Hashing is treated as infallible in normal operation, so any error here is unexpected (e.g. a hashing backend failure). kOps wraps it as 'error hashing manifest' because the hash is mandatory — it is stored on addonSpec.ManifestHash and used by the channels controller to detect manifest changes.","triggerScenarios":"Normalize reaches utils.HashString(rawManifest) after successful read/render/remap/prune and HashString returns an error; this is the last validation step before assigning Contents.","commonSituations":"Rare environment or dependency issue in the hash implementation; corrupted build environment; the other 99% of the time you will see this only alongside an unrelated earlier failure pattern — the manifest itself is fine.","solutions":["Read the wrapped inner error to see why HashString failed","Re-run the command; transient environmental failures often clear on retry","If it persists, check the kOps build/tooling environment (Go version, vendored utils package) for corruption","Rebuild kOps from a clean checkout (make clean && make kops) to rule out stale artifacts"],"exampleFix":"// before\nkops version: dirty build with modified vendor hashing code\n// after\ngit checkout -- . && make clean && make kops","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := m.Normalize(ctx); err != nil && strings.Contains(err.Error(), \"error hashing manifest\") {\n    // unexpected; retry once, then rebuild the kops binary from a clean tree\n    if rerr := m.Normalize(ctx); rerr != nil {\n        return rerr\n    }\n}","preventionTips":["Keep the kOps tree and vendored utils package unmodified; hash failures usually indicate a broken build","Rebuild from clean checkout if this error appears","Treat it as an environment issue first, not a manifest issue"],"tags":["addons","hashing","bootstrap-channel"],"backgroundTag":"hash-computation-failed","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}