Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

panic when running osm-health on a non-standard OSM namespace #107

Open
draychev opened this issue Oct 13, 2021 · 0 comments
Open

panic when running osm-health on a non-standard OSM namespace #107

draychev opened this issue Oct 13, 2021 · 0 comments

Comments

@draychev
Copy link
Contributor

Ran osm-health on a cluster where OSM controller runs in a namespace other than osm-system. This seems to be causing a invalid memory address or nil pointer dereference

This seems to be happening on the following line, where the object meshInfo is nil:

srcConfigGetter, err = envoy.GetEnvoyConfigGetterForPod(srcPod, meshInfo.OSMVersion)

The object meshInfo is nil because we did not return on the following line:

log.Err(err).Msg("Error getting OSM info")

Details:

$ kc get pods -A
NAMESPACE                                                NAME                                                            READY   STATUS    RESTARTS   AGE
chaos-testing                                            chaos-controller-manager-7458c99b6c-r4nqp                       1/1     Running   0          19h
chaos-testing                                            chaos-daemon-5bznm                                              1/1     Running   0          19h
chaos-testing                                            chaos-daemon-qknmd                                              1/1     Running   0          19h
chaos-testing                                            chaos-dashboard-7d6b886b57-r298x                                1/1     Running   0          19h
kube-system                                              azure-ip-masq-agent-58r54                                       1/1     Running   0          19h
kube-system                                              azure-ip-masq-agent-b8nbg                                       1/1     Running   0          19h
kube-system                                              coredns-autoscaler-54d55c8b75-zghzx                             1/1     Running   0          19h
kube-system                                              coredns-d4866bcb7-674sr                                         1/1     Running   0          19h
kube-system                                              coredns-d4866bcb7-lrxrk                                         1/1     Running   0          19h
kube-system                                              konnectivity-agent-56d5b76d58-7f4kg                             1/1     Running   0          19h
kube-system                                              konnectivity-agent-56d5b76d58-hjpc7                             1/1     Running   0          19h
kube-system                                              kube-proxy-74rv6                                                1/1     Running   0          19h
kube-system                                              kube-proxy-7pzjm                                                1/1     Running   0          19h
kube-system                                              metrics-server-569f6547dd-2bg6s                                 1/1     Running   1          19h
kube-system                                              omsagent-rl9g9                                                  2/2     Running   0          19h
kube-system                                              omsagent-rs-8b988ff4c-8wljq                                     1/1     Running   0          19h
kube-system                                              omsagent-vdsmj                                                  2/2     Running   0          19h
sim-run-ec184916-65fc-4a82-afbb-c43f009a801a-bookbuyer   bookbuyer-pod-sim-run-ec184916-65fc-4a82-afbb-c43f009a801a      2/2     Running   0          19h
sim-run-ec184916-65fc-4a82-afbb-c43f009a801a-bookstore   bookstore-d6cfc7bc7-ctwss                                       2/2     Running   0          15s
sim-run-ec184916-65fc-4a82-afbb-c43f009a801a-bookstore   bookstore-d6cfc7bc7-nwkph                                       2/2     Running   0          11s
sim-run-ec184916-65fc-4a82-afbb-c43f009a801a-bookstore   bookstore-d6cfc7bc7-z75dl                                       2/2     Running   0          19s
sim-run-ec184916-65fc-4a82-afbb-c43f009a801a-bookstore   sim-run-ec184916-65fc-4a82-afbb-c43f009a801a-bookstore-pod      2/2     Running   0          19h
sim-run-ec184916-65fc-4a82-afbb-c43f009a801a-fluent      sim-run-ec184916-65fc-4a82-afbb-c43f009a801a-fluent-bit-27s4x   1/1     Running   0          19h
sim-run-ec184916-65fc-4a82-afbb-c43f009a801a-fluent      sim-run-ec184916-65fc-4a82-afbb-c43f009a801a-fluent-bit-kmgkc   1/1     Running   0          19h
sim-run-ec184916-65fc-4a82-afbb-c43f009a801a-osm         osm-bootstrap-78869db44d-sxl4g                                  1/1     Running   0          19h
sim-run-ec184916-65fc-4a82-afbb-c43f009a801a-osm         osm-controller-67cf494b95-kwwbm                                 1/1     Running   2          19h
sim-run-ec184916-65fc-4a82-afbb-c43f009a801a-osm         osm-grafana-745448f65d-l8n8m                                    1/1     Running   0          19h
sim-run-ec184916-65fc-4a82-afbb-c43f009a801a-osm         osm-injector-ff8fbd89c-qtnvj                                    1/1     Running   1          19h
sim-run-ec184916-65fc-4a82-afbb-c43f009a801a-osm         osm-prometheus-7b859d6898-4wxrg                                 1/1     Running   0          19h
 (git)-[main]-de@derayche:src/osm-health$ ./bin/osm-health connectivity pod-to-pod sim-run-ec184916-65fc-4a82-afbb-c43f009a801a-bookbuyer/bookbuyer-pod-sim-run-ec184916-65fc-4a82-afbb-c43f009a801a sim-run-ec184916-65fc-4a82-afbb-c43f009a801a-bookstore/bookstore-d6cfc7bc7-ctwss
