You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Created an example module that imports the github.com/juju/utils module package which is causing go list -u -m all to fail.
mkdir retractfail
cd retractfail
go mod init github.com/ryancurrah/retractfail
touch main.go
Edit main.go.
package main
import _ "github.com/juju/utils"funcmain() {}
go get github.com/juju/utils@v0.0.0-20200116185830-d40c2fe10647
go list -u -m all
What did you expect to see?
I expected to see a list of modules and module versions.
╰─ go version
go version go1.15.10 darwin/amd64
╰─ go list -u -m all
github.com/ryancurrah/retractfail
github.com/creack/pty v1.1.9 [v1.1.11]
github.com/juju/ansiterm v0.0.0-20160907234532-b99631de12cf [v0.0.0-20180109212912-720a0952cc2a]
github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c
github.com/juju/cmd v0.0.0-20171107070456-e74f39857ca0 [v0.0.0-20200108104440-8e43f3faa5c9]
github.com/juju/collections v0.0.0-20200605021417-0d0ec82b7271
github.com/juju/errors v0.0.0-20200330140219-3fe23663418f
github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d
github.com/juju/httpprof v0.0.0-20141217160036-14bf14c30767
github.com/juju/loggo v0.0.0-20200526014432-9ce3a2e09b5e
github.com/juju/mutex v0.0.0-20171110020013-1fe2a4bf0a3a [v0.0.0-20180619145857-d21b13acf4bf]
github.com/juju/retry v0.0.0-20180821225755-9058e192b216
github.com/juju/testing v0.0.0-20201216035041-2be42bba85f3
github.com/juju/utils v0.0.0-20200116185830-d40c2fe10647
github.com/juju/utils/v2 v2.0.0-20200923005554-4646bfea2ef1
...
What did you see instead?
I saw an error related to module retractions and the module github.com/juju/utils.
╰─ go version
go version go1.16.2 darwin/amd64
╰─ go list -u -m all
go list -m: loading module retractions for github.com/juju/utils@v0.0.0-20200116185830-d40c2fe10647: no matching versions for query "latest"
The text was updated successfully, but these errors were encountered:
When loading retractions, we don't normally require that the module path in go.mod matches the path we were looking for. It should be possible to retract versions with an incorrect module path, or versions that were tagged before a go.mod file was added.
Looks like that's causing problems in this case though. We shouldn't attempt to load retractions if the module path matches except for the major version suffix.
And in any case, a failure to load retractions probably shouldn't be fatal for go list -u -m.
For now, you can work around this using the -e flag.
Thank you! Quite a few tools in the wild use this method to auto-update modules and will break when this error occurs. Unless like you mentioned, add the -e flag.
Is there any downside/things I should be aware of when using the -e flag?
Is there any downside/things I should be aware of when using the -e flag?
No real downsides; -e means go list will continue after an error occurs and will print as much as it can. Errors are still visible in the -f and -json output.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes. It is reproducible in Go
1.16
or higher.It is not reproducible on versions older than
1.16
because theretract
statement is new in1.16
.What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Created an example module that imports the
github.com/juju/utils
module package which is causinggo list -u -m all
to fail.Edit
main.go
.What did you expect to see?
I expected to see a list of modules and module versions.
What did you see instead?
I saw an error related to module retractions and the module
github.com/juju/utils
.The text was updated successfully, but these errors were encountered: