Go: go: github.com/foo/bar@v1.2.3: invalid version: unknown revision v1.2.3
Go cannot fetch the requested module version — the tag or branch doesn't exist, the repository is private or the proxy hasn't seen it yet.
invalid version: unknown revisiongo: github.com/foo/bar@v1.2.3: invalid version: unknown revision v1.2.3invalid version: module contains a go.mod file, so module path must matchreading github.com/foo/bar/@v/list: 404 Not Foundinvalid version: git ls-remote -q origin Meaning
Verify the tag exists on the remote and is pushed. For private repos, set GOPRIVATE and configure credentials. Newly pushed tags can lag in the proxy; retry or use GOPROXY=direct. Module paths with major version >= 2 need a /v2 suffix.
Common causes
- Tag not pushed or misspelled
- Private repo without credentials
- Proxy cache delay for new tags
- Wrong major-version path
- Retracted version
⚡ Quick fix
git ls-remote --tags <repo>to confirm the tagGOFLAGS=-mod=mod GOPROXY=direct go get module@version- Set
GOPRIVATE=github.com/yourorg/*
Detailed fix by platform
Go
go env -w GOPRIVATE=github.com/yourorg/*
How to diagnose
- Tag — Exists remotely?
- Access — Private?
- Path — /v2 suffix?
🔧 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