go install stops at invalid GOSUMDB: malformed verifier id
Fix it fast
Most common cause, 1 of 3GOSUMDB holds a URL or a mistyped form of sum.golang.org
Remove the custom value so Go falls back to sum.golang.org.
go env -u GOSUMDB
# only if you need a different address for the same database:
go env -w GOSUMDB="sum.golang.org https://sum.golang.google.cn"Short answer
invalid GOSUMDB: malformed verifier id means the first word of GOSUMDB is neither a checksum database Go knows nor a full name+hash+key verifier. A URL such as https://sum.golang.org, a mirror host, or a private database named without its key all fail. Run go env -u GOSUMDB, or supply the full key. Applies to Go 1.26 and 1.27.
Which cause do you have?
Print the value Go really uses and list every setting that differs from the defaults. A value with https:// or a host other than sum.golang.org points to cause 1 or 2. If go env -w seems to change nothing, cause 3 applies.
go env GOSUMDB
go env -changedThen find the line you see in this list and open its fix:
- 1GOSUMDB holds a URL or a mistyped form of sum.golang.org
go env GOSUMDB prints something like https://sum.golang.org, sum.golang.org/ or a proxy address - 2A private or third-party checksum database is named without its public key
The value is a single host such as sumdb.example.com with no plus signs in it - 3An OS, CI or editor variable overrides what go env -w stores
go env -w prints a warning about a conflicting OS environment variable, or the error appears only inside VS Code
What does the error look like?
verifying module: invalid GOSUMDB: malformed verifier idverifying go.mod: invalid GOSUMDB: malformed verifier idwarning: go env -w GOSUMDB=... does not override conflicting OS environment variable
Cause 1 of 3
GOSUMDB holds a URL or a mistyped form of sum.golang.org
You seego env GOSUMDB prints something like https://sum.golang.org, sum.golang.org/ or a proxy address
Check
The malformed verifier id error comes from the first space-separated word of GOSUMDB. Go takes only a few plain values: off, sum.golang.google.cn on its own (an alias for the same database), or sum.golang.org, whose key Go already carries, optionally followed by a URL. Any other first word must be a full verifier key, so a scheme, a trailing slash or a proxy address fails as soon as the first module needs checking.
go env GOSUMDBFix
Remove the custom value so Go falls back to sum.golang.org. To reach the same database through a different address, keep the name first and put the URL second.
go env -u GOSUMDB
# only if you need a different address for the same database:
go env -w GOSUMDB="sum.golang.org https://sum.golang.google.cn"Verify
go env GOSUMDB prints sum.golang.org (or your two-part value), and the install that failed now downloads and verifies.
go install golang.org/x/tools/gopls@latestConfirmed by go.dev
Cause 2 of 3
A private or third-party checksum database is named without its public key
You seeThe value is a single host such as sumdb.example.com with no plus signs in it
Check
Go's modules reference says the go command knows only the key of sum.golang.org, and any other database needs its public key given explicitly. The source parses that word as name+hash+key, where the hash is eight hex digits and the key is base64; a bare host has neither part, which yields malformed verifier id.
go env GOSUMDB GONOSUMDB GOPRIVATEFix
Ask the operator of that database for its verifier key and set the full string, with the URL as the optional second word. If you only wanted to skip the public database for your own modules, leave GOSUMDB alone and list the module prefix in GOPRIVATE instead.
go env -w GOSUMDB="sumdb.example.com+<hash>+<base64-key> https://sumdb.example.com"
# or, for private modules only:
go env -u GOSUMDB
go env -w GOPRIVATE=git.example.com/myteamVerify
go env GOSUMDB shows the three-part key (or the default), and go mod download finishes without the verifier error.
go mod downloadConfirmed by raw.githubusercontent.com
Cause 3 of 3
An OS, CI or editor variable overrides what go env -w stores
You seego env -w prints a warning about a conflicting OS environment variable, or the error appears only inside VS Code
Check
When the bad value lives in the process environment, go env -w cannot replace it: the stored file only sets defaults, an exported variable wins, and go env -w prints a warning that it does not override the conflicting OS variable. The VS Code Go extension hands go.toolsEnvVars to the Go tools it starts, so a GOSUMDB entry there breaks tool installs while the terminal works.
echo "$GOSUMDB"
grep -rn "GOSUMDB" ~/.bashrc ~/.zshrc ~/.profile .vscode/settings.json 2>/dev/nullFix
Delete the variable where it is defined (shell profile, CI variables or go.toolsEnvVars in VS Code settings), open a new terminal or reload the editor, then run the install again.
unset GOSUMDB
go env -u GOSUMDB
go env GOSUMDBVerify
echo $GOSUMDB prints an empty line, go env GOSUMDB prints sum.golang.org, and Go: Install/Update Tools in VS Code completes.
go env GOSUMDBConfirmed by raw.githubusercontent.com
How do I stop it coming back?
- Set Go variables with go env -w on developer machines and keep them out of shell profiles, so there is one place to look.
- Use GOPRIVATE or GONOSUMDB for internal module paths instead of rewriting GOSUMDB for every module.
- In CI, print go env GOSUMDB GOPROXY GOPRIVATE at the start of the job so a bad value shows in the first lines of the log.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.