# On AWX getting JOB  Failure : Task was marked as running but was not present in the job queue, so it has been marked as failed. issue

**URL:** <https://forum.ansible.com/t/on-awx-getting-job-failure-task-was-marked-as-running-but-was-not-present-in-the-job-queue-so-it-has-been-marked-as-failed-issue/37724>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [March 3, 2023, 6:33pm UTC](https://forum.ansible.com/t/on-awx-getting-job-failure-task-was-marked-as-running-but-was-not-present-in-the-job-queue-so-it-has-been-marked-as-failed-issue/37724 "2023-03-03T18:33:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jagruti\_Belani](https://avatars.discourse-cdn.com/v4/letter/j/898d66/32.png) [@Jagruti\_Belani](https://forum.ansible.com/u/Jagruti_Belani)\
**Post date:** [March 3, 2023, 6:33pm UTC](https://forum.ansible.com/t/on-awx-getting-job-failure-task-was-marked-as-running-but-was-not-present-in-the-job-queue-so-it-has-been-marked-as-failed-issue/37724/1 "2023-03-03T18:33:56Z")

</div>

Hi Team,

On AWX 21.5.0 I am running one job for 24x7. out of almost 600 job runs 10 jobs are getting this error: “Task was marked as running but was not present in the job queue, so it has been marked as failed.”

though the job gets completed. playbook runs completely. but in job status it show failed.

please suggest.  
Jagruti

---

<div class="post-metadata">

**Author:** ![shearn](https://avatars.discourse-cdn.com/v4/letter/s/ba8739/32.png) [@shearn](https://forum.ansible.com/u/shearn)\
**Post date:** [March 3, 2023, 9:15pm UTC](https://forum.ansible.com/t/on-awx-getting-job-failure-task-was-marked-as-running-but-was-not-present-in-the-job-queue-so-it-has-been-marked-as-failed-issue/37724/2 "2023-03-03T21:15:29Z")

</div>

I have this when clause that contains a variable named agent\_host and I can’t determine how to rewrite it to remove the mustaches. The logic works, however I get the warning.

when: “‘Linked to: {{ agent\_host }}’ not in nessus\_link\_status.stdout”

[WARNING]: conditional statements should not include jinja2 templating delimiters such as {{ }} or {% %}. Found: ‘Linked to: {{ agent\_host }}’ not in nessus\_link\_status.stdout

Thanks,

Stan

---

<div class="post-metadata">

**Author:** ![Endure\_Kona](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/endure_kona/32/391_2.png) [@Endure\_Kona](https://forum.ansible.com/u/Endure_Kona)\
**Post date:** [March 3, 2023, 9:22pm UTC](https://forum.ansible.com/t/on-awx-getting-job-failure-task-was-marked-as-running-but-was-not-present-in-the-job-queue-so-it-has-been-marked-as-failed-issue/37724/3 "2023-03-03T21:22:34Z")

</div>

when: “‘Linked to: agent\_host’ not in nessus\_link\_status.stdout”

The above works for me.

---

<div class="post-metadata">

**Author:** ![Richard\_Megginson](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/richard_megginson/32/4540_2.png) [@Richard\_Megginson](https://forum.ansible.com/u/Richard_Megginson)\
**Post date:** [March 3, 2023, 9:30pm UTC](https://forum.ansible.com/t/on-awx-getting-job-failure-task-was-marked-as-running-but-was-not-present-in-the-job-queue-so-it-has-been-marked-as-failed-issue/37724/4 "2023-03-03T21:30:21Z")

</div>

Not sure how that would work. This should work

when: “'Linked to: ’ ~ agent\_host not in nessus\_link\_status.stdout”

Another way to do this is to define a local var

vars:  
\_\_str: “Linked to: {{ agent\_host }}” # not sure if the quotes are strictly necessary - I default to using quotes when the string contains “:”  
when: \_\_str not in nessus\_link\_status.stdout

---

<div class="post-metadata">

**Author:** ![AWX\_Project](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AWX\_Project](https://forum.ansible.com/u/AWX_Project)\
**Post date:** [March 8, 2023, 7:43pm UTC](https://forum.ansible.com/t/on-awx-getting-job-failure-task-was-marked-as-running-but-was-not-present-in-the-job-queue-so-it-has-been-marked-as-failed-issue/37724/5 "2023-03-08T19:43:29Z")

</div>

this issue has been reported here [https://github.com/ansible/awx/issues/9594](https://github.com/ansible/awx/issues/9594) but no solution as of yet

AWX Team