2:28PM INF osm-health version: dev; 12f43f6b7ac8d446e7f29961f59d064a7edca3af; 2021-10-13 file=main.go:65 module=main
2:28PM TRC Looking for Pod with Name=bookbuyer-pod-sim-run-ec184916-65fc-4a82-afbb-c43f009a801a in namespace=sim-run-ec184916-65fc-4a82-afbb-c43f009a801a-bookbuyer file=pod.go:33 module=kubernetes/pod
2:28PM TRC Looking for pod sim-run-ec184916-65fc-4a82-afbb-c43f009a801a-bookbuyer/bookbuyer-pod-sim-run-ec184916-65fc-4a82-afbb-c43f009a801a file=pod.go:47 module=kubernetes/pod
2:28PM TRC Found Pod sim-run-ec184916-65fc-4a82-afbb-c43f009a801a-bookbuyer/bookbuyer-pod-sim-run-ec184916-65fc-4a82-afbb-c43f009a801a file=pod.go:50 module=kubernetes/pod
2:28PM TRC Looking for Pod with Name=bookstore-d6cfc7bc7-ctwss in namespace=sim-run-ec184916-65fc-4a82-afbb-c43f009a801a-bookstore file=pod.go:33 module=kubernetes/pod
2:28PM TRC Looking for pod sim-run-ec184916-65fc-4a82-afbb-c43f009a801a-bookstore/bookstore-d6cfc7bc7-ctwss file=pod.go:47 module=kubernetes/pod
2:28PM TRC Found Pod sim-run-ec184916-65fc-4a82-afbb-c43f009a801a-bookstore/bookstore-d6cfc7bc7-ctwss file=pod.go:50 module=kubernetes/pod
2:28PM INF Testing connectivity from sim-run-ec184916-65fc-4a82-afbb-c43f009a801a-bookbuyer/bookbuyer-pod-sim-run-ec184916-65fc-4a82-afbb-c43f009a801a to sim-run-ec184916-65fc-4a82-afbb-c43f009a801a-bookstore/bookstore-d6cfc7bc7-ctwss file=pod-to-pod.go:23 module=connectivity
2:28PM ERR Error getting OSM info error="osm-controller deployment not found in osm-system namespace" file=pod-to-pod.go:32 module=connectivity
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x1d68438]

goroutine 1 [running]:
github.com/openservicemesh/osm-health/pkg/connectivity.PodToPod(0xc0008e6400, 0xc000c1c800, 0x235d27e, 0xa)
        /home/de/src/osm-health/pkg/connectivity/pod-to-pod.go:57 +0x2f8
main.newConnectivityPodToPodCmd.func1(0xc000856780, 0xc0006abdc0, 0x2, 0x2, 0x0, 0x0)
        /home/de/src/osm-health/cmd/connectivity_pod_to_pod.go:44 +0x1b9
github.com/spf13/cobra.(*Command).execute(0xc000856780, 0xc0006abd80, 0x2, 0x2, 0xc000856780, 0xc0006abd80)
        /home/de/go/pkg/mod/github.com/spf13/[email protected]/command.go:852 +0x472
github.com/spf13/cobra.(*Command).ExecuteC(0xc000856280, 0x2382018, 0x1e, 0xc000a9ff48)
        /home/de/go/pkg/mod/github.com/spf13/[email protected]/command.go:960 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
        /home/de/go/pkg/mod/github.com/spf13/[email protected]/command.go:897
main.main()
        /home/de/src/osm-health/cmd/main.go:67 +0x13a
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants