# AWX job terminated unexpectedly

**URL:** <https://forum.ansible.com/t/awx-job-terminated-unexpectedly/2256>\
**Category:** Get Help\
**Tags:** collections, awx, ee, kubernetes\
**Created:** [November 9, 2023, 9:12am UTC](https://forum.ansible.com/t/awx-job-terminated-unexpectedly/2256 "2023-11-09T09:12:53Z")\
**Posts on this page:** 10\
**Page:** 2

<div class="post-metadata">

**Author:** ![epi82](https://avatars.discourse-cdn.com/v4/letter/e/ed655f/32.png) [@epi82](https://forum.ansible.com/u/epi82)\
**Post date:** [February 7, 2024, 4:48pm UTC](https://forum.ansible.com/t/awx-job-terminated-unexpectedly/2256/21 "2024-02-07T16:48:04Z")

</div>

@kurokobo Thank you for the reply.

For A) the “image\_pull\_policy” I think I can temporarily modify the awx-operator spec and set it to “Always” as I can see here:  
[https://docs.ansible.com/automation-controller/4.0.0/html/administration/operator\_advanced\_configurations.html#deploy-a-specific-version-of-awx](https://docs.ansible.com/automation-controller/4.0.0/html/administration/operator_advanced_configurations.html#deploy-a-specific-version-of-awx)

For B) any advice on how to remove the cached image “awx-ee:latest” from AKS?

---

<div class="post-metadata">

**Author:** ![epi82](https://avatars.discourse-cdn.com/v4/letter/e/ed655f/32.png) [@epi82](https://forum.ansible.com/u/epi82)\
**Post date:** [February 22, 2024, 8:07am UTC](https://forum.ansible.com/t/awx-job-terminated-unexpectedly/2256/22 "2024-02-22T08:07:20Z")

</div>

@kurokobo for point B what is the best way to do this?

Thank you very much.

---

<div class="post-metadata">

**Author:** ![kurokobo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kurokobo/32/182_2.png) [@kurokobo](https://forum.ansible.com/u/kurokobo)\
**Post date:** [February 23, 2024, 4:34pm UTC](https://forum.ansible.com/t/awx-job-terminated-unexpectedly/2256/23 "2024-02-23T16:34:32Z")

</div>

I don’t know which is the best, but there are some solutions:

- Deploy dummy pod that uses `awx-ee:latest` with `Always` pull policy on each nodes (This is not a way to remove cached images but a way to renew cached images by forcibly re-pulling the images)
- Connecting to AKS nodes and use `crictl` to remove cached images
  - [Connect to Azure Kubernetes Service (AKS) cluster nodes - Azure Kubernetes Service | Microsoft Learn](https://learn.microsoft.com/en-us/azure/aks/node-access)
  - [Cluster configuration in Azure Kubernetes Services (AKS) - Azure Kubernetes Service | Microsoft Learn](https://learn.microsoft.com/en-us/azure/aks/cluster-configuration#containerd-limitationsdifferences)

- Use Image Cleaner and `ImageList`
  - [Use Image Cleaner on Azure Kubernetes Service (AKS) - Azure Kubernetes Service | Microsoft Learn](https://learn.microsoft.com/en-us/azure/aks/image-cleaner)

---

<div class="post-metadata">

**Author:** ![epi82](https://avatars.discourse-cdn.com/v4/letter/e/ed655f/32.png) [@epi82](https://forum.ansible.com/u/epi82)\
**Post date:** [February 26, 2024, 9:03am UTC](https://forum.ansible.com/t/awx-job-terminated-unexpectedly/2256/24 "2024-02-26T09:03:53Z")

</div>

Thank you @kurokobo for your reply. I will try one of these.

After this there is a way to be sure that I’m using latest image? Maybe something from pod logs… I don’t know.

---

<div class="post-metadata">

**Author:** ![kurokobo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kurokobo/32/182_2.png) [@kurokobo](https://forum.ansible.com/u/kurokobo)\
**Post date:** [February 26, 2024, 9:21am UTC](https://forum.ansible.com/t/awx-job-terminated-unexpectedly/2256/25 "2024-02-26T09:21:58Z")

</div>

You can gather `sha256` of the image by `containerStatusess` from `kubectl get pod <pod-name> -o yaml`:

```bash
$ kubectl -n awx get pod awx-task-97b468984-n5tmf -o yaml
...
status:
  ...
  containerStatuses:
  - ...
    image: quay.io/ansible/awx-ee:latest
    imageID: quay.io/ansible/awx-ee@sha256:a4e53d8d95a90fea0c72a62b7c42eb15e52838841f43bf2dac64dc3fdc429f56
    ...
    name: awx-ee
    ...

```

The `sha256` of the latest `latest` image can be retrieved via [https://quay.io/repository/ansible/awx-ee?tab=tags&tag=latest](https://quay.io/repository/ansible/awx-ee?tab=tags&tag=latest)

The `latest` tag is updated every 12 hours, so it will quickly become not the latest and will disappear from the list, but at least it will include fixes for the issues if it is up-to-date at this time.

---

<div class="post-metadata">

**Author:** ![TheRealHaoLiu](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/therealhaoliu/32/100_2.png) [@TheRealHaoLiu](https://forum.ansible.com/u/TheRealHaoLiu)\
**Post date:** [February 27, 2024, 3:21am UTC](https://forum.ansible.com/t/awx-job-terminated-unexpectedly/2256/26 "2024-02-27T03:21:57Z")

</div>

im thinking pinning awx-ee image in the operator…to the versioned awx-ee image

thoughts?

---

<div class="post-metadata">

**Author:** ![kurokobo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kurokobo/32/182_2.png) [@kurokobo](https://forum.ansible.com/u/kurokobo)\
**Post date:** [February 27, 2024, 4:30am UTC](https://forum.ansible.com/t/awx-job-terminated-unexpectedly/2256/27 "2024-02-27T04:30:05Z")

</div>

> [@TheRealHaoLiu](#):
>
> im thinking pinning awx-ee image in the operator…to the versioned awx-ee image

Of course it should be 😃

Related to:

> <https://github.com/ansible/awx-operator/issues/1484>
>
> \### Please confirm the following
> 
> \- \[X\] I agree to follow this project's \[code o…f conduct\](https://docs.ansible.com/ansible/latest/community/code\_of\_conduct.html).
> \- \[X\] I have checked the \[current issues\](https://github.com/ansible/awx-operator/issues) for duplicates.
> \- \[X\] I understand that the AWX Operator is open source software provided for free and that I might not receive a timely response.
> 
> \### Bug Summary
> 
> While \`image\_version\` is based on \`DEFAULT\_AWX\_VERSION\` environment variable that gets injected during staging process, I have found out, that \`control\_plane\_ee\_image\` via \`\_control\_plane\_ee\_image\` is still hardcoded to \`awx-ee:latest\`.
> This can cause unexpected behaviour, when used with default EE (which is also \`awx-ee:latest\`), as the default EE seems to be pulled with each job run when there is an update to that tag.
> After such unaware change of \`awx-ee:latest\` image, when the \`awx-task\` pod terminates for whatever reason, it will start with never code as intended.
> 
> As now finally awx-ee images are tagged with tags matching awx, I would recommend to use the same tag on ee as well.
> 
> For me, as a workaround, i use following:
> \`\`\`
> spec:
> ...
> init\_container\_image: "{{ \_image }}-ee"
> init\_container\_image\_version: "{{ \_image\_version }}"
> control\_plane\_ee\_image: "{{ \_image }}-ee:{{ \_image\_version }}"
> ...
> \`\`\`
> but this should not be needed if implemented properly.
> 
> \### AWX Operator version
> 
> 2.3.0
> 
> \### AWX version
> 
> 22.4.0
> 
> \### Kubernetes platform
> 
> other (please specify in additional information)
> 
> \### Kubernetes/Platform version
> 
> k3d 5.4.3, kubernetes version v1.23.6+k3s1
> 
> \### Modifications
> 
> no
> 
> \### Steps to reproduce
> 
> \* install default k3d
> \* wait for \`awx-ee:latest\` tag to move
> \* run any job, that will fetch updated \`awx-ee:latest\`
> \* delete \`awx-task\` pod
> \* new awx-task will have changed controlplane image
> 
> \### Expected results
> 
> After installation of AWX via awx-operator, no image should change automatically until deployment of new awx-operator version
> 
> \### Actual results
> 
> awx-ee and control\_plane images might get changed when latest tag moves
> 
> \### Additional information
> 
> \_No response\_
> 
> \### Operator Logs
> 
> \_No response\_

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [February 28, 2024, 9:28pm UTC](https://forum.ansible.com/t/awx-job-terminated-unexpectedly/2256/28 "2024-02-28T21:28:00Z")

</div>

It would be nice if it was more like the other \*\_image specs as well:

```yaml
control_plane_ee_image: quay.io/ansible/awx-ee
control_plane_ee_image_version: 23.8.1

```

---

<div class="post-metadata">

**Author:** ![epi82](https://avatars.discourse-cdn.com/v4/letter/e/ed655f/32.png) [@epi82](https://forum.ansible.com/u/epi82)\
**Post date:** [March 26, 2024, 8:47am UTC](https://forum.ansible.com/t/awx-job-terminated-unexpectedly/2256/30 "2024-03-26T08:47:04Z")

</div>

Thanks for clarifing!

I’ve checked the “sha256” for the “awx-ee:latest” and I think it’s quite updated.

 ![image](https://us1.discourse-cdn.com/ansible/original/2X/2/203479318efa94ee978c8ae6d8aa30b41d244156.png)

By the way yesterday night it happened again the same issue with unexpected terminated job on AWX. So I think the latest mods on awx-ee:latest didn’t solve it.

This should be the error directly from pod awx-task:

```auto
INFO 2024/03/26 00:10:30 Detected Error: EOF for pod awx/automation-job-182941-9cj2d. Will retry 5 more times.

WARNING 2024/03/26 00:10:30 Error opening log stream for pod awx/automation-job-182941-9cj2d. Will retry 5 more times. Error: Get "https://10.1.42.122:10250/containerLogs/awx/automation-job-182941-9cj2d/worker?follow=true&sinceTime=2024-03-26T00%3A10%3A28Z&timestamps=true": proxy error from localhost:9443 while dialing 10.1.42.122:10250, code 503: 503 Service Unavailable

WARNING 2024/03/26 00:10:31 Error opening log stream for pod awx/automation-job-182941-9cj2d. Will retry 4 more times. Error: Get "https://10.1.42.122:10250/containerLogs/awx/automation-job-182941-9cj2d/worker?follow=true&sinceTime=2024-03-26T00%3A10%3A28Z&timestamps=true": proxy error from localhost:9443 while dialing 10.1.42.122:10250, code 503: 503 Service Unavailable

WARNING 2024/03/26 00:10:32 Error opening log stream for pod awx/automation-job-182941-9cj2d. Will retry 3 more times. Error: Get "https://10.1.42.122:10250/containerLogs/awx/automation-job-182941-9cj2d/worker?follow=true&sinceTime=2024-03-26T00%3A10%3A28Z&timestamps=true": proxy error from localhost:9443 while dialing 10.1.42.122:10250, code 503: 503 Service Unavailable

WARNING 2024/03/26 00:10:33 Error opening log stream for pod awx/automation-job-182941-9cj2d. Will retry 2 more times. Error: Get "https://10.1.42.122:10250/containerLogs/awx/automation-job-182941-9cj2d/worker?follow=true&sinceTime=2024-03-26T00%3A10%3A28Z&timestamps=true": proxy error from localhost:9443 while dialing 10.1.42.122:10250, code 503: 503 Service Unavailable

WARNING 2024/03/26 00:10:34 Error opening log stream for pod awx/automation-job-182941-9cj2d. Will retry 1 more times. Error: Get "https://10.1.42.122:10250/containerLogs/awx/automation-job-182941-9cj2d/worker?follow=true&sinceTime=2024-03-26T00%3A10%3A28Z&timestamps=true": proxy error from localhost:9443 while dialing 10.1.42.122:10250, code 503: 503 Service Unavailable

ERROR 2024/03/26 00:10:35 Error opening log stream for pod awx/automation-job-182941-9cj2d. Error: Get "https://10.1.42.122:10250/containerLogs/awx/automation-job-182941-9cj2d/worker?follow=true&sinceTime=2024-03-26T00%!A(MISSING)10%!A(MISSING)28Z&timestamps=true": proxy error from localhost:9443 while dialing 10.1.42.122:10250, code 503: 503 Service Unavailable

WARNING 2024/03/26 00:10:36 Could not read in control service: read unix /var/run/receptor/receptor.sock->@: use of closed network connection

WARNING 2024/03/26 00:10:36 Could not close connection: close unix /var/run/receptor/receptor.sock->@: use of closed network connection

ERROR 2024/03/26 00:10:36 Error deleting pod automation-job-182941-9cj2d: client rate limiter Wait returned an error: context canceled

```

If there is any other check I can do let me know. Thank you very much for your support.

---

<div class="post-metadata">

**Author:** ![epi82](https://avatars.discourse-cdn.com/v4/letter/e/ed655f/32.png) [@epi82](https://forum.ansible.com/u/epi82)\
**Post date:** [April 16, 2024, 7:05am UTC](https://forum.ansible.com/t/awx-job-terminated-unexpectedly/2256/31 "2024-04-16T07:05:31Z")

</div>

Hello,  
yesterday night happened again but I think with a different message… I try to share it to you @kurokobo and @TheRealHaoLiu

 ![image](https://us1.discourse-cdn.com/ansible/original/2X/2/2151983294408c3de96e2022638e82ef32d56a4a.png)  
Failed to JSON parse a line from worker stream. Error: Expecting value: line 1 column 1 (char 0) Line with invalid JSON data: b’’

In awx-task pod I’ve found this error:

```auto
2024-04-16T00:13:44+02:00 2024-04-15 22:13:44,409 ERROR [6a992cbb5ae249be87f608f6d08258ba] awx.main.dispatch Worker failed to run task awx.main.tasks.system.purge_old_stdout_files(*[], **{}
2024-04-16T00:13:44+02:00 Traceback (most recent call last):
2024-04-16T00:13:44+02:00 File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/awx/main/dispatch/worker/task.py", line 103, in perform_work
2024-04-16T00:13:44+02:00 result = self.run_callable(body)
2024-04-16T00:13:44+02:00 File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/awx/main/dispatch/worker/task.py", line 78, in run_callable
2024-04-16T00:13:44+02:00 return _call(*args, **kwargs)
2024-04-16T00:13:44+02:00 File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/awx/main/tasks/system.py", line 378, in purge_old_stdout_files
2024-04-16T00:13:44+02:00 for f in os.listdir(settings.JOBOUTPUT_ROOT):
2024-04-16T00:13:44+02:00 FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/awx/job_status'

```

Any ideas? Thank you very much for your help.

[Previous page](https://forum.ansible.com/t/awx-job-terminated-unexpectedly/2256.md?page=1)
