Influxdb timeout

Hi,

I just updated home-assistant from 0.25 to 0.30.2. And now the influxdb connection seems to be not working any more. I tried logging onto the database, checking permission for the home-assistant user and nothing has changed. It also works fine to access it through grafana. I also have another service that pushes stats onto it and that also still works fine.

I didn’t notice any changes in how influxdb is supposed to be set up in the release notes and nor in the wiki/config-help. Only thing that seems to have happened is that there’s a non customizeable timeout added which seem to have something to do with the errors popping up for me.

Has this happened for anyone else?

23:49:19 hass[12940]: ERROR:homeassistant.bootstrap:Error during setup of component influxdb
23:49:19 hass[12940]: Traceback (most recent call last):
23:49:19 hass[12940]: File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 393, in _make_request
23:49:19 hass[12940]: six.raise_from(e, None)
23:49:19 hass[12940]: File "<string>", line 2, in raise_from
23:49:19 hass[12940]: File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 389, in _make_request
23:49:19 hass[12940]: httplib_response = conn.getresponse()
23:49:19 hass[12940]: File "/usr/lib/python3.4/http/client.py", line 1227, in getresponse
23:49:19 hass[12940]: response.begin()
23:49:19 hass[12940]: File "/usr/lib/python3.4/http/client.py", line 386, in begin
23:49:19 hass[12940]: version, status, reason = self._read_status()
23:49:19 hass[12940]: File "/usr/lib/python3.4/http/client.py", line 348, in _read_status
23:49:19 hass[12940]: line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
23:49:19 hass[12940]: File "/usr/lib/python3.4/socket.py", line 374, in readinto
23:49:19 hass[12940]: return self._sock.recv_into(b)
23:49:19 hass[12940]: socket.timeout: timed out
23:49:19 hass[12940]: During handling of the above exception, another exception occurred:
23:49:19 hass[12940]: Traceback (most recent call last):
23:49:19 hass[12940]: File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 423, in send
23:49:19 hass[12940]: timeout=timeout
23:49:19 hass[12940]: File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 640, in urlopen
23:49:19 hass[12940]: _stacktrace=sys.exc_info()[2])
23:49:19 hass[12940]: File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/util/retry.py", line 261, in increment
23:49:19 hass[12940]: raise six.reraise(type(error), error, _stacktrace)
23:49:19 hass[12940]: File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/packages/six.py", line 686, in reraise
23:49:19 hass[12940]: raise value
23:49:19 hass[12940]: File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 595, in urlopen
23:49:19 hass[12940]: chunked=chunked)
23:49:19 hass[12940]: File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 395, in _make_request
23:49:19 hass[12940]: self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
23:49:19 hass[12940]: File "/usr/local/lib/python3.4/dist-packages/requests/packages/urllib3/connectionpool.py", line 315, in _raise_timeout
23:49:19 hass[12940]: raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
23:49:19 hass[12940]: requests.packages.urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='localhost', port=8086): Read timed out. (read timeout=5)
23:49:19 hass[12940]: During handling of the above exception, another exception occurred:
23:49:19 hass[12940]: Traceback (most recent call last):
23:49:19 hass[12940]: File "/usr/local/lib/python3.4/dist-packages/homeassistant/bootstrap.py", line 102, in _setup_component
23:49:19 hass[12940]: result = component.setup(hass, config)
23:49:19 hass[12940]: File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/influxdb.py", line 75, in setup
23:49:19 hass[12940]: influx.query("select * from /.*/ LIMIT 1;")
23:49:19 hass[12940]: File "/var/lib/home-assistant/deps/influxdb/client.py", line 336, in query
23:49:19 hass[12940]: expected_response_code=expected_response_code
23:49:19 hass[12940]: File "/var/lib/home-assistant/deps/influxdb/client.py", line 245, in request
23:49:19 hass[12940]: timeout=self._timeout
23:49:19 hass[12940]: File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 475, in request
23:49:19 hass[12940]: resp = self.send(prep, **send_kwargs)
23:49:19 hass[12940]: File "/usr/local/lib/python3.4/dist-packages/requests/sessions.py", line 596, in send
23:49:19 hass[12940]: r = adapter.send(request, **kwargs)
23:49:19 hass[12940]: File "/usr/local/lib/python3.4/dist-packages/requests/adapters.py", line 499, in send
23:49:19 hass[12940]: raise ReadTimeout(e, request=request)
23:49:19 hass[12940]: requests.exceptions.ReadTimeout: HTTPConnectionPool(host='localhost', port=8086): Read timed out. (read timeout=5)
1 Like

