fix: keep processing events, even if previous event data cannot be pa… (#15965) (#6922)

* fix: keep processing events, even if previous event data cannot be parsed

* change log level to warning
This commit is contained in:
Peter Braun 2025-05-05 13:26:42 +02:00 committed by GitHub
parent 2bc08b421d
commit 0e28d2590a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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: