Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

Compiled version panics with redefined: log_dir #46

Closed
rosskukulinski opened this issue Feb 27, 2017 · 7 comments
Closed

Compiled version panics with redefined: log_dir #46

rosskukulinski opened this issue Feb 27, 2017 · 7 comments

Comments

@rosskukulinski
Copy link
Contributor

./bundles/kubeless_darwin-amd64/kubeless flag redefined: log_dir
panic: ./bundles/kubeless_darwin-amd64/kubeless flag redefined: log_dir

goroutine 1 [running]:
flag.(*FlagSet).Var(0xc42006e1e0, 0x39765c0, 0xc420308ec0, 0x2ba717b, 0x7, 0x2bd8c0a, 0x2f)
	/usr/local/Cellar/go/1.8/libexec/src/flag/flag.go:793 +0x420
flag.(*FlagSet).StringVar(0xc42006e1e0, 0xc420308ec0, 0x2ba717b, 0x7, 0x0, 0x0, 0x2bd8c0a, 0x2f)
	/usr/local/Cellar/go/1.8/libexec/src/flag/flag.go:696 +0x8b
flag.(*FlagSet).String(0xc42006e1e0, 0x2ba717b, 0x7, 0x0, 0x0, 0x2bd8c0a, 0x2f, 0xc420308eb0)
	/usr/local/Cellar/go/1.8/libexec/src/flag/flag.go:709 +0x90
flag.String(0x2ba717b, 0x7, 0x0, 0x0, 0x2bd8c0a, 0x2f, 0x39c9340)
	/usr/local/Cellar/go/1.8/libexec/src/flag/flag.go:716 +0x69
github.com/skippbox/kubeless/vendor/k8s.io/client-go/1.4/vendor/github.com/golang/glog.init()
	/Users/rossk/dev/gocode/src/github.com/skippbox/kubeless/vendor/k8s.io/client-go/1.4/vendor/github.com/golang/glog/glog_file.go:41 +0x14a
github.com/skippbox/kubeless/vendor/k8s.io/client-go/1.4/pkg/labels.init()
	/Users/rossk/dev/gocode/src/github.com/skippbox/kubeless/vendor/k8s.io/client-go/1.4/pkg/labels/selector.go:823 +0x64
github.com/skippbox/kubeless/vendor/k8s.io/client-go/1.4/pkg/api/unversioned.init()
	/Users/rossk/dev/gocode/src/github.com/skippbox/kubeless/vendor/k8s.io/client-go/1.4/pkg/api/unversioned/zz_generated.deepcopy.go:391 +0x8c
github.com/skippbox/kubeless/vendor/k8s.io/client-go/1.4/pkg/api.init()
	/Users/rossk/dev/gocode/src/github.com/skippbox/kubeless/vendor/k8s.io/client-go/1.4/pkg/api/zz_generated.deepcopy.go:3750 +0x7b
github.com/skippbox/kubeless/vendor/k8s.io/client-go/1.4/rest.init()
	/Users/rossk/dev/gocode/src/github.com/skippbox/kubeless/vendor/k8s.io/client-go/1.4/rest/versions.go:89 +0x82
github.com/skippbox/kubeless/vendor/k8s.io/kubernetes/plugin/pkg/client/auth/gcp.init()
	/Users/rossk/dev/gocode/src/github.com/skippbox/kubeless/vendor/k8s.io/kubernetes/plugin/pkg/client/auth/gcp/gcp.go:120 +0x62
github.com/skippbox/kubeless/vendor/k8s.io/kubernetes/plugin/pkg/client/auth.init()
	/Users/rossk/dev/gocode/src/github.com/skippbox/kubeless/vendor/k8s.io/kubernetes/plugin/pkg/client/auth/plugins.go:24 +0x44
github.com/skippbox/kubeless/vendor/k8s.io/kubernetes/pkg/client/unversioned.init()
	/Users/rossk/dev/gocode/src/github.com/skippbox/kubeless/vendor/k8s.io/kubernetes/pkg/client/unversioned/util.go:80 +0xf0
github.com/skippbox/kubeless/pkg/utils.init()
	/Users/rossk/dev/gocode/src/github.com/skippbox/kubeless/pkg/utils/k8sutil.go:550 +0x89
github.com/skippbox/kubeless/cmd.init()
	/Users/rossk/dev/gocode/src/github.com/skippbox/kubeless/cmd/version.go:37 +0x7f
main.init()
	/Users/rossk/dev/gocode/src/github.com/rosskukulinski/kubeless/main.go:24 +0x44

@sebgoa I'm still learning Golang - is there something I've missed or screwed up?

@rosskukulinski
Copy link
Contributor Author

I should note I'm using go version go1.8 darwin/amd64

@dongsupark
Copy link

dongsupark commented Feb 27, 2017

That's actually not a kubeless-specific issue, but a general issue for every client that depends on k8s.io/client-go. There must be 2 different paths that end up importing glog, although it's not recommended. And that's actually a pain point for everyone who wants to import client-go.
(See also kubernetes/client-go#19 (comment).)

How about cleaning up your local vendor directory, and updating to the current master branch that includes all the vendor? At least it worked for me.

EDIT: you should also run "glide install --strip-vendor" to remove local redundancies.

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)
@dongsupark
Copy link

I just created a PR #47 to strip unnecessary vendors from the kubeless repo. Please try that branch. That should fix the issue of redefinition of log_dir.

@rosskukulinski
Copy link
Contributor Author

thanks @dongsupark - I'll give it a go tonight.

@ngtuna ngtuna closed this as completed in #47 Mar 2, 2017
@gertcuykens
Copy link

seems to be back?

go get -u github.com/kubernetes/kubernetes/cmd/kubectl

kubectl

kubectl flag redefined: log_dir
panic: kubectl flag redefined: log_dir

goroutine 1 [running]:
flag.(*FlagSet).Var(0xc000080180, 0x1c15080, 0xc00003a8b0, 0x1a0cad8, 0x7, 0x1a45267, 0x2f)
        /usr/local/go/src/flag/flag.go:805 +0x529
flag.(*FlagSet).StringVar(0xc000080180, 0xc00003a8b0, 0x1a0cad8, 0x7, 0x0, 0x0, 0x1a45267, 0x2f)
        /usr/local/go/src/flag/flag.go:708 +0x8a
flag.(*FlagSet).String(0xc000080180, 0x1a0cad8, 0x7, 0x0, 0x0, 0x1a45267, 0x2f, 0xc00003a8a0)
        /usr/local/go/src/flag/flag.go:721 +0x8b
flag.String(0x1a0cad8, 0x7, 0x0, 0x0, 0x1a45267, 0x2f, 0x17c7460)
        /usr/local/go/src/flag/flag.go:728 +0x69

@andresmgot
Copy link
Contributor

hi @gertcuykens, that seems to be an error related to kubectl not kubeless. Probably some local dependencies of you are conflicting with the ones vendored in kubectl.

@gertcuykens
Copy link

yea sorry kubernetes/kubernetes#70447

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants