hassio-addons/addon-influxdb

InfluxDB not working after updating to 4.8.0

janneho opened this issue ยท 11 comments

Problem/Motivation

InfluxDB not working after update to 4.8.0.
EDIT. influxdb was working, but stopped after updating home assistant core to 2023.11.0.

Actual behavior

Logs shows:

Source: components/influxdb/__init__.py:436
First occurred: 10:24:54 (1 occurrences)
Last logged: 10:24:54

Uncaught thread exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
    self.run()
  File "/usr/src/homeassistant/homeassistant/components/influxdb/__init__.py", line 595, in run
    self.write_to_influxdb(json)
  File "/usr/src/homeassistant/homeassistant/components/influxdb/__init__.py", line 571, in write_to_influxdb
    self.influx.write(json)
  File "/usr/src/homeassistant/homeassistant/components/influxdb/__init__.py", line 436, in write_v1
    influx.write_points(json, time_precision=precision)
  File "/usr/local/lib/python3.11/site-packages/influxdb/client.py", line 603, in write_points
    return self._write_points(points=points,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/influxdb/client.py", line 681, in _write_points
    self.write(
  File "/usr/local/lib/python3.11/site-packages/influxdb/client.py", line 407, in write
    data = make_lines(data, precision).encode('utf-8')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/influxdb/line_protocol.py", line 201, in make_lines
    line = make_line(
           ^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/influxdb/line_protocol.py", line 164, in make_line
    for field_key in sorted(fields.keys()):
                     ^^^^^^^^^^^^^^^^^^^^^
TypeError: '<' not supported between instances of 'datetime.date' and 'str'

Steps to reproduce

Update home assistant core to 2023.11.0 on hassos Raspberry Pi 4.

EDIT. Booted system, and stopped working again. I am clueless, Grafana show logged data, but no new data is logged anymore. Tried just about everything but nothing helps...

Problem solved. I do not what happened, but changed password for influx db user "homeassistant" and in configuration.yaml fixed everything.

I've had this too, all data stopped being logged as of 30th October. I didn't change anything in my configuration.yml but am not sure how to resolve - what did you change @janneho ?

I keep getting this...

-----------------------------------------------------------
 Add-on: InfluxDB
 Scalable datastore for metrics, events, and real-time analytics
-----------------------------------------------------------
 Add-on version: 4.8.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 11.1  (amd64 / qemux86-64)
 Home Assistant Core: 2023.11.2
 Home Assistant Supervisor: 2023.11.3
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------

Logger: homeassistant.components.influxdb
Source: components/influxdb/__init__.py:487
Integration: InfluxDB (documentation, issues)
First occurred: 15 November 2023 at 00:59:32 (2559 occurrences)
Last logged: 19:38:26

InfluxDB database is not accessible due to '404: {"error":"database not found: \"home_assistant_raw\""}'. Please check that the database, username and password are correct and that the specified user has the correct permissions set. Retrying in 60 seconds.

It is not working. I do not know what to do anymore. Old data is available, but can not get it logging new data.

I have 2 yeras of data logged in, do not want to lose that. If i remove addon, and install it again is everything gone?

I'm in exactly the same situation - old data loads fine but no new data added for the past fortnight.

I'm having a similar issue with the 4.8.0 (though the error message that I get says that Kapacitor couldn't start). I solved it by using backups to return the core to 2023.11.1 and Influx to 4.7.0. Personally, I'm suspecting the add on installer believes I'm in a different architecture than what I'm actually at, having issues with several add ons and the errors point in that general direction (but I have very little idea about what I'm doing so use salt to taste).

cont-init: info: running /etc/cont-init.d/influxdb.sh
cont-init: info: /etc/cont-init.d/influxdb.sh exited 0
cont-init: info: running /etc/cont-init.d/kapacitor.sh
/etc/cont-init.d/kapacitor.sh: line 12: 325 Done bashio::var.json reporting "^$(bashio::config 'reporting')" secret "$(< /data/secret)"
326 Segmentation fault (core dumped) | tempio -template /etc/kapacitor/templates/kapacitor.gtpl -out /etc/kapacitor/kapacitor.conf
cont-init: info: /etc/cont-init.d/kapacitor.sh exited 139
cont-init: info: running /etc/cont-init.d/nginx.sh
cont-init: info: /etc/cont-init.d/nginx.sh exited 0
cont-init: warning: some scripts exited nonzero
s6-rc: warning: unable to start service legacy-cont-init: command exited 1
/run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information.
/run/s6/basedir/scripts/rc.init: fatal: stopping the container.
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service base-addon-timezone: stopping

I am having same issue. In my case the conflict was caused in combination with the combination of Hyundai / Kia Connect integration and Influxdb for details refer to

Hyundai-Kia-Connect/kia_uvo#755 (comment)

I am having same issue. In my case the conflict was caused in combination with the combination of Hyundai / Kia Connect integration and Influxdb for details refer to

Hyundai-Kia-Connect/kia_uvo#755 (comment)

Never would i have guessed that it is hyundai integration that is causing this to happen.

I too have hyundai/kia integration installed...

@janneho : the maintainers wrote a work around for this issue: Hyundai-Kia-Connect/kia_uvo@e62b89f. Not yet released, but applying the change manually is easy.

@janneho : the maintainers wrote a work around for this issue: Hyundai-Kia-Connect/kia_uvo@e62b89f. Not yet released, but applying the change manually is easy.

That works, influx works again.

Would it be a good idea and feasable to implement a sanity check of the incoming data, so that a rogue integration cannot wreck the whole database?

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment ๐Ÿ‘
This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!