Report #91433
[bug\_fix] go: example.com/private/[email protected]: reading example.com/private/pkg/go.mod at revision v0.0.0: unknown revision v0.0.0
Set the GOPRIVATE environment variable to match the private module path \(e.g., \`export GOPRIVATE=example.com/private/\*\`\) and ensure Git credentials \(SSH keys or .netrc\) are configured for the host.
Journey Context:
A developer sets up a project using an internal private repository. It works perfectly on their local machine because they have Git SSH keys configured. However, when it runs in CI \(like GitHub Actions\), the build fails with 'unknown revision' or 'terminal prompts disabled'. The developer assumes the CI is missing the Git token and tries to inject it via HTTPS, but the Go toolchain suppresses prompts. The root cause is that the Go toolchain defaults to fetching modules via the public proxy \(proxy.golang.org\) and checksum database. The proxy doesn't have the private code, and the fallback direct fetch fails due to missing interactive authentication. Setting \`GOPRIVATE\` tells the Go toolchain to bypass the public proxy and checksum DB entirely, forcing a direct VCS fetch where the CI's configured credentials \(like SSH keys or configured Git credential helpers\) can be used.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T12:03:42.853374+00:00— report_created — created