monitor_docker icon indicating copy to clipboard operation
monitor_docker copied to clipboard

Can't get integration installed

Open erkr opened this issue 2 years ago • 4 comments

Some help needed. I'm running a standard Hass OS setup on a raspberry.

I checked via the web terminal, that there is a folder var/run/docker.sock: image

But I still get this error

This error originated from a custom integration.

Logger: custom_components.monitor_docker.helpers
Source: custom_components/monitor_docker/helpers.py:162 
Integration: Monitor Docker (documentation, issues) 
First occurred: 16:40:22 (1 occurrences) 
Last logged: 16:40:22

[Docker]: Can not connect to Docker API (Missing valid docker_host.Either DOCKER_HOST or local sockets are not available.)
Traceback (most recent call last):
  File "/config/custom_components/monitor_docker/helpers.py", line 162, in __init__
    self._api = aiodocker.Docker(url=url)
  File "/usr/local/lib/python3.10/site-packages/aiodocker/docker.py", line 99, in __init__
    raise ValueError(
ValueError: Missing valid docker_host.Either DOCKER_HOST or local sockets are not available.

Not sure if there is more to do as the FAQ mentions a 'mount' of var/run/docker.sock?!

This is my configuration.yaml:

monitor_docker:
  - name: Docker
    containers:
      - homeassistant
    rename:
      homeassistant: Home Assistant
    monitored_conditions:
      - version
      - containers_running
      - containers_total
      - state
      - status
      - memory

I tried both Hass and homeassistant as container name

Some help would be appreciated as I don't understand how and where to apply that mount command as mentioned in the Readme.

Eric

erkr avatar Feb 21 '23 15:02 erkr

I've got exactly the same question. But not much action going in here! Did you ever solve it?

JGNi avatar Oct 05 '23 15:10 JGNi

Nope

erkr avatar Oct 05 '23 17:10 erkr

I was having the same issue, to overcome this I added:

volumes:
   - /var/run/docker.sock:/var/run/docker.sock   

as the first of my volumes on my home-assistant container and it worked. I hope it helps.

jopijuco avatar Nov 02 '23 16:11 jopijuco

@jopijuco Thanks for your instructions, as it was that long ago, I found other ways to solve my need to monitor file sizes in containers. I'm using command line sensors with ssh to get them Best Eric

erkr avatar Nov 11 '23 19:11 erkr