etcd: go get error for 3.4.0
go get go.etcd.io/etcd@v3.4.0
go: finding golang.org/x/net master
go: finding go.etcd.io/etcd v3.4.0
go: finding go.etcd.io/etcd v3.4.0
go get go.etcd.io/etcd@v3.4.0: go.etcd.io/etcd@v3.4.0: invalid version: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v3
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 37
- Comments: 48 (5 by maintainers)
Commits related to this issue
- Upgrade etcd to 3.3.17 I originally intended to upgrade etcd to 3.4.2, but at this time, the module is broken, and cannot be included, under the original import path, or the new go.etcd.io import pat... — committed to sensu/sensu-go by echlebek 5 years ago
- Upgrade etcd to 3.3.17 (#3343) I originally intended to upgrade etcd to 3.4.2, but at this time, the module is broken, and cannot be included, under the original import path, or the new go.etcd.io... — committed to sensu/sensu-go by echlebek 5 years ago
- Upgrade etcd to 3.3.17 (#3343) I originally intended to upgrade etcd to 3.4.2, but at this time, the module is broken, and cannot be included, under the original import path, or the new go.etcd.io... — committed to sensu/sensu-go by echlebek 5 years ago
- Add initial go.mod file The go.mod file was generated with the following sequence of commands: go mod init go mod tidy The first try resulted in two problems. - One problem was fixed by updating t... — committed to go-kit/kit by ChrisHines 4 years ago
- Tidy up go modules Can't yet do updates due to issues with etcd: https://github.com/etcd-io/etcd/issues/11749 https://github.com/etcd-io/etcd/issues/11154 — committed to RSE-Cambridge/data-acc by JohnGarbutt 4 years ago
- Fix canonical package name of the bbolt package This is a very indirect dependency, via eirinix, cobra, viper, etcd. The initial problem is in etcd-v3.3, with an incorrect import of github.com/coreos... — committed to cloudfoundry/eirini by deleted user 4 years ago
- Update image versions eirini commit SHA: f5f48da417a4e114fa22212b631594ed5a3ed35c eirini commit message: Fix canonical package name of the bbolt package This is a very indirect dependency, via eirin... — committed to cloudfoundry/eirini-release by eirinici 4 years ago
Can you either please remove the go.mod from the project or fix it?
If you are exposing a go module, you should be following its rules. That means that your go.mod needs to expose the actual major version as the module –
go.etcd.io/etcd/v3
.The behavior right now is that go modules, despite you having a go.mod, decides that your repo is incompatible and gets the latest tag made, regardless of which branch that tag actually points to. And the only way to get released tags with go modules is to get the commit ID and explicitly use that.
If you changed that and Travis broke, please fix Travis. It is unsurprising there would need to be changes since it means that you will have to update import paths. But that is trivial to do, it will make go modules actually work correctly, and it has to be done at some point anyways.
When will this problem be solved? It wasted me at least an hour to deal with dependency issues!
Let me look into this.
I have spent the last 9 months trying to train/empower others to take ownership of infrastructure I have owned throughout the kube ecosystem. And unfortunately part of that has meant I haven’t spent much time focused on any one project.
But, this issue seems to still be falling through the cracks for months. So, I will try to figure it out.
This will be fixed in etcd v3.5.0 via #11823
Hey guys, is there at least a tentative ETA on when this is going to be fixed?
@fredczj The maintainers aren’t paying attention and don’t care anyways.
They could solve this issue in two seconds by removing the go.mod entirely but instead they leave an invalid file and cause problems for every single downstream project, and it’s been that way for six months.
Alternately they could fix this by fixing the import path in go.mod, creating a tag with the new go.mod so that it’s actually fetchable (which #11221 failed to do), and fix their CI. More work, but better rewards.
We’re all just screaming into the void at this point, though.
Here is a temporary workaround (change the v3.4.3 to the tag/release you want)
Take note of the v0.0.0-… (v0.0.0-20191023171146-3cf2f69b5738 for tag v3.4.3 for example) and change your go.mod etcd import like this
It should now work. thanks to https://stackoverflow.com/a/59440771 for the tip on how to compute what’s after
v0.0.0-
@latest
isv3.3.15+incompatible
according togo get
for golang 1.13.1@v3.4.1
doesn’t work due to the module path in that version beinggo.etcd.io/etcd
instead ofgo.etcd.io/etcd/v3
(I think)go get -u go.etcd.io/etcd/clientv3@a14579f
(the sha1 of thev3.4.1
release) results in usage ofv0.5.0-alpha.5.0.20190917205325-a14579fbfb1a
with has the right commit at the end, but a wacky old version (I believe it gets the right code)go get -u go.etcd.io/etcd/clientv3@v0.0.0-20190917205325-a14579fbfb1a
gets the right commit, but with a less wrong tag than aboveFull reproduction:
Well, at least now we have a corona virus to blame for the delay.
it works when add this to go.mod file
replace go.etcd.io/etcd => go.etcd.io/etcd v0.0.0-20200520232829-54ba9589114f
and wait for v3.5 …
Please delete
go.mod
, it’s invalid and more harmful for imports than just omitting it.EDIT
Unfortunately removal of go.mod is not a bulletproof solution either. Quite a few third party packages pull in v3.4.* using a workaround (https://github.com/etcd-io/etcd/pull/11477, great work by obsider). While most imports seem to refer to a specific commit, there is still a risk of breaking one of those workaround imports. One could argue that breaking a workaround is a lesser evil than fixing a bad import bug.
Still, afaik there are only two correct approaches:
module go.etcd.io/etcd/v3
. Ideally test this using a fakeGOPROXY
first.asdsadad
may be for etcd this is beginning of the end
(⊙o⊙)…
@moggle-mog: have you tried with
go.etcd.io/etcd
?Just curious. I worked around it by using
go get -u go.etcd.io/etcd/clientv3@v0.0.0-20190917205325-a14579fbfb1a
for now.