ffdo / node-informant

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

gluon-collector parser errors #2

Closed tantive closed 8 years ago

tantive commented 8 years ago

gluon-collector gives me many parser errors as shown below. any ideas or suggestions?

INFO[0010] Trying to http listen on :8080
INFO[0030] Discovered new node nodeid=c46e1f66cb1a ERRO[0035] Error parsing json client=[fe80::16cc:20ff:fee1:42d0%bat0]:1001 error=json: cannot unmarshal bool into Go value of type data.BatmanLink json={"neighbours":{"wifi":{"16:cf:21:e1:42:d0":[]},"batadv":{"16:d0:20:e1:42:d0":{"neighbours":{"function: 0x942cd0":true,"02:00:0a:38:00:08":{"lastseen":6.53,"tq":247}}}},"node_id":"14cc20e142d0","function: 0x942cd0":true}} ERRO[0035] Error parsing json client=[fe80::c24a:ff:fe34:5362%bat0]:1001 error=json: cannot unmarshal bool into Go value of type data.BatmanLink json={"neighbours":{"wifi":{"c2:4d:01:34:53:62":{"neighbours":{"ea:e1:28:7f:d4:fc":{"noise":-95,"inactive":0,"signal":-57}}}},"batadv":{"c2:4d:01:34:53:62":{"neighbours":{"function: 0x4c0e58":true,"ea:e1:28:7f:d4:fc":{"lastseen":7.7,"tq":244}}},"c2:4e:00:34:53:62":{"neighbours":{"function: 0x4c0e58":true,"02:00:0a:38:00:08":{"lastseen":6.53,"tq":255}}}},"node_id":"c04a00345362","function: 0x4c0e58":true}} ERRO[0035] Error parsing json client=[fe80::eade:27ff:fef6:d23e%bat0]:1001 error=json: cannot unmarshal bool into Go value of type data.BatmanLink json={"neighbours":{"function: 0xa25e38":true,"batadv":{"e8:de:27:f6:d2:3f":{"neighbours":{"function: 0xa25e38":true,"68:72:51:27:91:64":{"lastseen":2.13,"tq":255},"68:72:51:27:8e:d4":{"lastseen":4.28,"tq":255},"14:cc:20:63:66:95":{"lastseen":4.48,"tq":251}}},"ea:e2:27:f6:d2:3e":{"neighbours":{"function: 0xa25e38":true,"02:00:0a:38:00:01":{"lastseen":3.54,"tq":251}}}},"node_id":"e8de27f6d23e"}}

tantive commented 8 years ago

Root cause for the non parsable "function: ...":"true" entries: https://github.com/freifunkMUC/ffmap-backend/issues/7

Any idea how to ignore them during parsing until the fix propagates to all nodes? It seems that the struct in neighbours.go needs to be extended. I tried this but as I am not a go expert I have no idea how to match a property with an a priori unknown name such as "function: *" ...

dereulenspiegel commented 8 years ago

I will see what encoding/json can do here.

tantive commented 8 years ago

Consider this a low priority, the fix mentioned in my last comment was already rolled out in my community. So only a few nodes that still run on the old affected gluon version don't show up.

dereulenspiegel commented 8 years ago

Since this error only affects the statistics of single nodes (and doesn't crash the whole application), the bug is actually on the client side and there is no easy fix for this on the server side, I am closing this issue.

tantive commented 8 years ago

ack