Influxdb "invalid config"

I’m running Home Assistant on a RPi 3 and I’ve installed the influxdb add-on, for logging measurements from my Sonoff Pow R2 (flashed with Tasmota).

I’m my configurations.yaml have I added these two lines:

influxdb:
host: 127.0.0.1

However, after rebooting HA says: “The following components and platforms could not be set up: influxdb”

I have no clue why.

Anyone have an idea why it won’t start?

I’m presuming you’ve indented it correctly?

influxdb:
  host: 127.0.0.1

And that your db is configured on port 8086?

Correct, I’ve copy/pasted directly from the documentation. Seems like my formatting disappeared from my post.

Regarding port I haven’t changed the standard port. I’ve tried to include “database: home_assistant”, but with no luck. I’ve also tried to use “localhost” or “192.168.1.5” instead of “127.0.0.1”, but also with no luck.

Is there a way to debug why it won’t run? The “invalid config” is not so helpful.

I run Hassio manually installed on RPi in docker, needed to find InfluxDB docker container name and put it as host, also needed to manually create database called “home_assistant” in Chronograf (port 8888)

this is setting which work for me:

influxdb:
  host: addon_a0d7b954_influxdb
  port: 8086
  database: home_assistant
  username: !secret indb_username
  password: !secret indb_password
  max_retries: 3
  default_measurement: state

At bottom right corner of info page where the log is, there is reload button which sometimes gives more detailed info

Great, I will try that! The username and password, is that for the home_assistant database when you created that? I created mine without user and pass, if I remember right.

Still getting an error… I have no idea why it won’t work. I tried this:

influxdb:
  host: addon_a0d7b954_influxdb
  port: 8086
  database: home_assistant
  username: myusername
  password: mypassword
  max_retries: 3
  default_measurement: state

From HA I get this in the log:

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

can you run “sudo docker ps” or check in Portainer and make sure it is correct container name?

Run it via SSH or is there somewhere in the HA UI I can run it?

I’ve soon tried what feels like everything. influxdb says this in the logs:

user already exists
ERR: user already exists
Warning: It is possible this error is due to not setting a database.
Please set a database with the command "use <database>".

So I go to my influxdb via the pre-installed Chronograf, type in: use home_assistant
And I get:

"received status code 400 from server: err: error parsing query: found USE, expected SELECT, DELETE, SHOW, CREATE, DROP, EXPLAIN, GRANT, REVOKE, ALTER, SET, KILL at line 1, char 1"

The log in HA says:

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

How do I make sure that the database i selected/in use, and that read and write is permitted?

Sorry for resurrecting a dead post but… I’ve tried everything I can think of to solve this same issue. I’ve created new DBs, new users, run queries to supposedly set permissions but still nothing.

Did you ever solve the issue?