Was using InfluxDB 10.2 (Mar 2016), the problem disappeared when I updated to the lastest (1.0.2) version!

I have exactly the very same problem, using 1.02 from the download site. did you built influx or download the binaries? Thanks!!

I downloaded it from apt, guess that doesn’t matter but if you’re updating from an older version of influx you have to convert your metadata etc files during the update process. There info in the influxdb documentation on their site: https://docs.influxdata.com/influxdb/v1.0/administration/upgrading/
Good luck!

Already did that long ago, was using 0.9 to start with. Same error :frowning:
DId you update to 0.32? Thanks a bunch!

Hi! This is still a problem! Running HA 0.43.0 on a PI3 with Raspbian. Influxdb is version 1.2.0, installed via apt. Home Assistant log is giving me tons of errors every few minutes, just like this:

Traceback (most recent call last):
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/requests/adapters.py", line 423, in send
    timeout=timeout
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 649, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/requests/packages/urllib3/util/retry.py", line 347, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/requests/packages/urllib3/packages/six.py", line 686, in reraise
    raise value
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 388, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/requests/packages/urllib3/connectionpool.py", line 308, in _raise_timeout
    raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
requests.packages.urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='127.0.0.1', port=8086): Read timed out. (read timeout=5)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/influxdb.py", line 155, in influx_event_listener
    influx.write_points(json_body)
  File "/home/homeassistant/.homeassistant/deps/influxdb/client.py", line 402, in write_points
    tags=tags)
  File "/home/homeassistant/.homeassistant/deps/influxdb/client.py", line 447, in _write_points
    expected_response_code=204
  File "/home/homeassistant/.homeassistant/deps/influxdb/client.py", line 289, in write
    headers=headers
  File "/home/homeassistant/.homeassistant/deps/influxdb/client.py", line 245, in request
    timeout=self._timeout
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/requests/sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/requests/sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/requests/adapters.py", line 499, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPConnectionPool(host='127.0.0.1', port=8086): Read timed out. (read timeout=5)

Any further ideas?

I’m having this same exact issue. It doesn’t look like it actually causes any problems but it does clutter up my logs. And I hate disabling logging for some things just to ignore a recurring error.

Did anyone find some solution? Thank you in ad ance

Same issue here as well, currently running 0.55 with the AIO Installer . :confused:

1 Like

HA 0.56.2 last version… the timeout error is still there … Some updates ? or some plan to fix it?
Thank you

has anyone figured this out yet? i love the graphing i’m getting from grafana/influxdb but this is making my log file unreadable…

i am receiving this error
currently installed
HA 0.59.2
influxdb 1.4.2-1
on armbian
cant findout what is the problom,
i have set sonoff tasmota to adjust my local time settings to +330 minutes and using 99 to get my local time.

