{"record":{"id":"66ec70140484aa59","repo":"golang/go","slug":"non-specific-origin-66ec70","errorCode":null,"errorMessage":"non-specific origin","messagePattern":"non-specific origin","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/cmd/go/internal/modfetch/codehost/vcs.go","lineNumber":413,"sourceCode":"\t\t\treturn nil\n\t\t}\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"looking up hash: %v\", err)\n\t\t}\n\t\treturn fmt.Errorf(\"hash changed\") // weird but maybe they made a tag\n\t}\n\n\tif old.Ref != \"\" && old.RepoSum == \"\" {\n\t\thash, err := r.lookupRef(ctx, old.Ref)\n\t\tif err == nil && hash != \"\" && hash == old.Hash {\n\t\t\treturn nil\n\t\t}\n\t}\n\n\tr.repoSumOnce.Do(func() { r.loadRepoSum(ctx) })\n\tif r.repoSum != \"\" {\n\t\tif old.RepoSum == \"\" {\n\t\t\treturn fmt.Errorf(\"non-specific origin\")\n\t\t}\n\t\tif old.RepoSum != r.repoSum {\n\t\t\treturn fmt.Errorf(\"repo changed\")\n\t\t}\n\t\treturn nil\n\t}\n\treturn fmt.Errorf(\"vcs %s: CheckReuse: %w\", r.cmd.vcs, errors.ErrUnsupported)\n}\n\nfunc (r *vcsRepo) Tags(ctx context.Context, prefix string) (*Tags, error) {\n\tunlock, err := r.mu.Lock()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer unlock()\n\n\tr.tagsOnce.Do(func() { r.loadTags(ctx) })\n\ttags := &Tags{","sourceCodeStart":395,"sourceCodeEnd":431,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/cmd/go/internal/modfetch/codehost/vcs.go#L395-L431","documentation":"CheckReuse's repoSum branch: the current repo produced a non-empty RepoSum but old.RepoSum is empty, meaning the cached origin was recorded without a repo sum (older client or partial cache). Reuse is refused because the old origin is too vague to safely compare.","triggerScenarios":"loadRepoSum populates r.repoSum, but old.RepoSum==\"\" — the prior origin predates repoSum support or was stored incompletely. Refers to the origin record being 'non-specific' rather than the module path.","commonSituations":"Mixing go toolchain versions across the same module cache (an older Go wrote an origin without RepoSum, a newer Go reads it); cache entry written by an interrupted download.","solutions":["`go clean -modcache` then re-download with the current toolchain — the new origin will carry a RepoSum.","Standardise on a single Go toolchain version across the team to avoid origin-schema mismatches.","Use GOPROXY so origins are always freshly minted by the proxy rather than persisted from mixed clients."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"func originHasRepoSum(o *codehost.Origin) bool {\n    return o != nil && o.RepoSum != \"\"\n}","typeGuard":null,"tryCatchPattern":"if err := repo.CheckReuse(ctx, old, subdir); err != nil {\n    if strings.Contains(err.Error(), \"non-specific origin\") {\n        // old cache entry from older toolchain — re-download\n    }\n}","preventionTips":["Standardise the Go toolchain version across the team to keep origin records consistent.","Periodically `go clean -modcache` when upgrading major Go versions."],"tags":["vcs","checkreuse","reposum","cache","toolchain-version"],"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-12T08:17:17.861Z"}