From d263410e46c02b059142b0bd28d209c11cdc9d59 Mon Sep 17 00:00:00 2001 From: Jochen Breuer Date: Wed, 13 Feb 2019 16:50:34 +0100 Subject: [PATCH] Prevents crash when there is no job entry Seems like in rare race conditions it might happen that there is no job entry. This prevents Salt from crashing at that point. --- salt/returners/local_cache.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/salt/returners/local_cache.py b/salt/returners/local_cache.py index 9eeb044c8d..7fedb7167b 100644 --- a/salt/returners/local_cache.py +++ b/salt/returners/local_cache.py @@ -77,6 +77,9 @@ def _walk_through(job_dir): except Exception: log.exception('Failed to deserialize %s', load_path) continue + if not job: + log.error('Deserialization of job succeded but there is no data in %s', load_path) + continue jid = job['jid'] yield jid, job, t_path, final