monitor_docker icon indicating copy to clipboard operation
monitor_docker copied to clipboard

Container not available anymore

Open derekoharrow opened this issue 2 years ago • 6 comments

I've restarted/recreated some containers due to issues I had with them (which I have to do fairly often for a small set of containers). After having done this I get lots of instances of the following in the log file. I'm guessing monitor_docker is trying to track containers by their container id but re-creating them means that they are now different containers.

2022-06-27 13:18:36 ERROR (Thread-4) [custom_components.monitor_docker.helpers] [Docker] transmission: Container not available anymore (3) (DockerError(404, 'No such container: 4ca29d2f5523de93fe73d8ebf13b1a3e2c5ac4131058a9c144934dbeb8c97adb'))
Traceback (most recent call last):
  File "/config/custom_components/monitor_docker/helpers.py", line 751, in _run
    await self._run_container_info()
  File "/config/custom_components/monitor_docker/helpers.py", line 794, in _run_container_info
    raw = await self._container.show()
  File "/usr/local/lib/python3.9/site-packages/aiodocker/containers.py", line 177, in show
    data = await self.docker._query_json(
  File "/usr/local/lib/python3.9/site-packages/aiodocker/docker.py", line 300, in _query_json
    async with self._query(
  File "/usr/local/lib/python3.9/site-packages/aiodocker/utils.py", line 309, in __aenter__
    resp = await self._coro
  File "/usr/local/lib/python3.9/site-packages/aiodocker/docker.py", line 275, in _do_query
    raise DockerError(response.status, json.loads(what.decode("utf8")))
aiodocker.exceptions.DockerError: DockerError(404, 'No such container: 4ca29d2f5523de93fe73d8ebf13b1a3e2c5ac4131058a9c144934dbeb8c97adb')

Restarting Home Assistant fixes the problem, but only until I have to recreate a container again.

derekoharrow avatar Jun 27 '22 12:06 derekoharrow

Same here, most containers are updated automatically by watchtower, and the log just blows up afterwards with thousands of these errors.

attila123456 avatar Nov 25 '22 09:11 attila123456

@attila123456 The containers have a new name or the same name?

ualex73 avatar Nov 25 '22 15:11 ualex73

@ualex73 Same issue here, and yes, they have the same name.

DcR-NL avatar Nov 25 '22 15:11 DcR-NL

@ualex73 I think it is something to do with the container ID.

When you stop and restart a container, my understanding is that it keeps the same ID.

However, when you re-create a container, such as after pulling a new image down, it get's a new container ID.

I think this is what it is complaining about - it says the container (based on ID) no longer exists. This is technically true, but it has been replaced with a new container ID, but using the same name.

derekoharrow avatar Dec 19 '22 18:12 derekoharrow

Any update or progress on this at all?

derekoharrow avatar Jan 22 '23 22:01 derekoharrow

Is perhaps possible to reload the integration in order to refresh the containers list with current ID? Thanks

dapuzz avatar Jan 23 '23 22:01 dapuzz