{"record":{"id":"1d2032f7fa567969","repo":"golang/go","slug":"verifying-s-v","errorCode":null,"errorMessage":"verifying %s: %v","messagePattern":"verifying (.+?): (.+?)","errorType":"exception","errorClass":"module.VersionError","httpStatus":null,"severity":"error","filePath":"src/cmd/go/internal/modfetch/fetch.go","lineNumber":860,"sourceCode":"\tif len(f.sumState.m[mod]) > 0 {\n\t\tfmt.Fprintf(os.Stderr, \"warning: verifying %s@%s: unknown hashes in go.sum: %v; adding %v\"+hashVersionMismatch, mod.Path, mod.Version, strings.Join(f.sumState.m[mod], \", \"), h)\n\t}\n\tf.sumState.m[mod] = append(f.sumState.m[mod], h)\n}\n\n// checkSumDB checks the mod, h pair against the Go checksum database.\n// It calls base.Fatalf if the hash is to be rejected.\nfunc checkSumDB(mod module.Version, h string) error {\n\tmodWithoutSuffix := mod\n\tnoun := \"module\"\n\tif before, found := strings.CutSuffix(mod.Version, \"/go.mod\"); found {\n\t\tnoun = \"go.mod\"\n\t\tmodWithoutSuffix.Version = before\n\t}\n\n\tdb, lines, err := lookupSumDB(mod)\n\tif err != nil {\n\t\treturn module.VersionError(modWithoutSuffix, fmt.Errorf(\"verifying %s: %v\", noun, err))\n\t}\n\n\thave := mod.Path + \" \" + mod.Version + \" \" + h\n\tprefix := mod.Path + \" \" + mod.Version + \" h1:\"\n\tfor _, line := range lines {\n\t\tif line == have {\n\t\t\treturn nil\n\t\t}\n\t\tif strings.HasPrefix(line, prefix) {\n\t\t\treturn module.VersionError(modWithoutSuffix, fmt.Errorf(\"verifying %s: checksum mismatch\\n\\tdownloaded: %v\\n\\t%s: %v\"+sumdbMismatch, noun, h, db, line[len(prefix)-len(\"h1:\"):]))\n\t\t}\n\t}\n\treturn module.VersionError(modWithoutSuffix, fmt.Errorf(\"verifying %s: checksum missing from sumdb response\"+sumdbAbsent, noun))\n}\n\n// Sum returns the checksum for the downloaded copy of the given module,\n// if present in the download cache.\nfunc Sum(ctx context.Context, mod module.Version) string {","sourceCodeStart":842,"sourceCodeEnd":878,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/cmd/go/internal/modfetch/fetch.go#L842-L878","documentation":"checkSumDB calls lookupSumDB to fetch checksum lines from the configured Go checksum database (sum.golang.org by default). If lookupSumDB returns an error — DNS failure, TLS problem, HTTP 5xx, GONOSUMDB/SUMDB misconfiguration, or GONOSUMCHECK disabled — it is wrapped as 'verifying {module|go.mod}:'.","triggerScenarios":"lookupSumDB returns err != nil before any lines are inspected. The wrap attaches noun (module or go.mod) and the proxy/db identifier.","commonSituations":"Air-gapped network blocking sum.golang.org; corporate MITM proxy that breaks TLS; SUMDB pointed at a private mirror that is down; GONOSUMDB set without a working private DB; transient outage of sum.golang.org.","solutions":["Verify connectivity to the configured SUMDB host (curl https://sum.golang.org) and check corporate proxy/TLS settings.","For private modules set GOPRIVATE/GONOSUMDB so they bypass the public sumdb.","Point GONOSUMDB at an internal mirror if you run one, or set GONOSUMCHECK appropriately for the environment.","Retry — sumdb outages are usually short."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Confirm sumdb reachability before running go commands that verify.\nfunc sumdbReachable(ctx context.Context, db string) error {\n    if db == \"\" { db = \"sum.golang.org\" }\n    var d net.Dialer\n    c, err := d.DialContext(ctx, \"tcp\", db+\":443\")\n    if err != nil { return err }\n    c.Close()\n    return nil\n}","typeGuard":null,"tryCatchPattern":"// Retry sumdb lookups with backoff, then surface a clear network error.\nvar lastErr error\nfor i := 0; i < 3; i++ {\n    if err := modfetch.CheckSumDB(mod, h); err == nil { return nil } else { lastErr = err }\n    time.Sleep(time.Duration(1<<i) * time.Second)\n}\nreturn lastErr","preventionTips":["Set GOPRIVATE for private modules so they never hit the public sumdb.","Maintain connectivity to sum.golang.org (or your GONOSUMDB mirror) in CI.","Configure corporate TLS intercept exceptions for the sumdb host."],"tags":["checksum","sumdb","network","tls"],"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-12T06:17:24.410Z"}