Home Assistant Community Add-on: InfluxDB

@frenck - any ideas?

I’m also having the following:

2019-01-16 14:07:50 ERROR (SyncWorker_17) [homeassistant.components.influxdb] Database host is not accessible due to '401: {"error":"authorization failed"}', 
please check your entries in the configuration file (host, port, etc.) and verify that the database exists and is READ/WRITE

Tried removing auth, reinstalling the addon, creating several users, nothing helps.
What is wrong with authentication?

I have no solution, but exactly the same trouble. So glad to see that it’s not only me failing :slight_smile:

That’s what I get in the log:

Catching up, dropped 28 old events
00:28 components/influxdb.py (WARNING)
Catching up, dropped 30 old events
00:26 components/influxdb.py (WARNING)
Catching up, dropped 4 old events
00:24 components/influxdb.py (WARNING)
Write error
00:24 components/influxdb.py (ERROR)

and clicking on the write error, I get some more info:

Log Details (ERROR)
Fri Jan 18 2019 00:24:12 GMT+0100 (CET)

Write error
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 384, in _make_request
    six.raise_from(e, None)
  File "<string>", line 2, in raise_from
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 380, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/lib/python3.6/http/client.py", line 1331, in getresponse
    response.begin()
  File "/usr/local/lib/python3.6/http/client.py", line 297, in begin
    version, status, reason = self._read_status()
  File "/usr/local/lib/python3.6/http/client.py", line 258, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/local/lib/python3.6/socket.py", line 586, 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 "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/local/lib/python3.6/site-packages/urllib3/util/retry.py", line 367, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/local/lib/python3.6/site-packages/urllib3/packages/six.py", line 686, in reraise
    raise value
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 386, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
  File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 306, in _raise_timeout
    raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='a0d7b954-influxdb', port=8086): Read timed out. (read timeout=5)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/influxdb.py", line 316, in write_to_influxdb
    self.influx.write_points(json)
  File "/usr/local/lib/python3.6/site-packages/influxdb/client.py", line 490, in write_points
    tags=tags, protocol=protocol)
  File "/usr/local/lib/python3.6/site-packages/influxdb/client.py", line 551, in _write_points
    protocol=protocol
  File "/usr/local/lib/python3.6/site-packages/influxdb/client.py", line 327, in write
    headers=headers
  File "/usr/local/lib/python3.6/site-packages/influxdb/client.py", line 267, in request
    timeout=self._timeout
  File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 529, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPConnectionPool(host='a0d7b954-influxdb', port=8086): Read timed out. (read timeout=5)

@frenck do you have an Idea how to fix this?

Same issue here. Using Hass.io 0.85.1 and Influxbd 1.2.1.

1 Like

Thx again Frenck! This did the job!

Is there any way we can get HTTPS SSL working on the InfluxDB itself for this add-on? I have setup graphs in HADashboard that pull from Influx but the browser doesnt allow mixed HTTP and HTTPS content. Been trying to find the config and perform the steps on the InfluxDB site:

Mixed Content: The page at ‘’ was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint ‘’. This request has been blocked; the content must be served over HTTPS.

If this is something that’s not possible in addon currently or not working properly, I would suggest you log it as an issue or feature request in the addon’s github page. The forum isn’t necessarily where the developers go frequequently to find existing issues; the github issue tracker is the “proper” place to file an issue.

Thank you i will create a issue in the github page but i wanted to see if anyone else had the SSL issue and if they have solved it before i ask the developers to have to develop something.

I too have the problem that the username and password lines are deleted from the config on restart. Does anyone have a solution for this? Running on a docker install on an Odroid XU4

:tada: Release v1.3.0

This version upgrades InfluxDB & Chronograf to the latest and greatest.
Best of this release is the speed upgrade in starting.

Not only will the add-on wait longer before concluding to fail startup (when awaiting InfluxDB to start with tons of data), it also optimizes the way the add-ons start, which should cut down general startup time (about 50%).

