From c799d51ec8ab993d518adf094b3063966d4a223e Mon Sep 17 00:00:00 2001 From: Peter Braun Date: Mon, 28 Apr 2025 15:21:33 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20keep=20processing=20events,=20even=20if?= =?UTF-8?q?=20previous=20event=20data=20cannot=20be=20pa=E2=80=A6=20(#1596?= =?UTF-8?q?5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: keep processing events, even if previous event data cannot be parsed * change log level to warning --- awx/main/tasks/host_indirect.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/awx/main/tasks/host_indirect.py b/awx/main/tasks/host_indirect.py index d655b9f8a5..632a04a687 100644 --- a/awx/main/tasks/host_indirect.py +++ b/awx/main/tasks/host_indirect.py @@ -77,7 +77,14 @@ def build_indirect_host_data(job: Job, job_event_queries: dict[str, dict[str, st if jq_str_for_event not in compiled_jq_expressions: compiled_jq_expressions[resolved_action] = jq.compile(jq_str_for_event) compiled_jq = compiled_jq_expressions[resolved_action] - for data in compiled_jq.input(event.event_data['res']).all(): + + try: + data_source = compiled_jq.input(event.event_data['res']).all() + except Exception as e: + logger.warning(f'error for module {resolved_action} and data {event.event_data["res"]}: {e}') + continue + + for data in data_source: # From this jq result (specific to a single Ansible module), get index information about this host record if not data.get('canonical_facts'): if not facts_missing_logged: