golang/go · error
fetching %s: %v
Error message
fetching %s: %v
What it means
Inside metaImportsForPrefix (the cached prefix-verification fetch), web.Get failed. The result is cached via setCache for the process lifetime. The %s is the import prefix; %v is the transport error.
Source
Thrown at src/cmd/go/internal/vcs/vcs.go:1152
fetchCache[importPrefix] = res
return res, nil
}
resi, _, _ := fetchGroup.Do(importPrefix, func() (resi any, err error) {
fetchCacheMu.Lock()
if res, ok := fetchCache[importPrefix]; ok {
fetchCacheMu.Unlock()
return res, nil
}
fetchCacheMu.Unlock()
url, err := urlForImportPath(importPrefix)
if err != nil {
return setCache(fetchResult{err: err})
}
resp, err := web.Get(security, url)
if err != nil {
return setCache(fetchResult{url: url, err: fmt.Errorf("fetching %s: %v", importPrefix, err)})
}
body := resp.Body
defer body.Close()
imports, err := parseMetaGoImports(body, mod)
if len(imports) == 0 {
if respErr := resp.Err(); respErr != nil {
// If the server's status was not OK, prefer to report that instead of
// an XML parse error.
return setCache(fetchResult{url: url, err: respErr})
}
}
if err != nil {
return setCache(fetchResult{url: url, err: fmt.Errorf("parsing %s: %v", resp.URL, err)})
}
if len(imports) == 0 {
err = fmt.Errorf("fetching %s: no go-import meta tag found in %s", importPrefix, resp.URL)
}
return setCache(fetchResult{url: url, imports: imports, err: err})View on GitHub (pinned to b6b368adc5)
Solutions
- Retry (the cached failure is only process-scoped)
- Verify the prefix host is reachable and serves go-import tags
- Clear module cache lock files and re-run; check GOPROXY/GONOSUMDB
Defensive patterns
Strategy: retry
Prevention
- Retry resolution on transient prefix-host failures (the failure cache is process-scoped)
- Ensure the prefix host is as reachable as the import host
When it happens
Trigger: Secondary verification fetch for a non-authoritative prefix fails, OR the initial fetch in the prefix-resolution path fails — same transport-level causes as 1140 but on the prefix host.
Common situations: Transient network errors during prefix verification; the prefix host differs from the import host and is unreachable; CDN flakiness.
Related errors
- https fetch: %v
- ReadZip: encoded file exceeds allowed size
- parsing %s: %v
- parse %s: %v
- parse %s: no go-import meta tags (%s)
AI-assisted analysis of golang/go@b6b368adc5 (2026-08-12).
Data as JSON: /api/errors/cf29c33170b0077a.
Report an issue: GitHub.