openwisp / openwrt-openwisp-monitoring

OpenWRT monitoring agent for openwisp-monitoring
https://openwisp.io/docs/dev/openwrt-monitoring-agent/
GNU General Public License v3.0
23 stars 20 forks source link

[bug] None is not of type 'object' #102

Open nemesifier opened 2 years ago

nemesifier commented 2 years ago

I receive this error sometimes from the OpenWISP monitoring API (None is not of type 'object'), which goes away on its own but I there must be something causing netjson-monitoring to return invalid ouput.

While debugging this I also noticed this other bug: #101.

nemesifier commented 2 years ago

I found this problem again and while debugging I have noticed that the agent stored an empty file, which was trying to be sent as is (empty). After removing that file the problem went away and the agent started uploading the other data points.

If we fix #101 there's chances that this kind of issue won't affect us anymore even if it happens sporadically. I think it happens as the device boots, if I find out the root cause in the first place I'll report here so we can fix that too.

In any case, to be extra sure, @devkapilbansal can we make sure in #103 that we are discarding and removing data files which are already existing? That is, if an existing data file is being sent, and the server returns 400, we should remove it and not send it again.

devkapilbansal commented 2 years ago

Yes, the file is also removed in case there is 400.