Full Changelog

Changed

  • Fixes spelling error in Dockerfile
  • Removes BountySource links
  • Removes Anchore.io links
  • Updates maintenance year to 2019
  • Refactor of GitLab CI
  • Upgrades add-on base image to 2.2.1
  • Configure Renovate (#15)
  • Replaces add-on link with GitHub link
  • Upgrades gpg to 2.2.4-1ubuntu1.2
  • Upgrades Chronograf to 1.7.7
  • Upgrades InfluxDB to 1.7.3
  • Ups timeout of waiting for Influx to 30 minutes
  • Improves startup time by storing internal authentication

Questions? Join our Discord server! https://discord.me/hassioaddons
Enjoying my add-ons? Consider supporting my work: https://patreon.com/frenck

Still can’t connect with most recent version of addon and HA.

2019-02-06 18:00:57 ERROR (SyncWorker_18) [homeassistant.components.influxdb] Database host is not accessible due to '401: {"error":"authorization failed"}

Reinstalled, created db, user, everything configured by the book.
Can somebody help?

My config is:
Influxdb:


Addon:

{
  "log_level": "info",
  "auth": true,
  "ssl": true,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem"
}

HA:

host: a0d7b954-influxdb
port: 8086
database: homeassistant
username: homeassistant
password: xxxxxxxxx
max_retries: 3
default_measurement: state

This isnt the “correct” answer, but you could try
"auth": false
in your addon configuration. I wouldn’t recommend having this container (it’s ports) open to the internet if you do this though.

yes, disabling the auth allows to connect to the db but it looks so unsecured :slight_smile:
is there any other solution that will remain the db secured enough?

My db is not exposed to the word but still…
Maybe @frenck you know some fix/workaround for this?

Thanks!

Just installed the addOn. Followed the gitHub instructions. Starting the service keeps failing because I’m missing the certfile. Tried uninstalling and reinstalling the addOn, and restarting HA.
What am I missing?

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 

-----------------------------------------------------------
 Hass.io Add-on: InfluxDB v1.3.0

 Scalable datastore for metrics, events, and real-time analytics

 From: Community Hass.io Add-ons
 By: Franck Nijhof <[email protected]>
-----------------------------------------------------------
 amd64 / Linux Mint 19 / HA 0.87.0 / SU 143 / stable
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to INFO
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 02-updates.sh: executing... 

INFO: You are running the latest version of this add-on
[cont-init.d] 02-updates.sh: exited 0.
[cont-init.d] 10-requirements.sh: executing... 
FATAL: The configured certfile is not found
[cont-init.d] 10-requirements.sh: exited 1.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing... 
-----------------------------------------------------------
                Oops! Something went wrong.
 
 We are so sorry, but something went terribly wrong when
 starting or running this add-on.
 
 Be sure to check the log above, line by line, for hints.
-----------------------------------------------------------
[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] syncing disks.
[s6-finish] sending all processes the TERM signal.

I’m assuming you left the default config option of "ssl": true, the same?
If so, it says that it’s missing your SSL certificates. You can set that to false to get things working, but you should look into getting SSL working for a long term solution. The fastest path to success with that is using the DuckDNS addon which also has Let’s Encrypt support.

So like many others here, it looks like InflucDB is working, but the front-end, Chronograph, is not. Or I’m not using it correctly.

I was able to set up db and users following the instructions, and HA is feeding data in, which I can see with Graphana. I even added Glances, and that feeds data in quite well.

However, when I go to Chronograph’s “Host List” tab, I get a “Unable to get Hosts” error. If I mouse over the little HDD icon in the top right, I see Connected to Source: http://localhost:8086 @ http://localhost:8086. No clue if that’s correct.

Likewise, if I go to the “Log Viewer” tab, it seems to just hang forever, in a “searching” mode, with nothing ever showing up.

If I go the the Alerts tab, and try to build an alert rule, the database, measurement, and field areas aren’t populated - there’s nothing there to choose. Ditto on the Explore tab - nothing there.

Anyone know how to fix this?

Also, since I never set up a retention policy or filters, my Influx database is huge (almost 3GB). I’ve now set a retention policy, but it’s not getting any smaller. How do I force it to purge unnecessary entries?

Hello,

My InfluxDB stopped working and I cannot get it back on, any help would be appreciated and praised to everloving sun.

Log Details: `

Database host is not accessible due to ‘HTTPConnectionPool(host=‘a0d7b954-influxdb’, port=8086): Max retries exceeded with url: /write?db=homeassistant (Caused by NewConnectionError(’<urllib3.connection.HTTPConnection object at 0x72ba56b0>: Failed to establish a new connection: [Errno 111] Connection refused’,))', please check your entries in the configuration file (host, port, etc.) and verify that the database exists and is READ/WRITE

Setup failed for influxdb: Component failed to initialize.

Configuration:

host: a0d7b954-influxdb
port: 8086
database: homeassistant
username: homeassistant
password: !secret indb_password
max_retries: 3
default_measurement: state

Edit: fixed. Issue was with expired certificates in duckdns.

I have successfully used influxdb for 6+ months. It recently just stopped working as noted by the hassio notification that the influxdb component and platform could not be set up. That lead me to check the state of the add-on and restart it. I received the following errors in the influxdb add-on detail LOG notes.

I tried a full un-install and re-install and then restart and received the same errors in the influxdb add-on detail LOG notes.

I tend to stay up to date with the latest releases of hassio. I am wondering if this is a broken upgrade from a recent release. However, a quick review of release notes didn’t indicate anything (or I missed it).

Any suggestions?

NOTE: I temporarily disabled ssl to troubleshoot and confirm error is not associated with certfile.
NOTE: I also tried setting the log_level to trace to get more insights and it results in the same log items as listed below with no more info.

{
“log_level”: “info”,
“auth”: true,
“ssl”: false,
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”
}

LOG errors

[s6-init] making user provided files available at /var/run/s6/etc…exited 0.
s6-envuidgid: usage: s6-envuidgid [ -i | -D defaultuid:defaultgid ] [ -u | -g | -B ] [ -n ] account prog…
[s6-init] ensuring user provided files have correct perms…exited 0.
[fix-attrs.d] applying ownership & permissions fixes…
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts…
[cont-init.d] 00-banner.sh: executing…
foreground: warning: unable to spawn /var/run/s6/etc/cont-init.d/00-banner.sh: Permission denied
foreground: fatal: unable to wait for /var/run/s6/etc/cont-init.d/00-banner.sh: No child process
[cont-finish.d] executing container finish scripts…
[cont-finish.d] 99-message.sh: executing…
s6-maximumtime: fatal: unable to spawn /var/run/s6/etc/cont-finish.d/99-message.sh: Permission denied
[cont-finish.d] 99-message.sh: exited 111.
[cont-finish.d] done.
[s6-finish] syncing disks.
[s6-finish] sending all processes the TERM signal.

:tada: Release v2.0.0

Full Changelog

Changed

  • :arrow_up: Upgrades add-on base image to 3.0.0
  • :fire: Removes machines definition from add-on config
  • :hammer: Makes log_level optional
  • :fire: Removes custom log format override
  • :arrow_up: Upgrades InfluxDB to 1.7.5
  • :arrow_up: Upgrades Chronograf to 1.7.8
  • :books: Updates documentation for ARMv7
  • :hammer: Rewrite add-on onto Bashio
  • :hammer: Makes NGinx wait for Chronograph before starting
  • :sparkles: Adds option to disable usage reporting to InfluxData
  • :ambulance: Fixes incorrect architecture download for Influx

Questions? Join our Discord server! https://discord.me/hassioaddons
Enjoying my add-ons? Consider supporting my work: https://patreon.com/frenck