my error
2017-12-11 03:38:04 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state sensor.disk_used_home=69.5; icon=mdi:harddisk, unit_of_measurement=%, friendly_name=Disk used /home @ 2017-12-11T03:37:33.853639+05:30>, entity_id=sensor.disk_used_home, new_state=<state sensor.disk_used_home=68.5; icon=mdi:harddisk, unit_of_measurement=%, friendly_name=Disk used /home @ 2017-12-11T03:38:04.864133+05:30>>
2017-12-11 03:38:04 ERROR (Recorder) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/urllib3/connectionpool.py”, line 387, in _make_request
six.raise_from(e, None)
File “”, line 2, in raise_from
File “/srv/homeassistant/lib/python3.5/site-packages/urllib3/connectionpool.py”, line 383, in _make_request
httplib_response = conn.getresponse()
File “/usr/lib/python3.5/http/client.py”, line 1197, in getresponse
response.begin()
File “/usr/lib/python3.5/http/client.py”, line 297, in begin
version, status, reason = self._read_status()
File “/usr/lib/python3.5/http/client.py”, line 258, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), “iso-8859-1”)
File “/usr/lib/python3.5/socket.py”, line 575, in readinto
return self._sock.recv_into(b)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/requests/adapters.py”, line 440, in send
timeout=timeout
File “/srv/homeassistant/lib/python3.5/site-packages/urllib3/connectionpool.py”, line 639, in urlopen
_stacktrace=sys.exc_info()[2])
File “/srv/homeassistant/lib/python3.5/site-packages/urllib3/util/retry.py”, line 357, in increment
raise six.reraise(type(error), error, _stacktrace)
File “/srv/homeassistant/lib/python3.5/site-packages/urllib3/packages/six.py”, line 686, in reraise
raise value
File “/srv/homeassistant/lib/python3.5/site-packages/urllib3/connectionpool.py”, line 601, in urlopen
chunked=chunked)
File “/srv/homeassistant/lib/python3.5/site-packages/urllib3/connectionpool.py”, line 389, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
File “/srv/homeassistant/lib/python3.5/site-packages/urllib3/connectionpool.py”, line 309, in _raise_timeout
raise ReadTimeoutError(self, url, “Read timed out. (read timeout=%s)” % timeout_value)
urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host=‘xxx.xxx.xxx.xxx’, port=8086): Read timed out. (read timeout=5)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3.5/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/influxdb.py”, line 225, in influx_event_listener
_write_data(json_body)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/influxdb.py”, line 312, in wrapper
scheduled()
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/influxdb.py”, line 287, in scheduled
method(*args, **kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/influxdb.py”, line 231, in _write_data
influx.write_points(json_body)
File “/srv/homeassistant/lib/python3.5/site-packages/influxdb/client.py”, line 456, in write_points
tags=tags, protocol=protocol)
File “/srv/homeassistant/lib/python3.5/site-packages/influxdb/client.py”, line 506, in _write_points
protocol=protocol
File “/srv/homeassistant/lib/python3.5/site-packages/influxdb/client.py”, line 302, in write
headers=headers
File “/srv/homeassistant/lib/python3.5/site-packages/influxdb/client.py”, line 247, in request
timeout=self._timeout
File “/srv/homeassistant/lib/python3.5/site-packages/requests/sessions.py”, line 508, in request
resp = self.send(prep, **send_kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/requests/sessions.py”, line 618, in send
r = adapter.send(request, **kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/requests/adapters.py”, line 521, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPConnectionPool(host=‘xxx.xxx.xxx.xxx’, port=8086): Read timed out. (read timeout=5)

Please guide,
Thanks in adv.

I have got the same errors in my log. HA and Influxdb latest version.
Influxdb 1.4.2
HA 0.60

any idea how to solve this errors? Getting a lot cluttering my logs.

Is your InfluxDB datastore on SD card?

InfluxDB seems to be rather IO intensive and SD card may not be able to cope with the load. Especially if you have lots of sensors that update often. I moved my InfluxDB data to an external drive (250 GB WD PiDrive) and the timeouts went away. Later I went further and moved it to a dedicated Raspberry Pi 2 with USB SSD, but only because I’ve had them lying around.

I am not using InfluxDB any more but for the notice i was using a Kingston Gold Class10 90/45Mbps card in my Pi3b.

That’s sequential read/write. For InfluxDB random write is the most critical and I think SD cards are just not made for this type of usage. Even if it could cope with the IO, it would wear out rather fast because there’s no wear leveling (unless you use some expensive industrial class cards).