ansible-community / ara

ARA Records Ansible and makes it easier to understand and troubleshoot.

Home Page:https://ara.recordsansible.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KeyError accessing task['uuid']

phemmer opened this issue · comments

What is the issue ?

I'm not sure exactly what scenario is triggering this, but ARA is throwing a KeyError trying to access self.task['uuid'].

 [WARNING]: Failure using method (v2_playbook_on_task_start) in callback plugin
(<ansible.plugins.callback.ara_default.CallbackModule object at
0x7face92ba180>): 'uuid'

The error is happening here:

task_uuid = self.task["uuid"]

   File "/usr/local/lib/python3.12/site-packages/ara/plugins/callback/ara_default.py", line 504, in v2_playbook_on_task_start
    self._end_task()
  File "/usr/local/lib/python3.12/site-packages/ara/plugins/callback/ara_default.py", line 602, in _end_task
    task_uuid = self.task["uuid"]
                ~~~~~~~~~^^^^^^^^

When I dump the contents of self.task at that point, I get:

{"id": 275, "tags": ["always"], "created": "2023-06-15T02:03:52.759232Z", "updated": "2023-06-15T02:03:52.759244Z", "started": "2023-06-15T02:03:52.754639Z", "ended": null, "duration": null, "name": "Gathering Facts", "action": "gather_facts", "lineno": 1, "handler": false, "status": "running", "play": 89, "file": 2916, "playbook": 79}

The only thing of note is that this is occurring at the start of the task after Gathering Facts task (which is the very first task). I'm not sure how that would impact things, but it's the only thing that stands out.

What should be happening ?

Ok, I think I see what's happening. The image on quay.io is way out of date. quay.io/recordsansible/ara-api:latest is providing 1.5.7. While pip is providing a 1.6.1 client.

Hey @phemmer and thanks for the issue.

The images should not be out of date. I will find time to look into them soon.

I was wrong. There was an issue with our podman where it was pulling the image, but when starting the container it wasn't using the updated image, but instead the old one.

Actually no, quay is out of date, but only some of the tags. It seems latest is correct, but fedora36-distribution-latest is out of date.

I'm working on a PR to update the container images and refresh the versions of things we're testing against: #491

They had gone a bit stale. Sorry about that.

I will let a communication go out as a heads up and plan on merging this early next week.
Updated images will be built and published to both docker hub and quay.io when it lands.

Updated images have been pushed out: https://fosstodon.org/@ara/110631478244640120

I've validated that the updated tags have landed on both so there should no longer be a discrepancy.
Please feel free to confirm as such :)

There are surely more elegant ways of addressing forward/backward compatibility across versions such that the problem is more obvious. The less happy path in the callback plugin could use better exception handling but I think it's out of scope of this particular issue.

The updated images are out and there has been no other reports of strange behaviors for the time being so I'll close this issue. Thanks.