monitor_docker icon indicating copy to clipboard operation
monitor_docker copied to clipboard

Memory Usage stats not available over TCP

Open drinfernoo opened this issue 4 years ago • 6 comments
trafficstars

I have a remote Docker instance being monitored with this component, and I keep seeing these errors in my logs:

2021-05-26 21:36:49 ERROR (Thread-4) [custom_components.monitor_docker.helpers] wyzesense2mqtt: Cannot determine memory usage for container ('usage')
2021-05-26 21:36:49 ERROR (Thread-4) [custom_components.monitor_docker.helpers] wyzesense2mqtt: Raw 'memory_stats' {}

My YAML looks like:

monitor_docker:
  - name: DockerPi
    url: http://192.168.1.220:2375
    containers:
      - wyzesense2mqtt
    rename:
      wyzesense2mqtt: WyzeSense2MQTT

Also, the sensor entities (in my case, sensor.dockerpi_memory, sensor.dockerpi_memory_percent, sensor.dockerpi_wyzesense2mqtt_memory, and sensor.dockerpi_wyzesense2mqtt_memory_percent) gets created, but with an unknown state.

drinfernoo avatar May 27 '21 14:05 drinfernoo

I've actually updated my YAML to not request these statistics:

monitor_docker:
  - name: DockerPi
    url: http://192.168.1.220:2375
    monitored_conditions:
      - state
      - status
      - uptime
      - image
      - 1cpu_percentage
    containers:
      - wyzesense2mqtt
    rename:
      wyzesense2mqtt: WyzeSense2MQTT

And I'm still getting the error from my previous comment... Which makes me feel like the integration isn't respecting my new YAML?

drinfernoo avatar Jun 03 '21 14:06 drinfernoo

Actually, I only today noticed that there's a FAQ about getting memory stats from some platforms. After making that change on my (Raspbian) system, I no longer get the errors in my logs... but I'm still not configured to fetch the memory stats anyways, and am not getting the entities (as expected).

So, it still appears the integration is attempting to fetch memory stats even when not configured to do so.

drinfernoo avatar Sep 04 '21 02:09 drinfernoo

On a semi-related note, what type of changes would need to be made to make this work for a Docker container running inside of an LXC container?

drinfernoo avatar Sep 04 '21 02:09 drinfernoo

Is v1.11 an improvement with the TCP behavior?

Docker inside LXC should work, as long the TCP port is exposed (reachable).

ualex73 avatar Nov 03 '21 14:11 ualex73

I have the same issue. I have removed memory monitoring but I get single error when home assistant starts.

2022-08-15 21:00:37.728 ERROR (Thread-3 (RunDocker)) [custom_components.monitor_docker.helpers] [Docker2] dockerproxy: Cannot determine memory usage for container ('stats')

2022-08-15 21:00:37.817 ERROR (Thread-3 (RunDocker)) [custom_components.monitor_docker.helpers] [Docker2] dockerproxy: Raw 'memory_stats' {}

@drinfernoo what change did you make on raspberry pi?

eyalcha avatar Aug 15 '22 18:08 eyalcha

This solved my issue: https://github.com/ualex73/monitor_docker/issues/26#issuecomment-723016034

eyalcha avatar Aug 15 '22 18:08 eyalcha