Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: go.work: go mod verify returns ziphash error in go.work #54372

Closed
whs opened this issue Aug 10, 2022 · 13 comments
Closed

cmd/go: go.work: go mod verify returns ziphash error in go.work #54372

whs opened this issue Aug 10, 2022 · 13 comments
Assignees
Labels
GoCommand cmd/go modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@whs
Copy link

whs commented Aug 10, 2022

What version of Go are you using (go version)?

$ go version
go version go1.19 linux/amd64
$ yay -Q go
go 2:1.19-1

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/whs/.cache/go-build"
GOENV="/home/whs/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/whs/build/go/pkg/mod"
GONOPROXY="git.wndv.co"
GONOSUMDB="git.wndv.co"
GOOS="linux"
GOPATH="/home/whs/build/go/"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.19"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK="/home/whs/apps/gowork-repro/go.work"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1279766172=/tmp/go-build -gno-record-gcc-switches"

What did you do?

  1. Clone the reproduction repository
  2. Run go mod verify

What did you expect to see?

all modules verified

What did you see instead?

github.com/whs/gowork-repro/mod2 : missing ziphash: open hash: no such file or directory
@thanm thanm added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 10, 2022
@thanm thanm added this to the Unreleased milestone Aug 10, 2022
@thanm
Copy link
Contributor

thanm commented Aug 10, 2022

@golang/tools-team

@findleyr findleyr changed the title go.work: go mod verify returns ziphash error in go.work cmd/go: go.work: go mod verify returns ziphash error in go.work Aug 10, 2022
@lopezator
Copy link

lopezator commented Oct 11, 2022

I have fallen into the same scenario. Have to disable go mod verify in all the repos that use go.work

@sirianni
Copy link

+1 It's surprising to see no comments on this issue. Is no one using workspaces or are we somehow doing it incorrectly?

@findleyr
Copy link
Contributor

CC @bcmills @matloob

@bcmills bcmills modified the milestones: Unreleased, Backlog Nov 10, 2022
@sirianni
Copy link

Related discussion on #50750 (comment)

@jmwielandt
Copy link

jmwielandt commented Nov 25, 2022

imagen
Not even setting GOPRIVATE to github.com (horrible practice, I'd expect to use github.com/<organization-name>) I could manage to make this work.

@bcmills
Copy link
Contributor

bcmills commented Nov 28, 2022

go mod verify verifies modules that have already been downloaded, without downloading them itself.

Modules that have not been downloaded (as might be the case when working exclusively within a larger workspace) are supposed to be skipped during verification. Probably something in that logic is not working as intended.

@freeformz
Copy link

FWIW: go work sync seems to usually clear this up for me.

@gabrielseibel1
Copy link

having the same issue, and go work sync does not solve it

@matloob matloob self-assigned this Apr 17, 2023
@freeformz
Copy link

Actually nevermind. go work sync "solved" it once and only once.

@gopherbot
Copy link

Change https://go.dev/cl/485475 mentions this issue: cmd/go: skip over all workspace modules in go mod verify

@bcmills bcmills modified the milestones: Backlog, Go1.21 May 3, 2023
@gbrlsnchs
Copy link

Is this really fixed? I can reproduce this by running go mod verify in a project like https://github.com/siderolabs/talos. I cloned it to /tmp and then got:

$ go mod verify
module-sig-verify : missing ziphash: open hash: no such file or directory
$ go version
go version go1.21.1 linux/amd64
$ go env
GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/gbrlsnchs/.cache/go-build'
GOENV='/home/gbrlsnchs/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/gbrlsnchs/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/gbrlsnchs/go'
GOPRIVATE=''
GOPROXY='direct'
GOROOT='/usr/lib/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/usr/lib/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.21.1'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='x86_64-pc-linux-gnu-gcc'
CXX='x86_64-pc-linux-gnu-g++'
CGO_ENABLED='1'
GOMOD='/tmp/talos/go.mod'
GOWORK='/tmp/talos/go.work'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build975863248=/tmp/go-build -gno-record-gcc-switches'

@bcmills
Copy link
Contributor

bcmills commented Sep 15, 2023

@gbrlsnchs, one underlying cause was fixed. If you are seeing a similar symptom, it likely has a different cause; please open a new issue with steps to reproduce the error. (Notably, it would help to have a specific commit at which you observed it.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GoCommand cmd/go modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests