Skip to content

Fix incorrect XPath for guestrecipe in beaker-watchdog#286

Merged
StykMartin merged 1 commit into
beaker-project:release-29from
nes-linux:bugfix-guest-watchdog
Jun 1, 2026
Merged

Fix incorrect XPath for guestrecipe in beaker-watchdog#286
StykMartin merged 1 commit into
beaker-project:release-29from
nes-linux:bugfix-guest-watchdog

Conversation

@kndk
Copy link
Copy Markdown

@kndk kndk commented Jun 1, 2026

When an external watchdog expires for a guest recipe in Virtualization workflow, the following error occurs:

beaker-watchdog[2548]: bkr.labcontroller.watchdog INFO External Watchdog Expired for recipe 226016 on system virt-guest.localdomain
beaker-watchdog[2548]: bkr.labcontroller.proxy DEBUG get_recipe recipe_id:226016
beaker-server[10091]: bkr.server.xmlrpccontroller DEBUG Handling recipes.to_xml (226016,)
beaker-server[10091]: bkr.server.xmlrpccontroller DEBUG Time: 0:00:00.029563 recipes.to_xml (226016,)
beaker-watchdog[2548]: bkr.labcontroller.watchdog ERROR Failed to abort expired watchdog
beaker-watchdog[2548]:  Traceback (most recent call last):
beaker-watchdog[2548]:    File "/usr/lib/python2.7/site-packages/bkr/labcontroller/watchdog.py", line 141, in poll
beaker-watchdog[2548]:      self.abort(recipe_id, system)
beaker-watchdog[2548]:    File "/usr/lib/python2.7/site-packages/bkr/labcontroller/watchdog.py", line 100, in abort
beaker-watchdog[2548]:      task_id = task.get('id')
beaker-watchdog[2548]:  UnboundLocalError: local variable 'task' referenced before assignment
beaker-watchdog[2548]: bkr.labcontroller.watchdog DEBUG Polling for active watchdogs
beaker-server[25605]: bkr.server.xmlrpccontroller DEBUG Handling recipes.tasks.watchdogs ('active',)
beaker-server[25605]: bkr.server.xmlrpccontroller DEBUG Time: 0:00:00.006841 recipes.tasks.watchdogs 

Watchdog.abort() method looks for a guest recipe using XPath 'recipeSet/guestrecipe', but fails because the actual XPath is 'recipeSet/recipe/guestrecipe'.

It then falls back to the parent recipe at 'recipeSet/recipe'. If that recipe has already finished, no running task is found and task remains undefined, resulting in an UnboundLocalError.

Watchdog.abort() method looks for a guest recipe with XPath
'recipeSet/guestrecipe', but the actual XPath is
'recipeSet/recipe/guestrecipe'.

Signed-off-by: Kazuma Kondo <kazuma-kondo@nec.com>
@StykMartin StykMartin self-requested a review June 1, 2026 07:18
@StykMartin StykMartin merged commit 92d6006 into beaker-project:release-29 Jun 1, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants