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

kube-apiserver flag redefined: log_dir #19

Closed
vklonghml opened this issue Oct 19, 2016 · 4 comments
Closed

kube-apiserver flag redefined: log_dir #19

vklonghml opened this issue Oct 19, 2016 · 4 comments
Labels
kind/support Categorizes issue or PR as a support question.

Comments

@vklonghml
Copy link

hi,forums
when i run go install in cmd/kube-apiserver, then start this binary, the service always failed with
panic(0x305bb20, 0xc8203cb430)
/usr/local/go/src/runtime/panic.go:481 +0x3e6
flag.(_FlagSet).Var(0xc820088300, 0x7f9dde6366a0, 0xc8203cb3e0, 0x42546b0, 0x7, 0x4714660, 0x2f)
/usr/local/go/src/flag/flag.go:776 +0x454
flag.(_FlagSet).StringVar(0xc820088300, 0xc8203cb3e0, 0x42546b0, 0x7, 0x0, 0x0, 0x4714660, 0x2f)
/usr/local/go/src/flag/flag.go:679 +0xc7
flag.(*FlagSet).String(0xc820088300, 0x42546b0, 0x7, 0x0, 0x0, 0x4714660, 0x2f, 0xc8203cb3d0)
/usr/local/go/src/flag/flag.go:692 +0x83
flag.String(0x42546b0, 0x7, 0x0, 0x0, 0x4714660, 0x2f, 0x7f9dde5b4d00)
/usr/local/go/src/flag/flag.go:699 +0x5f
github.com/golang/glog.init()
/opt/k8s/src/github.com/golang/glog/glog_file.go:41 +0x13e
k8s.io/client-go/1.4/pkg/labels.init()
/opt/k8s/src/k8s.io/client-go/1.4/pkg/labels/selector.go:822 +0x5b
k8s.io/client-go/1.4/pkg/api/unversioned.init()
/opt/k8s/src/k8s.io/client-go/1.4/pkg/api/unversioned/zz_generated.deepcopy.go:390 +0x6f
k8s.io/client-go/1.4/pkg/api.init()
/opt/k8s/src/k8s.io/client-go/1.4/pkg/api/zz_generated.deepcopy.go:3749 +0x6e
k8s.io/client-go/1.4/rest.init()
/opt/k8s/src/k8s.io/client-go/1.4/rest/versions.go:88 +0x75
k8s.io/kubernetes/plugin/pkg/client/auth/gcp.init()
/opt/k8s/src/k8s.io/kubernetes/plugin/pkg/client/auth/gcp/gcp.go:119 +0x59
k8s.io/kubernetes/plugin/pkg/client/auth.init()
/opt/k8s/src/k8s.io/kubernetes/plugin/pkg/client/auth/plugins.go:23 +0x3b
k8s.io/kubernetes/pkg/client/unversioned.init()
/opt/k8s/src/k8s.io/kubernetes/pkg/client/unversioned/util.go:79 +0xe7
k8s.io/kubernetes/pkg/controller/serviceaccount.init()
/opt/k8s/src/k8s.io/kubernetes/pkg/controller/serviceaccount/tokens_controller.go:746 +0xa8
k8s.io/kubernetes/cmd/kube-apiserver/app.init()
/opt/k8s/src/k8s.io/kubernetes/cmd/kube-apiserver/app/server.go:310 +0x107
main.init()
/opt/k8s/src/k8s.io/kubernetes/cmd/kube-apiserver/apiserver.go:54 +0x4f

even doing the steps below:
1)run godep restore (godep) in the client-go/1.4 folder, then remove the vendor folder of client-go. Then the packages in your GOPATH will be the only copy
2)or run godep save in your application folder to flatten all dependencies.

the problems can not be resolved, how can i do to solve this, thks.

@caesarxuchao
Copy link
Member

@vklonghml maybe this is not directly related to your problem, but why would k8s.io/kubernetes/cmd/kube-apiserver/apiserver.go ended up calling client-go?

@vsimon
Copy link

vsimon commented Nov 4, 2016

I'm willing to guess that your vendor folder contains two glogs and this is causing the redefinition error i.e.

vendor/github.com/golang/glog
vendor/k8s.io/client-go/vendor/github.com/golang/glog

One quick solution might be to delete the vendor/k8s.io/client-go/vendor/github.com/golang/glog one, rebuild, and try running it again.

@dongsupark
Copy link

Yesterday I hit the same issue with error messages like "flag redefined: log_dir", which was not exactly easy to address.

When a go application depends on client-go, developer should either manually clean up duplicated vendors locally, (like above) or make it selectively vendor k8s.io/client-go. Obviously the latter is a better choice in practice.

In the long term, I think client-go should not include own vendor directories on its own, like being discussed in #83.

@caesarxuchao
Copy link
Member

@dongsupark if client-go doesn't include vendor/, go get users will have a hard time. go get will download from the master branches of the dependent repos, which may not compile with client-go. We need to make trade-off, let's discuss on #83.

dongsupark pushed a commit to endocode/kubeless that referenced this issue Feb 27, 2017
K8s vendor trees should be installed with "glide install
--strip-vendor", so that kubeless doesn't panic with errors like
"flag redefined: log_dir" at runtime.

Fixes vmware-archive#46
See also kubernetes/client-go#19 (comment)
@WilliamDenniss WilliamDenniss added the kind/support Categorizes issue or PR as a support question. label Mar 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question.
Projects
None yet
Development

No branches or pull requests

5 participants