{"record":{"id":"4fefb34fc160d2e4","repo":"hashicorp/nomad","slug":"errmismatchchecksum","errorCode":"errMismatchChecksum","errorMessage":"mismatch checksum","messagePattern":"mismatch checksum","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"api/ioutil.go","lineNumber":16,"sourceCode":"// Copyright IBM Corp. 2015, 2026\n// SPDX-License-Identifier: MPL-2.0\n\npackage api\n\nimport (\n\t\"crypto/sha256\"\n\t\"crypto/sha512\"\n\t\"encoding/base64\"\n\t\"errors\"\n\t\"hash\"\n\t\"io\"\n\t\"strings\"\n)\n\nvar errMismatchChecksum = errors.New(\"mismatch checksum\")\n\n// checksumValidatingReader is a wrapper reader that validates\n// the checksum of the underlying reader.\ntype checksumValidatingReader struct {\n\tr io.ReadCloser\n\n\t// algo is the hash algorithm (e.g. `sha-256`)\n\talgo string\n\n\t// checksum is the base64 component of checksum\n\tchecksum string\n\n\t// hash is the hashing function used to compute the checksum\n\thash hash.Hash\n}\n\n// newChecksumValidatingReader returns a checksum-validating wrapper reader, according\n// to a digest received in HTTP header","sourceCodeStart":1,"sourceCodeEnd":34,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/api/ioutil.go#L1-L34","documentation":"Sentinel errMismatchChecksum from checksumValidatingReader: after fully reading the artifact, the computed hash's base64 does not match the expected checksum (e.g. from a Content-Checkum/manifest), so the downloaded content is corrupt or the wrong file.","triggerScenarios":"Thrown at api/ioutil.go:16 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-download the artifact; the transfer may have been corrupted","Verify the expected checksum matches the actual file contents","Ensure the hashing algorithm (algo field) matches how the checksum was produced"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}