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

I used the etcd/embed cue panic: codecgen version mismatch: current: 8, need 10. #10325

Closed
yeyongyong opened this issue Dec 14, 2018 · 26 comments
Assignees

Comments

@yeyongyong
Copy link

panic: codecgen version mismatch: current: 8, need 10. Re-generate file: /Users/yeyongyong/go/pkg/mod/github.com/coreos/[email protected]+incompatible/client/keys.generated.go

goroutine 1 [running]:
github.com/coreos/etcd/client.init.0()
/Users/yeyongyong/go/pkg/mod/github.com/coreos/[email protected]+incompatible/client/keys.generated.go:45 +0x104

@yeyongyong yeyongyong changed the title I used the etcdembed cue panic: codecgen version mismatch: current: 8, need 10. I used the etcd/embed cue panic: codecgen version mismatch: current: 8, need 10. Dec 14, 2018
@maps90
Copy link

maps90 commented Dec 17, 2018

having the same problem, can anyone help?

@hexfusion
Copy link
Contributor

@yeyongyong @maps could you please test #10337

@maps90
Copy link

maps90 commented Dec 19, 2018

@hexfusion superb! it works

@MatevzFa
Copy link

MatevzFa commented Dec 21, 2018

How can I use this change in my project, while using a go.mod file?

@reefbarman
Copy link

I still see this issue using the latest release, I am using go modules in go 1.11 is there anything specific I need to do to resolve this?

@reefbarman
Copy link

exact error is here:

panic: codecgen version mismatch: current: 8, need 10. Re-generate file: C:/Go/pkg/mod/github.com/coreos/[email protected]+incompatible/client/keys.generated.go

goroutine 1 [running]:
github.com/coreos/etcd/client.init.0()
C:/Go/pkg/mod/github.com/coreos/[email protected]+incompatible/client/keys.generated.go:45 +0x10b
exit status 2

@mnajork-palantir
Copy link

mnajork-palantir commented Feb 7, 2019

When can we expect a release which contains the fix to get cut?

@reefbarman you can vendor in the dependency at the fix's merge commit to pick up the changes.

@lifangmoler
Copy link

Seeing the same issue using the latest version

@lifangmoler
Copy link

is the latest version containing the fix for this?

@lifangmoler
Copy link

@mnajork-palantir how to do vendor in the dependency at the fix's merge commit to pick up the changes.?

@mnajork-palantir
Copy link

@lifangmoler what are you using as your dependency management tool?

Here's the commit containing the fix: f3fbedc

@lifangmoler
Copy link

@mnajork-palantir I am using go mod. I can see the commit and the change. but still not sure how to pick the change

@lifangmoler
Copy link

trying this go get github.com/coreos/etcd@f3fbedc, seeing new errrors: go: finding github.com/coreos/etcd f3fbedc go: github.com/coreos/[email protected]: parsing go.mod: unexpected module path "go.etcd.io/etcd" go: error loading module requirements

@hexfusion
Copy link
Contributor

hexfusion commented Feb 10, 2019

Played with this a little and I found if you are using go mod for your project and running into issues with "codecgen version mismatch: current: 8, need 10. Re-generate file:" try:

go get github.com/ugorji/[email protected] which is the version we pin https://github.com/etcd-io/etcd/blob/master/go.mod#L45

go.mod

module github.com/hexfusion/stuffz

require (
             github.com/coreos/etcd v3.3.12+incompatible
[snip]
             github.com/ugorji/go v1.1.1 // indirect
)

Curious if this helps folks.

@hexfusion
Copy link
Contributor

@reefbarman
Copy link

@hexfusion so I have gotten further with the suggestion change but then received this

..\Go\pkg\mod\github.com\coreos\[email protected]+incompatible\client\keys.generated.go:15:2: unknown import path "github.com/ugorji/go/codec": ambiguous import: found github.com/ugorji/go/codec in multiple modules:
        github.com/ugorji/go v1.1.1 (C:\Gamedev\Go\pkg\mod\github.com\ugorji\[email protected]\codec)
        github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8 (C:\Gamedev\Go\pkg\mod\github.com\ugorji\go\[email protected])

Will dig to see if I can resolve this but I am not specifically requiring github.com/ugorji/go/codec

@reefbarman
Copy link

reefbarman commented Feb 11, 2019

okay I found it was github.com/spf13/viper also requiring go/codec and I forked this and updated it to use the same versions of etcd and go/codec and it built. But ideally etcd would support go mod so things can be versioned correctly

