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-up.sh failed with template error #5423

Closed
satnam6502 opened this issue Mar 13, 2015 · 4 comments · Fixed by #5454
Closed

kube-up.sh failed with template error #5423

satnam6502 opened this issue Mar 13, 2015 · 4 comments · Fixed by #5454
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@satnam6502
Copy link
Contributor

$ cluster/kube-up.sh
Starting cluster using provider: gce
... calling verify-prereqs
... calling kube-up
Project: kubernetes-satnam2
Zone: us-central1-b
current-context: "kubernetes-satnam2_kubernetes/"
Running: cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../_output/dockerized/bin/darwin/amd64/kubectl config view -o template --template={{$dot := .}}{{with $ctx := index $dot "current-context"}}{{$user := index $dot "contexts" $ctx "user"}}{{index $dot "users" $user "username"}}{{end}}
F0312 21:55:41.334190   20430 command.go:399] error executing template '{{$dot := .}}{{with $ctx := index $dot "current-context"}}{{$user := index $dot "contexts" $ctx "user"}}{{index $dot "users" $user "username"}}{{end}}': 'template: output:1:69: executing "output" at <index $dot "contexts...>: error calling index: index of nil pointer'
----data----
map[contexts:map[kubernetes-satnam2_e2e-test-satnam:map[cluster:kubernetes-satnam2_e2e-test-satnam user:kubernetes-satnam2_e2e-test-satnam-admin]] current-context:kubernetes-satnam2_kubernetes/ preferences:map[] clusters:map[kubernetes-satnam2_e2e-test-satnam:map[server:https://23.251.158.195 certificate-authority:/Users/satnam/.kube/kubernetes-satnam2_e2e-test-satnam/kubernetes.ca.crt]] users:map[kubernetes-satnam2_kubernetes-admin:map[auth-path:/Users/satnam/.kube/kubernetes-satnam2_kubernetes/kubernetes_auth] kubernetes-satnam2_e2e-test-satnam-admin:map[auth-path:/Users/satnam/.kube/kubernetes-satnam2_e2e-test-satnam/kubernetes_auth]]]
@satnam6502 satnam6502 added the kind/bug Categorizes issue or PR as related to a bug. label Mar 13, 2015
@satnam6502
Copy link
Contributor Author

Retrying after rm -rf kubernetes-satnam2_kubernetes/ gave no joy.

@satnam6502
Copy link
Contributor Author

Trying kubectl config unset current-context did not help.

$ kubectl config unset current-context
$ cluster/kube-up.sh
Starting cluster using provider: gce
... calling verify-prereqs
... calling kube-up

Project: kubernetes-satnam2
Zone: us-central1-b
current-context: "kubernetes-satnam2_kubernetes/"
Running: cluster/../cluster/gce/../../cluster/../cluster/../cluster/gce/../../cluster/../_output/dockerized/bin/darwin/amd64/kubectl config view -o template --template={{$dot := .}}{{with $ctx := index $dot "current-context"}}{{$user := index $dot "contexts" $ctx "user"}}{{index $dot "users" $user "username"}}{{end}}
F0312 22:09:00.920747   20611 command.go:399] error executing template '{{$dot := .}}{{with $ctx := index $dot "current-context"}}{{$user := index $dot "contexts" $ctx "user"}}{{index $dot "users" $user "username"}}{{end}}': 'template: output:1:69: executing "output" at <index $dot "contexts...>: error calling index: index of nil pointer'
----data----
map[preferences:map[] clusters:map[kubernetes-satnam2_e2e-test-satnam:map[server:https://23.251.158.195 certificate-authority:/Users/satnam/.kube/kubernetes-satnam2_e2e-test-satnam/kubernetes.ca.crt]] users:map[kubernetes-satnam2_e2e-test-satnam-admin:map[auth-path:/Users/satnam/.kube/kubernetes-satnam2_e2e-test-satnam/kubernetes_auth] kubernetes-satnam2_kubernetes-admin:map[auth-path:/Users/satnam/.kube/kubernetes-satnam2_kubernetes/kubernetes_auth]] contexts:map[kubernetes-satnam2_e2e-test-satnam:map[cluster:kubernetes-satnam2_e2e-test-satnam user:kubernetes-satnam2_e2e-test-satnam-admin]] current-context:kubernetes-satnam2_kubernetes/]

@satnam6502 satnam6502 added priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. priority/backlog Higher priority than priority/awaiting-more-evidence. and removed priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. labels Mar 13, 2015
@j3ffml
Copy link
Contributor

j3ffml commented Mar 13, 2015

kubectl config unset current-context --global will fix it. The problem is that your kubeconfig's current-context doesn't have a corresponding context entry. I'll see if I can make it gce's kube-up little more robust to invalid kubeconfig entries.

@satnam6502
Copy link
Contributor Author

Thank you @jlowdermilk kindly for your help again. My brain is simply not large enough to remember all this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants