Bug 636410 - Regression: Exception: sqlalchemy.exceptions.InvalidRequestError:No rows returned for one()
Summary: Regression: Exception: sqlalchemy.exceptions.InvalidRequestError:No rows retu...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: command line
Version: 0.7
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Raymond Mancy
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 545868 632609
TreeView+ depends on / blocked
 
Reported: 2010-09-22 07:42 UTC by Šimon Lukašík
Modified: 2019-05-22 13:34 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-09-30 04:57:06 UTC
Embargoed:


Attachments (Terms of Use)

Description Šimon Lukašík 2010-09-22 07:42:51 UTC
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:

Comment 2 Bill Peck 2010-09-22 14:06:29 UTC
I've found the problem. Investigating a fix.

Comment 3 Bill Peck 2010-09-22 14:27:51 UTC
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):

Comment 4 Raymond Mancy 2010-09-23 00:41:43 UTC
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.

Comment 5 Bill Peck 2010-09-23 01:52:39 UTC
ack on the Available still.

What about an ack on the patch itself?

Comment 6 Raymond Mancy 2010-09-23 03:13:36 UTC
sorry those comments were for bz636410


Note You need to log in before you can comment on or make changes to this bug.