EDIT: Spoke too soon including the forked viper in another project then caused it to fail again with the above issue and this time I can't find the dependency that is importing github.com/ugorji/go/codec, so unable to resolve the issue

@lifangmoler
Copy link

@hexfusion It is working for me after i tried go get github.com/ugorji/[email protected]. thanks

mikma added a commit to mikma/docker-ipam-plugin that referenced this issue Feb 12, 2019
Fixes problem with
panic: codecgen version mismatch: current: 8, need 10.

Refer to: etcd-io/etcd#10325
@antgubarev
Copy link

Still have same problem

@hexfusion
Copy link
Contributor

@amarox make sure to bump etcd we updated to a go mod friendly version of ugorji/go recently #10481

@antgubarev
Copy link

github.com/coreos/etcd v3.3.12

@timestee
Copy link

timestee commented Mar 5, 2019

Still have same problem

github.com/coreos/etcd v3.3.12+incompatible // indirect
github.com/ugorji/go v1.1.1 // indirect

@s4kibs4mi
Copy link

Facing the same issue,

panic: codecgen version mismatch: current: 8, need 10. Re-generate file: /Users/sakib/go/pkg/mod/github.com/coreos/[email protected]+incompatible/client/keys.generated.go

goroutine 1 [running]:
github.com/coreos/etcd/client.init.0()
        /Users/sakib/go/pkg/mod/github.com/coreos/[email protected]+incompatible/client/keys.generated.go:45 +0x135

@radekg
Copy link

radekg commented Mar 12, 2019

Same problem, this appears to be okay:

[[constraint]]
  name = "github.com/etcd-io/etcd"
  revision = "1adc28822343e2f14cc5e493a663fba1adf54186"

@alee792
Copy link

alee792 commented Mar 20, 2019

Bcmills' solution resolved this for me.

go get github.com/ugorji/go/codec@none

@lucasalcantara
Copy link

lucasalcantara commented Mar 28, 2019

this solution worked for me.
I just did GO111MODULE=on go get -u github.com/ugorji/[email protected] and worked beautifully.

ldemailly added a commit to ldemailly/go-flagz that referenced this issue Jul 12, 2020
* add `README` for the `simple_cli` example

* flagset checksum: add a mechanism to checksum the whole flagset

* fix typo in watcher

* add copyright notices

* add status endpoint for debuging purposes

* notifiers: add functions triggered on successful dyn flag sets

* address govet and golint

* fixup test

* Change travis file.

* fixup travis

* fixup travis 2

* bring back the workaround for etcd-io/etcd/issues/3209

* increase etcd ctx timeouts on travis

* fix up travis

* endpoint: add checksums for static/dynamic

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* monitoring: add a Prometheus collector for flagset checksums

* monitoring: add a readme mention

* Update README.md

* Update README.md

* Fix a few typos and gofmt issues

* Update README.md

* MarkFlagDynamic is now public

* proto3 flag support added

* Add notes about DynProto3

* Add DynStringSet.

* Change DynStringSet to `map[string]struct{}` for the set type.

* Add Contains convenience method to DynStringSet.

* Fix spurious leading spaces in output of DynStringSetValue.String().

The array is allocated with the same size as the map, instead of having
the capacity of the map but size zero. This results in unintended
leading empty string elements in the array.

* Update README.md

* kubernetes config map, first draft

* updater test and READMIES

* testdata

* fixup travis

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Make travis run in a container

* travis fixup and gitingore

* test coverage

* Update README.md

* add self returns

* add file-read flags

* Add support for go modules.

- create go.sum
- do not use .. in filenames in this repo due to golang/go#27299

Testing strategy: I almost successfully ran `test_all.sh` and found a
data race, but I don't think it's related to this PR:

