-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: in 'go mod init', prefer the 'version' field from Gopkg.lock instead of a pseudo-version #31251
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
Comments
I don't understand the bug report.
What is "degrade"? Is that a module name? Or a verb? How's it being degraded? |
@bradfitz you may see |
/cc @bcmills |
@bcmills hi, any input? |
@daixiang0, I'm not able to reproduce the observed downgrade using
|
@bcmills i remove old repo and git clone a new on, can reproduce it. ``` # GO111MODULE=on go mod init go: creating new go.mod: module github.com/cortexproject/cortex go: copying requirements from Gopkg.lock go: converting Gopkg.lock: stat k8s.io/client-go@a47917edff34c2c3f7be36398e3ebad6011ce05c: unrecognized import path "k8s.io/client-go" (https fetch: Get https://k8s.io/client-go?go-get=1: dial tcp 35.201.71.162:443: i/o timeout) go: converting Gopkg.lock: stat sigs.k8s.io/[email protected]: unrecognized import path "sigs.k8s.io/yaml" (https fetch: Get https://sigs.k8s.io/yaml?go-get=1: dial tcp 35.201.71.162:443: i/o timeout) go: converting Gopkg.lock: stat k8s.io/apimachinery@2b1284ed4c93a43499e781493253e2ac5959c4fd: unrecognized import path "k8s.io/apimachinery" (https fetch: Get https://k8s.io/apimachinery?go-get=1: dial tcp 35.201.71.162:443: i/o timeout) go: converting Gopkg.lock: stat k8s.io/[email protected]: unrecognized import path "k8s.io/klog" (https fetch: Get https://k8s.io/klog?go-get=1: dial tcp 35.201.71.162:443: i/o timeout) go: converting Gopkg.lock: stat k8s.io/api@05914d821849570fba9eacfb29466f2d8d3cd229: unrecognized import path "k8s.io/api" (https fetch: Get https://k8s.io/api?go-get=1: dial tcp 35.201.71.162:443: i/o timeout) # grep opentracing-go go.mod github.com/opentracing/opentracing-go v0.0.0-20170426175816-1949ddbfd147 # GO111MODULE=on go mod vendor # grep opentracing-go go.mod github.com/opentracing/opentracing-go v1.0.1 # GO111MODULE=on go mod tidy go: finding github.com/kylelemons/godebug/pretty latest go: finding github.com/kylelemons/godebug latest go: finding github.com/bmizerany/assert latest go: finding github.com/bitly/go-hostpool latest go: finding github.com/google/martian/martianlog latest go: finding github.com/google/martian/fifo latest go: finding github.com/google/martian/mitm latest go: finding github.com/google/martian/httpspec latest go: finding github.com/cznic/ql/driver latest [root@dx-app2 cortex]# grep opentracing-go go.mod github.com/opentracing/opentracing-go v1.0.1 [root@dx-app2 cortex]# GO111MODULE=on go list -m github.com/opentracing/opentracing-go github.com/opentracing/opentracing-go v1.0.1 ``` In case my env not clean, i start a golang container to test ``` # docker run -it golang:1.12.1 /bin/bash root@3d96f367c88e:/go# go get github.com/cortexproject/cortex package github.com/cortexproject/cortex: no Go files in /go/src/github.com/cortexproject/cortex root@3d96f367c88e:/go/src/github.com/cortexproject/cortex# /go/src/github.com/cortexproject/cortex root@3d96f367c88e:/go/src/github.com/cortexproject/cortex# export GO111MODULE=on root@3d96f367c88e:/go/src/github.com/cortexproject/cortex# go mod init go: creating new go.mod: module github.com/cortexproject/cortex go: copying requirements from Gopkg.lock go: converting Gopkg.lock: stat k8s.io/apimachinery@2b1284ed4c93a43499e781493253e2ac5959c4fd: unrecognized import path "k8s.io/apimachinery" (https fetch: Get https://k8s.io/apimachinery?go-get=1: dial tcp 35.201.71.162:443: i/o timeout) go: converting Gopkg.lock: stat k8s.io/client-go@a47917edff34c2c3f7be36398e3ebad6011ce05c: unrecognized import path "k8s.io/client-go" (https fetch: Get https://k8s.io/client-go?go-get=1: dial tcp 35.201.71.162:443: i/o timeout) go: converting Gopkg.lock: stat sigs.k8s.io/[email protected]: unrecognized import path "sigs.k8s.io/yaml" (https fetch: Get https://sigs.k8s.io/yaml?go-get=1: dial tcp 35.201.71.162:443: i/o timeout) go: converting Gopkg.lock: stat k8s.io/[email protected]: unrecognized import path "k8s.io/klog" (https fetch: Get https://k8s.io/klog?go-get=1: dial tcp 35.201.71.162:443: i/o timeout) go: converting Gopkg.lock: stat k8s.io/api@05914d821849570fba9eacfb29466f2d8d3cd229: unrecognized import path "k8s.io/api" (https fetch: Get https://k8s.io/api?go-get=1: dial tcp 35.201.71.162:443: i/o timeout) root@3d96f367c88e:/go/src/github.com/cortexproject/cortex# grep opentracing-go go.mod github.com/opentracing/opentracing-go v1.0.2 root@3d96f367c88e:/go/src/github.com/cortexproject/cortex# go mod vendor go: finding github.com/bradfitz/gomemcache v0.0.0-20170208213004-1952afaa557d go: finding github.com/mattn/go-isatty v0.0.2 go: finding github.com/go-kit/kit v0.5.0 Seems that my env is not clean then get this unexpected error? hi, @bcmills how can i check my env is clean or not? and, why tag with |
Hi, @bcmills , i run test in container:
the version of |
hi, @bcmills any update? |
That's the trouble. Somewhere in your module cache, you have an entry for commit Avoiding the creation of such invalid entries is #27171. However, in this case there is a bit more: given that your |
(CC @jayconrod) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Change https://golang.org/cl/178497 mentions this issue: |
Fixes #32161 Updates #31251 Change-Id: I22760836b48cd734b90bc43aacb23e23e38c0f4e Reviewed-on: https://go-review.googlesource.com/c/go/+/178497 Reviewed-by: Bryan C. Mills <[email protected]>
The fix for #33767 seems like it will also be the right general fix for this issue: instead of directly querying the |
Duplicate of #33767 |
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
I don't know why degrade.
also
go mod why
cannot explain.What did you see instead?
The text was updated successfully, but these errors were encountered: