Go: fatal: could not read Username for 'https://github.com': terminal prompts disabled
Go tried to fetch a private repository without credentials (and, via the public proxy, got 404/410).
410 Gone go get privateverifying module: 410 Gonego: module: reading https://proxy.golang.org: 404 Not Found Meaning
Tell Go the module is private with GOPRIVATE, and give git credentials non-interactively: a ~/.netrc, a git insteadOf rewrite to SSH, or a token in CI. Without GOPRIVATE Go asks the public proxy, which cannot see your repo.
Common causes
- GOPRIVATE not set
- No credentials for HTTPS git
- SSH key not available in CI/Docker
- Token expired
- Public proxy/sumdb queried for private paths
⚡ Quick fix
go env -w GOPRIVATE=github.com/yourorg/*git config --global url."git@github.com:".insteadOf "https://github.com/"- In CI use a token:
git config --global url."https://x:${TOKEN}@github.com/".insteadOf "https://github.com/"
Detailed fix by platform
Docker
- Use BuildKit secrets or SSH mounts (
RUN --mount=type=ssh go mod download) instead of baking tokens into the image
How to diagnose
- GOPRIVATE — Set?
- Auth — SSH or token?
- CI — Secrets available?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- cannot find package in any of GOROOT / GOPATH Go: cannot find package "github.com/pkg/errors" in any of: /usr/local/go/src/github.com/pkg/errors (from $GOROOT) /go/src/github.com/pkg/errors (from $GOPATH)
- E0432: unresolved import Rust: error[E0432]: unresolved import `crate::utils` — maybe a missing crate `utils`?
- E0433: failed to resolve: use of undeclared type or module Rust: error[E0433]: failed to resolve: use of undeclared type `HashMap`
Most viewed in Go
Other ways to find it
Where this error sits
Origin: Application & API. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 4 Nov 2026