Description of problem: Exception is thrown when fetching xml results by 'bkr job-results'. It's deterministic for some particular job, but most of the jobs are not affected. Version-Release number of selected component (if applicable): beaker-client-0.5.57-1.el6 How reproducible: very rare Steps to Reproduce: 1. bkr job-results 2. 3. Actual results: Exception: sqlalchemy.exceptions.InvalidRequestError:No rows returned for one() Expected results: result in xml Additional info:
I've found the problem. Investigating a fix.
diff --git a/Server/bkr/server/model.py b/Server/bkr/server/model.py index 4c0914b..8fbb463 100644 --- a/Server/bkr/server/model.py +++ b/Server/bkr/server/model.py @@ -4265,8 +4265,9 @@ class GuestRecipe(Recipe): LabControllerDistro.distro == self.distro, LabControllerDistro.lab_controller == self.system.lab_controller ) - ).one().tree_path - recipe.setAttribute("location", "%s" % location) + ).first() + if location: + recipe.setAttribute("location", "%s" % location.tree_path) return Recipe.to_xml(self, recipe, clone, from_recipeset, from_machine) def _get_distro_requires(self):
I think we still need the available() query, in case someone is looking for machines via System->Available that they may want to manually reserve. available_for_schedule() would ommit these machines.
ack on the Available still. What about an ack on the patch itself?
sorry those comments were for bz636410