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

diagnostics stack trace doesn't print a stack trace #4578

Closed
sosiouxme opened this issue Sep 8, 2015 · 4 comments · Fixed by #4737
Closed

diagnostics stack trace doesn't print a stack trace #4578

sosiouxme opened this issue Sep 8, 2015 · 4 comments · Fixed by #4737
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/P2

Comments

@sosiouxme
Copy link
Member

As reported by @nak3 at #4518 (comment) -

If I used openshift ex diagsnotics, I got this message.

$ openshift ex diagnostics
[Note] Determining if client configuration exists for client/cluster diagnostics
Info:  Successfully read a client config file at '/home/knakayam/.kube/config'
[Note] Summary of diagnostics execution (version v1.0.5-264-g11321c4):
[Note] Errors seen: 1
While building the diagnostics, a panic was encountered.
This is a bug in diagnostics. Stack trace follows : 
runtime error: invalid memory address or nil pointer dereference
@liggitt liggitt added kind/bug Categorizes issue or PR as related to a bug. priority/P2 labels Sep 8, 2015
@sosiouxme
Copy link
Member Author

Obviously the original error shouldn't occur (@nak3 any details about your systems deployment would be appreciated), and if it does, a stack trace should indicate where it is.

sosiouxme added a commit to sosiouxme/origin that referenced this issue Sep 8, 2015
@sosiouxme
Copy link
Member Author

@nak3 if you can easily update to latest code and run openshift ex diagnostics against the system in issue 4518 I would appreciate it. I literally never saw this problem during development but I'd like to track it down.

@nak3
Copy link
Contributor

nak3 commented Sep 10, 2015

@sosiouxme Sure. I can easily update to latest code. And I confirmed that I got the stacktrace now. Here is the output.

$ openshift ex diagnostics
[Note] Determining if client configuration exists for client/cluster diagnostics
Info:  Successfully read a client config file at '/home/knakayam/.kube/config'
[Note] Summary of diagnostics execution (version v1.0.5-322-g31315f4):
[Note] Errors seen: 1
While building the diagnostics, a panic was encountered.
This is a bug in diagnostics. Error and stack trace follow: 
runtime error: invalid memory address or nil pointer dereference
/tmp/origin/_output/local/go/src/github.com/openshift/origin/pkg/cmd/experimental/diagnostics/diagnostics.go:155 (0x513123)
    func.002: stack := debug.Stack()
/usr/lib/golang/src/runtime/asm_amd64.s:401 (0x43e035)
    call16: CALLFN(·call16, 16)
/usr/lib/golang/src/runtime/panic.go:387 (0x414d18)
    gopanic: reflectcall(unsafe.Pointer(d.fn), deferArgs(d), uint32(d.siz), uint32(d.siz))
/usr/lib/golang/src/runtime/panic.go:42 (0x41403e)
    panicmem: panic(memoryError)
/usr/lib/golang/src/runtime/sigpanic_unix.go:26 (0x41a8c4)
    sigpanic: panicmem()
/tmp/origin/_output/local/go/src/github.com/openshift/origin/pkg/cmd/experimental/diagnostics/diagnostics.go:169 (0x513cf2)
    func.003: o.Logger.Error("CED3015", fmt.Sprintf("Client configuration failed to load; skipping client and cluster diagnostics due to error: %s", err.Error()))
/tmp/origin/_output/local/go/src/github.com/openshift/origin/pkg/cmd/experimental/diagnostics/diagnostics.go:203 (0x51164d)
    DiagnosticsOptions.RunDiagnostics: }()
/tmp/origin/_output/local/go/src/github.com/openshift/origin/pkg/cmd/experimental/diagnostics/diagnostics.go:85 (0x513005)
    func.001: failed, err, warnCount, errorCount := o.RunDiagnostics()
/tmp/origin/Godeps/_workspace/src/github.com/spf13/cobra/command.go:477 (0x4af894)
    (*Command).execute: c.Run(c, argWoFlags)
/tmp/origin/Godeps/_workspace/src/github.com/spf13/cobra/command.go:551 (0x4affe4)
    (*Command).Execute: err = cmd.execute(flags)
