solo-io / squash

The debugger for microservices
https://squash.solo.io
Apache License 2.0
1.74k stars 103 forks source link

DLV debug session is not starting #253

Open slntopp opened 4 years ago

slntopp commented 4 years ago

Kubectl says:

$: kubectl get po -n squash-debugger
NAME         READY   STATUS   RESTARTS   AGE
plankc97b5   0/1     Error    0          2m38s

pod logs:

[36mINFO[0000] plank 0.5.18                                 
{"level":"warn","ts":1597922714.251567,"logger":"squash","caller":"plank/config.go:32","msg":"these are the debug values ingested by plank%!(EXTRA string=debugNamespace, string=default, string=daName, string=jb6gqfw1yn, string=plankName, string=plankgmrvp)"}
v2
DEBU[0000] Cri GetPid called                             attachment="metadata:<name:"jb6gqfw1yn" namespace:"default" resource_version:"709069026" labels:<key:"container_name" value:"apiserver" > labels:<key:"pod_name" value:"my-infinimesh-apiserver-554696674f-p58hr" > labels:<key:"pod_namespace" value:"default" > > status:<> plank_name:"plankgmrvp" debugger:"dlv" image:"quay.io/infinimesh/apiserver:infinidev" pod:"my-infinimesh-apiserver-554696674f-p58hr" container:"apiserver" debug_namespace:"default" "
DEBU[0000] Cri GetPid ListPodSandbox                     inpod="(*v1alpha2.PodSandboxFilter)(0xc000424280)(&PodSandboxFilter{Id:,State:&PodSandboxStateValue{State:SANDBOX_READY,},LabelSelector:map[string]string{io.kubernetes.pod.name: my-infinimesh-apiserver-554696674f-p58hr,io.kubernetes.pod.namespace: default,},})
"
DEBU[0000] Cri GetPid ListContainers                     incont="(*v1alpha2.ContainerFilter)(0xc000320f90)(&ContainerFilter{Id:,State:nil,PodSandboxId:af246ba9f4e727f631b8b2ad641dd9c13113411abcd161f468a2c677b1429105,LabelSelector:map[string]string{io.kubernetes.container.name: apiserver,},})
"
DEBU[0000] Cri GetPid ListContainers - got response      respcont="([]*v1alpha2.Container) (len=1 cap=1) {
 (*v1alpha2.Container)(0xc00018c360)(&Container{Id:b03edf50306ced95c2b8b23848659e327d8420786bed9737609b59f33f998743,PodSandboxId:af246ba9f4e727f631b8b2ad641dd9c13113411abcd161f468a2c677b1429105,Metadata:&ContainerMetadata{Name:apiserver,Attempt:0,},Image:&ImageSpec{Image:quay.io/infinimesh/apiserver@sha256:4bc953ae1e4fae77e3c1824988e60bf2160553e4c59ecc27a9fcd63357c89c77,},ImageRef:sha256:5c7c0fb6c006773aa1e31c5d2e9642d6f16e471c03c1ad28e72dfbf255c78f96,State:CONTAINER_RUNNING,CreatedAt:1597922408000000000,Labels:map[string]string{io.kubernetes.container.name: apiserver,io.kubernetes.pod.name: my-infinimesh-apiserver-554696674f-p58hr,io.kubernetes.pod.namespace: default,io.kubernetes.pod.uid: 86af3195-4c6e-4b02-b9bf-efd7f3db4b46,},Annotations:map[string]string{io.kubernetes.container.hash: a78722b9,io.kubernetes.container.restartCount: 0,io.kubernetes.container.terminationMessagePath: /dev/termination-log,io.kubernetes.container.terminationMessagePolicy: File,io.kubernetes.pod.terminationGracePeriod: 30,},})
}
"
DEBU[0000] Cri GetPid ListContainers - filtered response  containers="([]*v1alpha2.Container) (len=1 cap=1) {
 (*v1alpha2.Container)(0xc00018c360)(&Container{Id:b03edf50306ced95c2b8b23848659e327d8420786bed9737609b59f33f998743,PodSandboxId:af246ba9f4e727f631b8b2ad641dd9c13113411abcd161f468a2c677b1429105,Metadata:&ContainerMetadata{Name:apiserver,Attempt:0,},Image:&ImageSpec{Image:quay.io/infinimesh/apiserver@sha256:4bc953ae1e4fae77e3c1824988e60bf2160553e4c59ecc27a9fcd63357c89c77,},ImageRef:sha256:5c7c0fb6c006773aa1e31c5d2e9642d6f16e471c03c1ad28e72dfbf255c78f96,State:CONTAINER_RUNNING,CreatedAt:1597922408000000000,Labels:map[string]string{io.kubernetes.container.name: apiserver,io.kubernetes.pod.name: my-infinimesh-apiserver-554696674f-p58hr,io.kubernetes.pod.namespace: default,io.kubernetes.pod.uid: 86af3195-4c6e-4b02-b9bf-efd7f3db4b46,},Annotations:map[string]string{io.kubernetes.container.hash: a78722b9,io.kubernetes.container.restartCount: 0,io.kubernetes.container.terminationMessagePath: /dev/termination-log,io.kubernetes.container.terminationMessagePolicy: File,io.kubernetes.pod.terminationGracePeriod: 30,},})
}
"
WARN[0000] Error exec sync to get pid ns!                err="command 'ls -l /proc/self/ns/' exited with 126: "
WARN[0000] getNS error                                   err="command 'ls -l /proc/self/ns/' exited with 126: "
command 'ls -l /proc/self/ns/' exited with 126: 
{"level":"fatal","ts":1597922714.752681,"caller":"plank/main.go:27","msg":"debug failed!","error":"command 'ls -l /proc/self/ns/' exited with 126: ","stacktrace":"main.main
    /workspace/gopath/src/github.com/solo-io/squash/cmd/plank/main.go:27
runtime.main
    /usr/local/go/src/runtime/proc.go:201"}

Is this know problem and how to resolve this? thanks

slntopp commented 4 years ago

Using macOS Catalina 10.15.6 (19G2021) and VS Code 1.48.0