tim-hellhake / influxdb-bridge

Mozilla Public License 2.0
1 stars 2 forks source link

add an Event to report errors writing to influx #4

Closed chas-iot closed 4 years ago

chas-iot commented 4 years ago

What I'd like is that the first time an error occurs, an event is sent to the Gateway. This event would allow users of the add-on to create notifications ( I use Pushsafer :) ) 'First time' could be the first time in a day, or the first time since the add-on started up.

Background: This morning, for no apparent reason, the Influx bridge just stopped working. There were no updates or any other reason that I can think of that might have caused this. The real issue was not that the error happened - there always will be apparently random errors - but that I was not aware of the issue until much much later, so lost half a day of logging. Below are the logs of the first time this occurred this morning. This set of messages was repeated thousands of times in the logs, hence the requirement for 'first time'. I rebooted the entire server, which fixed the error with brute force.


2020-08-07 08:00:11.578 INFO   : influxdb-bridge: Unhandled Rejection
2020-08-07 08:00:11.580 INFO   : influxdb-bridge: Unhandled Rejection
2020-08-07 08:00:11.581 ERROR  : influxdb-bridge: { Error: Internal Server Error
2020-08-07 08:00:11.583 ERROR  : influxdb-bridge:     at once (/home/pi/.mozilla-iot/addons/influxdb-bridge/node_modules/influx/lib/src/pool.js:240:49)
2020-08-07 08:00:11.584 ERROR  : influxdb-bridge:     at ClientRequest.arg (/home/pi/.mozilla-iot/addons/influxdb-bridge/node_modules/influx/lib/src/pool.js:65:13)
2020-08-07 08:00:11.585 ERROR  : influxdb-bridge:     at Object.onceWrapper (events.js:286:20)
2020-08-07 08:00:11.586 ERROR  : influxdb-bridge:     at ClientRequest.emit (events.js:203:15)
2020-08-07 08:00:11.587 ERROR  : influxdb-bridge:     at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:565:21)
2020-08-07 08:00:11.588 ERROR  : influxdb-bridge:     at HTTPParser.parserOnHeadersComplete (_http_common.js:111:17)
2020-08-07 08:00:11.589 ERROR  : influxdb-bridge:     at Socket.socketOnData (_http_client.js:451:20)
2020-08-07 08:00:11.590 ERROR  : influxdb-bridge:     at Socket.emit (events.js:198:13)
2020-08-07 08:00:11.591 ERROR  : influxdb-bridge:     at addChunk (_stream_readable.js:288:12)
2020-08-07 08:00:11.592 ERROR  : influxdb-bridge:     at readableAddChunk (_stream_readable.js:269:11) message: 'Internal Server Error' }
tim-hellhake commented 4 years ago

What I'd like is that the first time an error occurs, an event is sent to the Gateway

No problem, I'll add it soon.

Internal Server Error

It looks like the HTTP requests to the influx DB failed. Maybe there was a problem with the storage backend?

tim-hellhake commented 4 years ago

The next update adds the option to activate an InfluxDB device that emits error events. You can set the length of the cool-down phase in the config.

chas-iot commented 4 years ago

Thank-you