invalid version: unknown revision Go Origin: Application & API OSI layer 7 · Application Last updated 4 Nov 2026

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.

Exact message you may see 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
Seen on: Go Git

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

  1. git ls-remote --tags <repo> to confirm the tag
  2. GOFLAGS=-mod=mod GOPROXY=direct go get module@version
  3. Set GOPRIVATE=github.com/yourorg/*

Detailed fix by platform

Go

  1. go env -w GOPRIVATE=github.com/yourorg/*

How to diagnose

  1. Tag — Exists remotely?
  2. Access — Private?
  3. 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:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

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) (Go)cannot find package i…E0432: unresolved import — Rust: error[E0432]: unresolved import `crate::utils` — maybe a missing crate `utils`? (Rust)E0432: unresolved imp…E0433: failed to resolve: use of undeclared type or module — Rust: error[E0433]: failed to resolve: use of undeclared type `HashMap` (Rust)E0433: failed to reso…E0603: module/function/struct is private — Rust: error[E0603]: function `helper` is private (Rust)E0603: module/functio…go: updates to go.mod needed — Go: go: updates to go.mod needed; to update it: go mod tidy (Go)go: updates to go.mod…listen tcp :8080: bind: address already in use — Go: listen tcp :8080: bind: address already in use (Go)listen tcp :8080: bin…missing go.sum entry — Go: missing go.sum entry for module providing package github.com/pkg/errors (imported by app); to add: go get app (Go)missing go.sum entryno required module provides package — Go: no required module provides package github.com/foo/bar; to add it: go get github.com/foo/bar (Go)no required module pr…invalid v…

Explore the map of this error Full error map →

🧠 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.