ffdo / node-informant

Small utility to collect node information in a Freifunk network via announced
7 stars 4 forks source link

Bug after importing ffmap-backend's nodes.json #1

Closed tcatm closed 8 years ago

tcatm commented 8 years ago

After importing ffmap-backend's nodes.json and running gluon-collector I get this:

ffmap@srv01:~$ gluon-collector -config gluon-collector.conf.yaml 
DEBU[0000] Node 0418d60b9196 was offline                
DEBU[0000] Node 0418d6e71ef2 was offline                
DEBU[0000] Node 10feedaf757a was offline                
DEBU[0000] Node 14cc203b3452 was offline                
DEBU[0000] Node 14cc20474844 was offline                
DEBU[0000] Node 14cc204d0ee6 was offline                
DEBU[0000] Node 14cc20d7ee14 was offline                
DEBU[0000] Node 24a43cd2d5eb was offline                
DEBU[0000] Node 44d9e70b9729 was offline                
DEBU[0000] Node 44d9e723f773 was offline                
DEBU[0000] Node 44d9e74fd0b0 was offline                
DEBU[0000] Node 6466b399f4b0 was offline                
DEBU[0000] Node 6466b39a00ee was offline                
DEBU[0000] Node 6466b3ab4732 was offline                
DEBU[0000] Node 6466b3d43f36 was offline                
DEBU[0000] Node 64700291535a was offline                
DEBU[0000] Node 64700294161e was offline                
DEBU[0000] Node 647002d15c74 was offline                
DEBU[0000] Node 647002d19836 was offline                
DEBU[0000] Node 687251321315 was offline                
DEBU[0000] Node 687251321f33 was offline                
DEBU[0000] Node 6872513227d9 was offline                
DEBU[0000] Node a0f3c1fac594 was offline                
DEBU[0000] Node b0487a99d8ce was offline                
DEBU[0000] Node b0487acb2b7c was offline                
DEBU[0000] Node b0487acb2c32 was offline                
DEBU[0000] Node c46e1f31761e was offline                
DEBU[0000] Node c46e1f3192e6 was offline                
DEBU[0000] Node c46e1f7e9a8a was offline                
DEBU[0000] Node c46e1fe6df78 was offline                
DEBU[0000] Node c4e984be1fcc was offline                
DEBU[0000] Node dc9fdb0c198e was offline                
DEBU[0000] Node dc9fdb902890 was offline                
DEBU[0000] Node e894f650a5ac was offline                
DEBU[0000] Node e894f6682674 was offline                
DEBU[0000] Node e8de27590a4d was offline                
DEBU[0000] Node e8de27f2ec54 was offline                
DEBU[0000] Node f8d1117f41d4 was offline                
DEBU[0000] Node f8d1117f8334 was offline                
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x8 pc=0x4cd504]

goroutine 1 [running]:
github.com/dereulenspiegel/node-informant/gluon-collector/prometheus.initTrafficCounter(0x7f9f42f49160, 0xc8200de870)
    /home/nils/code/foreign/node-informant/src/github.com/dereulenspiegel/node-informant/gluon-collector/prometheus/prometheus.go:127 +0x144
github.com/dereulenspiegel/node-informant/gluon-collector/prometheus.ProcessStoredValues(0x7f9f42f49160, 0xc8200de870)
    /home/nils/code/foreign/node-informant/src/github.com/dereulenspiegel/node-informant/gluon-collector/prometheus/prometheus.go:163 +0x9c
main.main()
    /home/nils/code/foreign/node-informant/src/github.com/dereulenspiegel/node-informant/gluon-collector/main.go:236 +0x197

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
    /usr/lib/go/src/runtime/asm_amd64.s:1696 +0x1

goroutine 5 [syscall]:
os/signal.loop()
    /usr/lib/go/src/os/signal/signal_unix.go:22 +0x18
created by os/signal.init.1
    /usr/lib/go/src/os/signal/signal_unix.go:28 +0x37

goroutine 29 [select]:
github.com/dereulenspiegel/node-informant/gluon-collector/scheduler.(*ScheduledJob).loop(0xc8200e4e00)
    /home/nils/code/foreign/node-informant/src/github.com/dereulenspiegel/node-informant/gluon-collector/scheduler/scheduler.go:45 +0x139
github.com/dereulenspiegel/node-informant/gluon-collector/scheduler.NewJob.func1(0xc8200e4e00)
    /home/nils/code/foreign/node-informant/src/github.com/dereulenspiegel/node-informant/gluon-collector/scheduler/scheduler.go:31 +0x21
created by github.com/dereulenspiegel/node-informant/gluon-collector/scheduler.NewJob
    /home/nils/code/foreign/node-informant/src/github.com/dereulenspiegel/node-informant/gluon-collector/scheduler/scheduler.go:32 +0xfe

goroutine 30 [select]:
github.com/dereulenspiegel/node-informant/gluon-collector/scheduler.(*ScheduledJob).loop(0xc8200e4e40)
    /home/nils/code/foreign/node-informant/src/github.com/dereulenspiegel/node-informant/gluon-collector/scheduler/scheduler.go:45 +0x139
github.com/dereulenspiegel/node-informant/gluon-collector/scheduler.NewJob.func1(0xc8200e4e40)
    /home/nils/code/foreign/node-informant/src/github.com/dereulenspiegel/node-informant/gluon-collector/scheduler/scheduler.go:31 +0x21
created by github.com/dereulenspiegel/node-informant/gluon-collector/scheduler.NewJob
    /home/nils/code/foreign/node-informant/src/github.com/dereulenspiegel/node-informant/gluon-collector/scheduler/scheduler.go:32 +0xfe
dereulenspiegel commented 8 years ago

Can you provide a link to the nodes.json causing this error? This makes it easier to reproduce.

dereulenspiegel commented 8 years ago

@tcatm My current guess is that some nodes don't deliver traffic statistics. Since I use pointers for these they hit nil pointer dereference there. I added a patch, which should fix this. Could you please test against the latest state in master? Also the data causing this error would still be nice, at least for integration in a test, so this doesn't happen again.

dereulenspiegel commented 8 years ago

I implemented a theoretical fix and will create a new release soon. Please reopen this bug report if the error still occurs with the new release.