Skip to content

Commit

Permalink
Catch ImagePullBackOff from receptor workunit..
Browse files Browse the repository at this point in the history
and surface to job_explanation instead of just result traceback so we stop getting the
```
Failed to JSON parse a line from worker stream. Error: Expecting value: line 1 column 1 (char 0) Line with invalid JSON data: b''
```
for this specific case
  • Loading branch information
TheRealHaoLiu committed Dec 5, 2024
1 parent 698a8ae commit 16a034a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions awx/main/tasks/receptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,12 @@ def _run_internal(self, receptor_ctl):
self.task.update_model(self.task.instance.pk, status='pending')
return

if 'ImagePullBackOff' in detail:
logger.warning(detail)
log_name = self.task.instance.log_format
logger.warning(f"Could not launch pod for {log_name}. ImagePullBackOff.")
self.task.runner_callback.delay_update(job_explanation=f'{detail}')

Check warning on line 544 in awx/main/tasks/receptor.py

View check run for this annotation

Codecov / codecov/patch

awx/main/tasks/receptor.py#L541-L544

Added lines #L541 - L544 were not covered by tests

try:
receptor_output = ''
if state_name == 'Failed' and self.task.runner_callback.event_ct == 0:
Expand Down

0 comments on commit 16a034a

Please sign in to comment.