From e0f1f83ab7b2eded8c109f1920a86dcb166dd4aa Mon Sep 17 00:00:00 2001 From: Raz Crimson <52282402+RazCrimson@users.noreply.github.com> Date: Wed, 19 Apr 2023 19:42:37 +0530 Subject: [PATCH] fix: docker - Engine API failing on fetching image cause - prob on Unraid's docker Engine API response issue - 2233 --- glances/plugins/glances_docker.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/glances/plugins/glances_docker.py b/glances/plugins/glances_docker.py index 65f8124e..b2ac0768 100644 --- a/glances/plugins/glances_docker.py +++ b/glances/plugins/glances_docker.py @@ -14,6 +14,8 @@ import threading import time from copy import deepcopy +import requests.exceptions + from glances.compat import iterkeys, itervalues, nativestr, pretty_date from glances.logger import logger from glances.plugins.glances_plugin import GlancesPlugin @@ -252,7 +254,12 @@ class Plugin(GlancesPlugin): # Container Id container_stats['Id'] = container.id # Container Image - container_stats['Image'] = container.image.tags + try: + # See issue 2233 + container_stats['Image'] = container.image.tags + except requests.exceptions.HTTPError: + container_stats['Image'] = '-' + # Global stats (from attrs) # Container Status container_stats['Status'] = container.attrs['State']['Status']