/tmp/origin/_output/local/go/src/github.com/openshift/origin/cmd/openshift/openshift.go:22 (0x401d35)
    main: if err := command.Execute(); err != nil {
/usr/lib/golang/src/runtime/proc.go:63 (0x416863)
    main: main_main()
/usr/lib/golang/src/runtime/asm_amd64.s:2232 (0x440171)
    goexit: 

And then, I found the cause of this issue. I forgot to set --config=/PATH/TO/admin.kubeconfig to the command, so openshift ex used my local /home/knakayam/.kube/config.
However, my /home/knakayam/.kube/config is set for kuberentes server like this:

$ cat /home/knakayam/.kube/config
apiVersion: v1
clusters:
- cluster:
    insecure-skip-tls-verify: true
    server: http://127.0.0.1:8080
  name: local
contexts: []
current-context: ""
kind: Config
preferences: {}
users: []

I think it should be handled like oc command's message. Error in configuration: default cluster has no server defined

@sosiouxme
Copy link
Member Author

It should absolutely handle this gracefully. I'll fix it.

On Wed, Sep 9, 2015 at 9:24 PM, Kenjiro Nakayama notifications@github.com
wrote:

@sosiouxme https://github.com/sosiouxme Sure. I can easily update to
latest code. And I confirmed that I got the stacktrace now. Here is the
output.

$ openshift ex diagnostics
[Note] Determining if client configuration exists for client/cluster diagnostics
Info: Successfully read a client config file at '/home/knakayam/.kube/config'
[Note] Summary of diagnostics execution (version v1.0.5-322-g31315f4):
[Note] Errors seen: 1
While building the diagnostics, a panic was encountered.
This is a bug in diagnostics. Error and stack trace follow:
runtime error: invalid memory address or nil pointer dereference
/tmp/origin/_output/local/go/src/github.com/openshift/origin/pkg/cmd/experimental/diagnostics/diagnostics.go:155 (0x513123)
func.002: stack := debug.Stack()
/usr/lib/golang/src/runtime/asm_amd64.s:401 (0x43e035)
call16: CALLFN(·call16, 16)
/usr/lib/golang/src/runtime/panic.go:387 (0x414d18)
gopanic: reflectcall(unsafe.Pointer(d.fn), deferArgs(d), uint32(d.siz), uint32(d.siz))
/usr/lib/golang/src/runtime/panic.go:42 (0x41403e)
panicmem: panic(memoryError)
/usr/lib/golang/src/runtime/sigpanic_unix.go:26 (0x41a8c4)
sigpanic: panicmem()
/tmp/origin/_output/local/go/src/github.com/openshift/origin/pkg/cmd/experimental/diagnostics/diagnostics.go:169 (0x513cf2)
func.003: o.Logger.Error("CED3015", fmt.Sprintf("Client configuration failed to load; skipping client and cluster diagnostics due to error: %s", err.Error()))
/tmp/origin/_output/local/go/src/github.com/openshift/origin/pkg/cmd/experimental/diagnostics/diagnostics.go:203 (0x51164d)
DiagnosticsOptions.RunDiagnostics: }()
/tmp/origin/_output/local/go/src/github.com/openshift/origin/pkg/cmd/experimental/diagnostics/diagnostics.go:85 (0x513005)
func.001: failed, err, warnCount, errorCount := o.RunDiagnostics()
/tmp/origin/Godeps/_workspace/src/github.com/spf13/cobra/command.go:477 (0x4af894)
(_Command).execute: c.Run(c, argWoFlags)
/tmp/origin/Godeps/_workspace/src/github.com/spf13/cobra/command.go:551 (0x4affe4)
(_Command).Execute: err = cmd.execute(flags)
/tmp/origin/_output/local/go/src/github.com/openshift/origin/cmd/openshift/openshift.go:22 (0x401d35)
main: if err := command.Execute(); err != nil {
/usr/lib/golang/src/runtime/proc.go:63 (0x416863)
main: main_main()
/usr/lib/golang/src/runtime/asm_amd64.s:2232 (0x440171)
goexit:

And then, I found the cause of this issue. I forgot to set
--config=/PATH/TO/admin.kubeconfig to the command, so openshift ex used
my local /home/knakayam/.kube/config.
However, my /home/knakayam/.kube/config is set for kuberentes server like
this:

$ cat /home/knakayam/.kube/config
apiVersion: v1
clusters:

  • cluster:
    insecure-skip-tls-verify: true
    server: http://127.0.0.1:8080
    name: local
    contexts: []
    current-context: ""
    kind: Config
    preferences: {}
    users: []

I think it should be handled like oc command's message. Error in
configuration: default cluster has no server defined


Reply to this email directly or view it on GitHub
#4578 (comment).

sosiouxme added a commit to sosiouxme/origin that referenced this issue Sep 21, 2015
sosiouxme added a commit to sosiouxme/origin that referenced this issue Sep 21, 2015
sosiouxme added a commit to sosiouxme/origin that referenced this issue Sep 21, 2015
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/P2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants