beyla icon indicating copy to clipboard operation
beyla copied to clipboard

Beyla crashes when some Kubernetes properties are missing

Open marctc opened this issue 1 year ago • 5 comments
trafficstars

There's en edge case where Kubernetes decoration is enabled but the value of InformersSyncTimeout is not set (time out 0). Beyla logs this error, but the execution continues leading to this panic:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x59c435b]

github.com/grafana/beyla/pkg/internal/transform/kube.(*Database).OwnerPodInfo(0x0, 0xf0000dff)
        /go/pkg/mod/github.com/grafana/[email protected]/pkg/internal/transform/kube/db.go:66 +0x1b
github.com/grafana/beyla/pkg/transform.(*metadataDecorator).do(0xc002fd99e0?, 0xc006685d40)
        /go/pkg/mod/github.com/grafana/[email protected]/pkg/transform/k8s.go:100 +0x28
github.com/grafana/beyla/pkg/transform.(*metadataDecorator).nodeLoop(0xc002fd9670, 0xc00317ee40, 0xc0032b8660)
        /go/pkg/mod/github.com/grafana/[email protected]/pkg/transform/k8s.go:92 +0x14b
github.com/mariomac/pipes/pkg/node.(*Middle[...]).start.func1()
        /go/pkg/mod/github.com/mariomac/[email protected]/pkg/node/node.go:185 +0x3b
created by github.com/mariomac/pipes/pkg/node.(*Middle[...]).start in goroutine 373
        /go/pkg/mod/github.com/mariomac/[email protected]/pkg/node/node.go:184 +0x259

marctc avatar Apr 15 '24 08:04 marctc

I encounter the same issue when enabling the Kubernetes Metadata decoration (through Grafana Alloy) on a local Colima Kubernetes Cluster.

mschmidt291 avatar Apr 17 '24 14:04 mschmidt291

@mschmidt291 this will be fixed in the next Alloy version!

marctc avatar Apr 17 '24 14:04 marctc

is there a workaround for this ?

sanketgawade avatar May 08 '24 19:05 sanketgawade

Any update or workaround for this it is effecting all the go services running on kubernetes.

sambestsolutions avatar May 31 '24 12:05 sambestsolutions

Any update or workaround for this it is effecting all the go services running on kubernetes.

Can you describe the scenario/config where this is happening? thanks

marctc avatar May 31 '24 12:05 marctc