openshift / openshift-azure

Azure Red Hat Openshift
https://azure.microsoft.com/en-us/services/openshift/
Apache License 2.0
49 stars 51 forks source link

cannot find package "golang.org/x/tools/go/packages" #1582

Closed asalkeld closed 5 years ago

asalkeld commented 5 years ago

https://storage.googleapis.com/origin-ci-test/pr-logs/pull/openshift_openshift-azure/1530/pull-ci-azure-master-upgrade-v3.2/43/build-log.txt

/kind test-flake

mjudeikis commented 5 years ago

Now this gets fun.

  1. Created local container from CI docker run -it -v $(pwd)/secrets:/usr/secrets registry.svc.ci.openshift.org/azure/ci-base:latest
  2. Executed same script - same failure.
  3. Executed make generate manually - all works!
  4. re-executed script - all works!

on the same gopath first go generate fails, second - succ.

Did this few times and always same result. @jim-minter, do you know why go could not see files on the first run, and does on the second?

:/

mjudeikis commented 5 years ago
bash-4.2$     make create                                                                                                                                                                                                                                                    
+ make create                                                                                                                                                                                                                                                                
PLUGIN_VERSION is v3.2
TAG set to v3.2
timeout 1h ./hack/create.sh mjudeikis
+ [[ 1 -ne 1 ]]
+ export RESOURCEGROUP=mjudeikis
+ RESOURCEGROUP=mjudeikis
+ rm -rf _data
+ mkdir -p _data/_out
+ set -x
+ [[ -n '' ]]
+ go generate ./...
bindata.go
bindata.go
../../../../golang/mock/mockgen/parse.go:34:2: cannot find package "golang.org/x/tools/go/packages" in any of:
        /usr/local/go/src/golang.org/x/tools/go/packages (from $GOROOT)
        /tmp/tmp.04nftemodd/src/golang.org/x/tools/go/packages (from $GOPATH)
pkg/arm/arm.go:7: running "go": exit status 1
../../../../golang/mock/mockgen/parse.go:34:2: cannot find package "golang.org/x/tools/go/packages" in any of:
        /usr/local/go/src/golang.org/x/tools/go/packages (from $GOROOT)
        /tmp/tmp.04nftemodd/src/golang.org/x/tools/go/packages (from $GOPATH)
pkg/cluster/hash.go:4: running "go": exit status 1
../../../../../golang/mock/mockgen/parse.go:34:2: cannot find package "golang.org/x/tools/go/packages" in any of:
        /usr/local/go/src/golang.org/x/tools/go/packages (from $GOROOT)
        /tmp/tmp.04nftemodd/src/golang.org/x/tools/go/packages (from $GOPATH)
pkg/cluster/kubeclient/types.go:4: running "go": exit status 1
../../../../../golang/mock/mockgen/parse.go:34:2: cannot find package "golang.org/x/tools/go/packages" in any of:
        /usr/local/go/src/golang.org/x/tools/go/packages (from $GOROOT)
        /tmp/tmp.04nftemodd/src/golang.org/x/tools/go/packages (from $GOPATH)
pkg/cluster/scaler/scaler.go:4: running "go": exit status 1
../../../../../golang/mock/mockgen/parse.go:34:2: cannot find package "golang.org/x/tools/go/packages" in any of:
        /usr/local/go/src/golang.org/x/tools/go/packages (from $GOROOT)
        /tmp/tmp.04nftemodd/src/golang.org/x/tools/go/packages (from $GOPATH)
pkg/cluster/updateblob/blobservice.go:4: running "go": exit status 1
../../../../golang/mock/mockgen/parse.go:34:2: cannot find package "golang.org/x/tools/go/packages" in any of:
        /usr/local/go/src/golang.org/x/tools/go/packages (from $GOROOT)
        /tmp/tmp.04nftemodd/src/golang.org/x/tools/go/packages (from $GOPATH)
pkg/config/types.go:4: running "go": exit status 1
../../../../../golang/mock/mockgen/parse.go:34:2: cannot find package "golang.org/x/tools/go/packages" in any of:
        /usr/local/go/src/golang.org/x/tools/go/packages (from $GOROOT)

bash-4.2$ make create                                                                                                                                                                                                                                                        
+ make create
PLUGIN_VERSION is v3.2
TAG set to v3.2
timeout 1h ./hack/create.sh mjudeikis
+ [[ 1 -ne 1 ]]
+ export RESOURCEGROUP=mjudeikis
+ RESOURCEGROUP=mjudeikis
+ rm -rf _data
+ mkdir -p _data/_out
+ set -x
+ [[ -n '' ]]
+ go generate ./...
bindata.go
bindata.go
bindata.go
+ [[ -n '' ]]
+ trap 'return_id=$?; set +ex; kill $(lsof -t -i :8080); wait $(lsof -t -i :8080); exit $return_id' EXIT
+ go run cmd/fakerp/main.go
+ go run cmd/createorupdate/createorupdate.go
FATA[2019-04-26T11:33:51Z] required key AZURE_SUBSCRIPTION_ID missing value
exit status 1
+ return_id=1
+ set +ex
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
INFO[2019-04-26T11:33:52Z]/tmp/tmp.04nftemodd/src/github.com/openshift/openshift-azure/cmd/fakerp/main.go:20 main.main() starting the fake resource provider                                                                                                                 
FATA[2019-04-26T11:33:52Z]/tmp/tmp.04nftemodd/src/github.com/openshift/openshift-azure/pkg/fakerp/server.go:60 github.com/openshift/openshift-azure/pkg/fakerp.NewServer() open secrets/logging-int.cert: permission denied                                                  
exit status 1
make: *** [create] Error 1
mjudeikis commented 5 years ago
bash-4.2$ go install github.com/golang/mock/mockgen
+ go install github.com/golang/mock/mockgen
../../golang/mock/mockgen/parse.go:34:2: cannot find package "golang.org/x/tools/go/packages" in any of:
        /usr/local/go/src/golang.org/x/tools/go/packages (from $GOROOT)
        /tmp/tmp.EsOIiIrMS5/src/golang.org/x/tools/go/packages (from $GOPATH)
bash-4.2$ go get golang.org/x/tools/go/packages
+ go get golang.org/x/tools/go/packages
bash-4.2$ go install github.com/golang/mock/mockgen
+ go install github.com/golang/mock/mockgen
mjudeikis commented 5 years ago

https://github.com/golang/mock/commit/79d8603a659da203b11a30b9faeb999604924d86

:/ Mock is no more "vendored" package!!!