monitor_docker icon indicating copy to clipboard operation
monitor_docker copied to clipboard

Home assistant log error

Open legolas0802 opened this issue 4 years ago • 11 comments
trafficstars

I am on home assistant supervisor and I use the proxy container as per instructions, in the log I find the following error:

Source: custom_components/monitor_docker/helpers.py:268
Integration: Monitor Docker (documentation, issues)
First occurred: 17:51:55 (1 occurrences)
Last logged: 17:51:55

[Docker]: run_docker_events loop ended 

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:586
Integration: Sensore (documentation, issues)
First occurred: 18:02:11 (7 occurrences)
Last logged: 18:02:11

Entity id already exists - ignoring: sensor.docker_containers_total
Entity id already exists - ignoring: sensor.docker_containers_stopped
Entity id already exists - ignoring: sensor.docker_1cpu
Entity id already exists - ignoring: sensor.docker_memory
Entity id already exists - ignoring: sensor.docker_images

with the consequence that those entities disappear for all containers, to see them reappear after a few minutes. All in an infinite cycle.

legolas0802 avatar Nov 12 '21 17:11 legolas0802

Does it happen every 10 minutes? It is possible the proxy container closes that connection every 10 minutes ... is that something you can check? I myself I am not using the proxy container and it looks like you are the first seeing this problem.

ualex73 avatar Nov 12 '21 17:11 ualex73

I check and let you know, but if the container closes the connection, shouldn't all the entities disappear? general docker information and switches remain there and are fully functional

legolas0802 avatar Nov 12 '21 17:11 legolas0802

i checked and it happens every 10 minutes

legolas0802 avatar Nov 12 '21 17:11 legolas0802

Ok, confirmed: https://github.com/Tecnativa/docker-socket-proxy/blob/master/haproxy.cfg

It has: timeout client 10m timeout server 10m

Your connection which closes, is the docker event thread ... so it only gets traffic when a container stops, starts, etc

You can download the haproxy.cfg from the GitHub link (above), modify it (e.g. 10min to 60min), and mount it inside the container.

ualex73 avatar Nov 12 '21 18:11 ualex73

Other option could be: configure a container with "health" check, this should generate event traffic. I cannot do this from monitor_docker.

btw if you run "docker events" you can see the events push from docker on the screen.

ualex73 avatar Nov 12 '21 18:11 ualex73

I tried to increase the container time to 60 minutes, for both the client and the server. The problem is only postponed

legolas0802 avatar Nov 13 '21 18:11 legolas0802

I did another test, deleting the entries: timeout client 10m timeout server 10m the problem no longer arises.

legolas0802 avatar Nov 14 '21 07:11 legolas0802

I am not sure you do not get any "docker events", because those should keep the connection open (aka alive). But thanks for further testing, I will add your fix to the README.

ualex73 avatar Nov 14 '21 08:11 ualex73

sorry if the question is rather stupid, but I have the same problem. however, my docker knowledge is quite poor, can I edit the haproxy via portainer? if not, can you help me how to get these two lines out?

Thanks a lot!

clipse2004 avatar Nov 19 '21 22:11 clipse2004

scusate se la domanda è un po' stupida, ma ho lo stesso problema. tuttavia, la mia conoscenza della finestra mobile è piuttosto scarsa, posso modificare l'haproxy tramite portainer? se no, puoi aiutarmi come ottenere queste due righe?

Molte grazie!

through portainer enter the console of the proxi container in / bin / sh mode, move to the path usr / local / etc / haproxy / haproxy.cfg and with the command "vi" edit the file

legolas0802 avatar Nov 20 '21 16:11 legolas0802

guys, is deleting lines timeout client, timeout server

a true workaround solution? I'm using docker-socket over tcp connection and got the same problem with ha logs

zhuykovkb avatar Jan 31 '22 15:01 zhuykovkb