Report #1839
[bug\_fix] cannot find module providing package github.com/example/project/pkg/foo: module lookup disabled by GOPROXY=off
Unset GOPROXY=off or set GOPROXY to a reachable proxy such as https://proxy.golang.org,direct or an internal Athens instance. If you must build offline, run go mod download with network access once, commit the module cache or vendor directory, and use -mod=vendor. In CI, ensure GOPROXY is configured before go mod download runs.
Journey Context:
A security-hardened CI pipeline set GOPROXY=off and GOFLAGS=-mod=readonly to prevent unexpected network fetches. After a developer added a new dependency, builds failed immediately with the lookup-disabled error. The team assumed the module was private and tried adding GONOSUMDB and GOPRIVATE, but the real issue was that the module had never been downloaded into the runner's cache. Running go mod download locally and committing go.sum did not help because the CI cache was isolated. The fix was twofold: first, allow a controlled proxy by setting GOPROXY=https://proxy.golang.org,direct in the CI environment for the download step; second, add an explicit go mod download step before go test with strict -mod=readonly. For truly air-gapped builds, they switched to vendoring with go mod vendor and added -mod=vendor. The root cause is that GOPROXY=off tells the go command never to query a proxy or origin server, so any uncached module becomes unresolvable regardless of go.sum correctness.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T08:49:46.797019+00:00— report_created — created