sni / lmd

Livestatus Multitool Daemon - Create livestatus federation from multiple sources
https://labs.consol.de/omd/packages/lmd/
GNU General Public License v3.0
42 stars 31 forks source link

Panic: runtime error: invalid memory address or nil pointer dereference #90

Closed hweidner closed 4 years ago

hweidner commented 4 years ago

I run a test setup with two backends and one frontend. All sites are using Checkmk Raw edition 1.6.0p6.

lmd occasionally crashes with this stack trace:

[2019-12-10 15:47:55.854][Error][main.go:736] Panic: runtime error: invalid memory address or nil pointer dereference
[2019-12-10 15:47:55.855][Error][main.go:737] Version: 1.7.1 (Build: )
[2019-12-10 15:47:55.855][Error][main.go:738] goroutine 195 [running]:
runtime/debug.Stack(0x98f6c0, 0xc0003cd5b0, 0x2)
    /opt/golang/go/src/runtime/debug/stack.go:24 +0x9d
main.logPanicExit()
    /home/harald/go/src/github.com/sni/lmd/lmd/main.go:738 +0x2c3
panic(0x9c15e0, 0xf1e5e0)
    /opt/golang/go/src/runtime/panic.go:679 +0x1b2
main.(*DataStore).GetColumn(...)
    /home/harald/go/src/github.com/sni/lmd/lmd/datastore.go:130
main.GetGroupByData(0xc000033000, 0xc0002360e0, 0x0)
    /home/harald/go/src/github.com/sni/lmd/lmd/virtstore.go:63 +0xb4b
main.(*Peer).GetDataStore(0xc0002360e0, 0x11, 0x9, 0x98e500, 0xc00049c850)
    /home/harald/go/src/github.com/sni/lmd/lmd/peer.go:2902 +0x1c0
main.(*Response).BuildLocalResponse(0xc00008e960, 0xc0003cd3a0, 0x2, 0x2)
    /home/harald/go/src/github.com/sni/lmd/lmd/response.go:483 +0x14f
main.NewResponse(0xc0000eaf20, 0x32f2513100a38820, 0x5defb01b, 0xc0002819d8)
    /home/harald/go/src/github.com/sni/lmd/lmd/response.go:101 +0x43c
main.(*Request).GetResponse(0xc0000eaf20, 0x4899e9948, 0xf309e0, 0x0)
    /home/harald/go/src/github.com/sni/lmd/lmd/request.go:348 +0x147
main.ProcessRequests(0xc0001380b0, 0x1, 0x1, 0xb4b600, 0xc000138068, 0xc00049c4e0, 0xf, 0xc0000ea840, 0x0, 0x0, ...)
    /home/harald/go/src/github.com/sni/lmd/lmd/listener.go:150 +0x30a
main.QueryServer(0xb4b600, 0xc000138068, 0xc0000ea840, 0x0, 0x0)
    /home/harald/go/src/github.com/sni/lmd/lmd/listener.go:98 +0x3f2
main.(*Listener).LocalListenerLivestatus.func2.1(0xc00008e780, 0xb4b600, 0xc000138068, 0xc00014a080)
    /home/harald/go/src/github.com/sni/lmd/lmd/listener.go:330 +0x76
created by main.(*Listener).LocalListenerLivestatus.func2
    /home/harald/go/src/github.com/sni/lmd/lmd/listener.go:326 +0xc1

My configuration looks like:

Listen          = ["127.0.0.1:3333"]

[[Connections]]
name   = "Test 3"
id     = "test3"
source = ["127.0.0.1:6558"]

[[Connections]]
name   = "Test 5"
id     = "test5"
source = ["127.0.0.1:6557"]

# all the other directives are exactly like in lmd.ini.example.
sni commented 4 years ago

i see, seems like the groupby tables don't handle offline peers very well.

sni commented 4 years ago

please try again with the latest HEAD.