From f1a3a131e6901d51c390f187740d752743eb0eb1 Mon Sep 17 00:00:00 2001 From: Ettore Simone Date: Mon, 15 Jun 2026 19:08:20 +0200 Subject: UnicodeDecodeError in PodmanWorker.compare_config During container config comparison, podman's Docker-compat exec API inconsistently demultiplexes the 8-byte frame headers from the output stream depending on podman version, leaving binary bytes in raw_output. This will raise an "UnicodeDecodeError: 'utf-8' codec can't decode byte 0x?? in position 167: invalid start byte" Closes-Bug: 2153943 Change-Id: Ida1c017f50b9a24b88f8962d304eb015fa357211 Signed-off-by: Ettore Simone (cherry picked from commit c99f521356012d5bc42ab3c41a994b67657e86f0) --- ansible/module_utils/kolla_podman_worker.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ansible') diff --git a/ansible/module_utils/kolla_podman_worker.py b/ansible/module_utils/kolla_podman_worker.py index 66e5bba1b..0b9e25ef8 100644 --- a/ansible/module_utils/kolla_podman_worker.py +++ b/ansible/module_utils/kolla_podman_worker.py @@ -538,8 +538,12 @@ class PodmanWorker(ContainerWorker): if rc == 0: return False elif rc == 1: - self._config_diff = (raw_output.decode('utf-8') if - isinstance(raw_output, bytes) else raw_output) + try: + self._config_diff = (raw_output.decode('utf-8') if + isinstance(raw_output, bytes) else + raw_output) + except UnicodeDecodeError: + self._config_diff = 'container changed during config check' return True else: raise Exception('Failed to compare container configuration: ' -- cgit v1.2.3