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

Created on 14 Dec 2018  路  26Comments  路  Source: etcd-io/etcd

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

Investigating

Most helpful comment

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.

All 26 comments

having the same problem, can anyone help?

@yeyongyong @maps could you please test #10337

@hexfusion superb! it works

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

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?

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

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.

Seeing the same issue using the latest version

is the latest version containing the fix for this?

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

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

Here's the commit containing the fix: https://github.com/etcd-io/etcd/commit/f3fbedc88f52527ef4dd051bea53e8c99a569831

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

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

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.

@lifangmoler @mnajork-palantir @reefbarman ^

@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

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

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

Still have same problem

@amarox make sure to bump etcd we updated to a go mod friendly version of ugorji/go recently https://github.com/etcd-io/etcd/pull/10481

github.com/coreos/etcd v3.3.12

Still have same problem

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

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

Same problem, this appears to be okay:

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

Bcmills' solution resolved this for me.

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

itnikita picture itnikita  路  3Comments

olalonde picture olalonde  路  4Comments

suresh-chaudhari picture suresh-chaudhari  路  3Comments

el10savio picture el10savio  路  4Comments

hnlq715 picture hnlq715  路  3Comments