```
WARNING: DATA RACE
Read at 0x00c00016cac0 by goroutine 29:
  github.com/spf13/pflag.(*FlagSet).VisitAll()
      /home/stefan/usr/go/main/pkg/mod/github.com/spf13/[email protected]/flag.go:277 +0x14a
  github.com/mwitkow/go-flagz.ChecksumFlagSet()
      /home/stefan/Projects/go-flagz/checksum.go:15 +0xc8
  github.com/mwitkow/go-flagz/monitoring.(*flagSetCollector).Collect()
      /home/stefan/Projects/go-flagz/monitoring/collector.go:57 +0x2a2
  github.com/prometheus/client_golang/prometheus.(*Registry).Gather.func1()
      /home/stefan/usr/go/main/pkg/mod/github.com/prometheus/[email protected]/prometheus/registry.go:434 +0x1eb

Previous write at 0x00c00016cac0 by goroutine 28:
  github.com/spf13/pflag.sortFlags()
      /home/stefan/usr/go/main/pkg/mod/github.com/spf13/[email protected]/flag.go:204 +0x2f2
  github.com/spf13/pflag.(*FlagSet).VisitAll()
      /home/stefan/usr/go/main/pkg/mod/github.com/spf13/[email protected]/flag.go:270 +0x1b0
  github.com/mwitkow/go-flagz.ChecksumFlagSet()
      /home/stefan/Projects/go-flagz/checksum.go:15 +0xc8
  github.com/mwitkow/go-flagz/monitoring.(*flagSetCollector).Collect()
      /home/stefan/Projects/go-flagz/monitoring/collector.go:55 +0xe9
  github.com/prometheus/client_golang/prometheus.(*Registry).Gather.func1()
      /home/stefan/usr/go/main/pkg/mod/github.com/prometheus/[email protected]/prometheus/registry.go:434 +0x1eb
```

* Replace package author name, fixing codecgen version mismatch (etcd-io/etcd#10325 (comment))

* add circle config

* Upgrade Prometheus client from v0.9.2 -> v0.9.3 to fix data race condition

* Fixed compile error but the data race is still there...

* Fixing test race condition, albeit heavy handedly

Co-authored-by: Michal Witkowski <[email protected]>
Co-authored-by: Jonathan Boulle <[email protected]>
Co-authored-by: Mark Nevill <[email protected]>
Co-authored-by: Stefan Sakalik <[email protected]>
Co-authored-by: Janos Dobronszki <[email protected]>
Co-authored-by: Thom May <[email protected]>
ldemailly added a commit to ldemailly/go-flagz that referenced this issue Jul 12, 2020
* Add support for go modules.

- create go.sum
- do not use .. in filenames in this repo due to golang/go#27299

Testing strategy: I almost successfully ran `test_all.sh` and found a
data race, but I don't think it's related to this PR:

```
WARNING: DATA RACE
Read at 0x00c00016cac0 by goroutine 29:
  github.com/spf13/pflag.(*FlagSet).VisitAll()
      /home/stefan/usr/go/main/pkg/mod/github.com/spf13/[email protected]/flag.go:277 +0x14a
  github.com/mwitkow/go-flagz.ChecksumFlagSet()
      /home/stefan/Projects/go-flagz/checksum.go:15 +0xc8
  github.com/mwitkow/go-flagz/monitoring.(*flagSetCollector).Collect()
      /home/stefan/Projects/go-flagz/monitoring/collector.go:57 +0x2a2
  github.com/prometheus/client_golang/prometheus.(*Registry).Gather.func1()
      /home/stefan/usr/go/main/pkg/mod/github.com/prometheus/[email protected]/prometheus/registry.go:434 +0x1eb

Previous write at 0x00c00016cac0 by goroutine 28:
  github.com/spf13/pflag.sortFlags()
      /home/stefan/usr/go/main/pkg/mod/github.com/spf13/[email protected]/flag.go:204 +0x2f2
  github.com/spf13/pflag.(*FlagSet).VisitAll()
      /home/stefan/usr/go/main/pkg/mod/github.com/spf13/[email protected]/flag.go:270 +0x1b0
  github.com/mwitkow/go-flagz.ChecksumFlagSet()
      /home/stefan/Projects/go-flagz/checksum.go:15 +0xc8
  github.com/mwitkow/go-flagz/monitoring.(*flagSetCollector).Collect()
      /home/stefan/Projects/go-flagz/monitoring/collector.go:55 +0xe9
  github.com/prometheus/client_golang/prometheus.(*Registry).Gather.func1()
      /home/stefan/usr/go/main/pkg/mod/github.com/prometheus/[email protected]/prometheus/registry.go:434 +0x1eb
```

* Replace package author name, fixing codecgen version mismatch (etcd-io/etcd#10325 (comment))

* add circle config

* Upgrade Prometheus client from v0.9.2 -> v0.9.3 to fix data race condition

* Fixed compile error but the data race is still there...

* Fixing test race condition, albeit heavy handedly

Co-authored-by: Stefan Sakalik <[email protected]>
Co-authored-by: Janos Dobronszki <[email protected]>
Co-authored-by: Thom May <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests