InfluxDb 2 config problem

I have homeassistent running as dockerimage with version tag 2021.12.8 running an influxdb v2 (influxdb:2.1.1) in another docker container. Both itself work fine with many components, grafana, telegraf etc.
I cannot get homeassistent to even accept the configuration. It does not even try to connect.
I have commented out all config params that are optional (but would be necessary for the real connection). Of course I have already tried all combinations.

The error message I get is:

Invalid config for [influxdb]: some but not all values in the same group of inclusion ‘v2_authentication’ @ data[‘influxdb’][<v2_authentication>]. Got None. (See /config/configuration.yaml, line 17).

Here is my config. Line 17 is the first line of this snippet from configuration.yaml.
If i remove the whole influxdb: section, everything works fine

influxdb:
  api_version: 2
  # host: 192.168.1.10
  # ssl: false
  # port: 8086
  token: ## token here ##
  organisation: ## organisation token here here ##
  bucket: homeassistant
  # domains: []

I’ve run into a similar problem, but have no solution I’m afraid. In my case I’m able to run InfluxDB locally in Home Assistant itself, but when I try to connect to an external InfluxDB (v2) I get the same error.

My current configuration attempt is:

influxdb:
# Disabled (but working) local config:
#   host: [Home Assistant node's own IP]
#   port: 8086
#   database: homeassistant
#   username: homeassistant
#   password: [password]

# Non-working external configuration
  api_version: 2
  ssl: false
  host: [IP address of the server on my LAN]
  port: [port]
  token: [token]
  organisation: [16-character code]
  bucket: homeassistant
  precision: s
  max_retries: 3
  default_measurement: state
  tags:
    source: HA

It’s the config of the v2 api that is not working.
In want too run influxdb v2 as i have many other metrics there and do not want an extra influxdb v1 on my small home pc.
influxdb v1 would work of course. With influxdb v2 I can connect grafana via v2 and even v1 api (InfluxQL) but for the influxdb intake there seems to be no v1 api

I’ve also cloned the git and search the sources.
I even was here:
https://github.com/home-assistant/core/blob/caaa1b32c1808e0fd23f9ab42e1f0b481110883d/homeassistant/components/influxdb/init.py
it passes the validate_version_specific_config but has a problem somewhere else.
I was not able to find the error message in the whole repo.

It’s organization with a z :wink:

6 Likes

D’oh! Thank you @koying, I feel like an Anglocentric, US-spelling-phobic fool! I shall test that shortly but am pretty sure you’ve nailed the issue.

Confirmed working for me now. Thanks again!

Saved my day!
Had too be some stupid thing. Work now.
Finally it look like this:

influxdb:
  api_version: 2
  host: ${ip}
  ssl: false
  port: 8086
  token: ${token}
  organization: ${organization-id}
  bucket: ${bucket-name}
4 Likes

Thanks! works perfect

After hours of researching this problem, and already having seen this post, it suddenly hit me: @koying is not a grammar Nazi, he actually points out the problem ! Thank you so much Chris :+1:

1 Like

NEWBIE ALERT.

I have installed influxdb 2_2.7.4 on an old Windows Surface 3 running Linux Mint. I have also installed mariadb on the same machine and this is running very well. The difference is that mariadb uses the Surface 250Gb SSD and influxdb uses a USB 1Tb SSD.

I have installed grafana on the HA x64 box running HAOS using the HA add-on capability.

I cannot get grafana to talk to influxdb.

I can login to influxdb from both the Surface running influxdb and a Windows machine on the same network.

image

I know that the HA influxdb configuration (below) is correct because I can inspect the influxdb data from a remote machine successfully by logging in as above.

influxdb:
  api_version: 2
  ssl: false
  host: 192.168.xx.yy
  port: 8086
  token: !secret influxdb_api_token
  organization: !secret influxdb_organizationid
  bucket: HA
  precision: s
  max_retries: 3
  tags:
    source: HA
  tags_attributes:
    - friendly_name
  default_measurement: units
  exclude:
    entities:
      - zone.home
    domains:
      - persistent_notification
      - person
  include:
    domains:
      - sensor

Within grafana I am using the following configuration. I have checked the redacted urls several times, and they are correct.

But on clicking the Save & test button I get the following error:
InfluxDB returned error: error reading influxDB

This is the configuration of grafana in HA:

I know I am doing something incorrectly, but I am neither skilled or experienced enough to know what I need to change. So all help is greatly appreciated.