Home Assistant Docker not able to connect to InfluxDb 2.0 Docker

Hi,
I could use some advice, trying to have Home Assistant Container core-2021.12.10 running on an Asustor NAS connect to InfluxDb:2.0 Docker on same machine.

Being new to Docker, this might be a setup issue around the Docker Containers, but what I get is the error message below in the HA gui when restarting the HA docker.

2022-02-07 18:00:52 ERROR (influxdb) [homeassistant.components.influxdb] Cannot connect to InfluxDB due to ‘[Errno 2] No such file or directory’. Please check that the provided connection details (host, port, etc.) are correct and that your InfluxDB server is running and accessible.

Does anyone know exactly what that means, and what level of error this is?
Is the ‘[Errno 2] No such file or directory’ string coming from HA or from InfluxDb? If I type an invalid IP I get a different kind of message…
How can I debug this further? :slight_smile:

The HA runs in “host” mode network sharing IP 192.168.0.100 with the NAS, influxdb in bridged mode IP 172.17.0.3 publishing port 49155 which is mapped to internal 8086.
I can browse the influxdb from a PC on the local network on http://192.168.0.100:49155
I’ve tried various variants for the setup in HA, but this is the current one:

influxdb:
  api_version:      2
  ssl:              false
  host:             192.168.0.100
  port:             49155
  verify_ssl:       false
  bucket:           e11289f58c66aaa8
  organization:     [16 hexdigits from DB GUI ]
  token:            [TOKEN STRING GENERATED IN DB GUI]
  tags:
    source: HA
  max_retries:      3
  measurement_attr: entity_id
  include:
    domains:
      - sensor
      - binary_sensor

For host I’ve tried at least localhost, 127.0.0.1, 192.168.0.100, and 172.17.0.3 port 8086.
for bucket I’ve tried both the hexstring and the real name home_assistant.

I’ve used influxdb-client-ruby and been able to write data to the InfluxDb that appear in the WEB Gui of the database. This was ran towards 192.168.0.100:49155 from the NAS host.
From within the HA container (shell) I can do a wget http://localhost:49155/index.html and get a file that is obviously originating from the InfluxDb web server.

I’ve tried with InfluxDb:latest as well, same problem.

Any tips or suggestion to what to try would be appreciated a lot.

Rgds,
Sigurd.

Hi
This is my configuration . Port and ip had to be changed (8086 is the standard one)


influxdb:
  api_version: 2
  ssl: false
  host: 192.168.1.8
  port: 8087
  token: !secret INFLUXDB_INIT_ADMIN_TOKEN
  organization: !secret INFLUXDB_ORGANIZATION
  bucket: home_assistant

OK thanks Philippe. I think my port number must be correct in my setup since I can access influxdb with the ruby client, and even wget from within the HA container, I’m using the port shown as exposed port in the portainer setup pages. But is there a second port somehow, I’ve seen configs where two ports have been exposed 8086 and 8083 or something…? I’ve changed the port to 8086 without it changing the behaviour.
I figure the !secret syntax is optional?
I wonder whether the printout ‘No such file or directory’ comes from the influxdb side or the HA side…

For the record I tried influxdb:1.8 which works.

I tracked the problem down to V2 using the ASYNCHRONOUS mode on the influxdb-client, which triggers use of _multithreading and attempts to create system semapores. According to https://github.com/celery/celery/issues/185 this can cause problems if the container doesn’t have a /dev/shm shared memory path, which mine doesn’t seem to have.