{"record":{"id":"36d23ea8bde16b46","repo":"kubernetes/kops","slug":"the-sha-value-in-q-does-not-match-q-calculated-v","errorCode":null,"errorMessage":"the sha value in %q does not match %q calculated value %q","messagePattern":"the sha value in %q does not match %q calculated value %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/assets/assetcopy/copyfile.go","lineNumber":150,"sourceCode":"\tshaTarget := objectStore + shaExtension\n\tshaVFS, err := vfsContext.BuildVfsPath(shaTarget)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error building path %q: %v\", shaTarget, err)\n\t}\n\n\tshaHash, err := hashing.FromString(strings.TrimSpace(sha))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to parse sha: %q, %v\", sha, err)\n\t}\n\n\tin := bytes.NewReader(data)\n\tdataHash, err := shaHash.Algorithm.Hash(in)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to hash file %q downloaded: %v\", source, err)\n\t}\n\n\tif !shaHash.Equal(dataHash) {\n\t\treturn fmt.Errorf(\"the sha value in %q does not match %q calculated value %q\", shaTarget, source, dataHash.String())\n\t}\n\n\tklog.Infof(\"uploading %q to %q\", source, objectStore)\n\tif err := writeFile(ctx, cluster, uploadVFS, data); err != nil {\n\t\treturn err\n\t}\n\n\tb := []byte(shaHash.Hex())\n\tif err := writeFile(ctx, cluster, shaVFS, b); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc writeFile(ctx context.Context, cluster *kops.Cluster, p vfs.Path, data []byte) error {\n\tacl, err := acls.GetACL(ctx, p, cluster)\n\tif err != nil {","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/assets/assetcopy/copyfile.go#L132-L168","documentation":"Integrity guard in transferFile: the downloaded file's content hash does not match the sha recorded alongside it in the object store. The asset was corrupted in transit or the stored sha is stale, so the copy is refused.","triggerScenarios":"Thrown at pkg/assets/assetcopy/copyfile.go:150 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-download or re-upload the asset","Verify the .sha file matches the asset","Check for corrupting proxies or interrupted transfers"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}