Bug 831864

Summary: 500 Internal Server Error from utilisation graph
Product: [Retired] Beaker Reporter: Dan Callaghan <dcallagh>
Component: reportsAssignee: Dan Callaghan <dcallagh>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.8CC: bpeck, dcallagh, rmancy, stl
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-26 06:40:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dan Callaghan 2012-06-13 23:21:44 UTC
2012-06-13 19:14:39,559 cherrypy.msg INFO HTTP: Page handler: <bound method Reports.utilisation_graph of <bkr.server.reports.Reports object at 0x7f6a6a236990>>
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/CherryPy-2.3.0-py2.6.egg/cherrypy/_cphttptools.py", line 121, in _run
    self.main()
  File "/usr/lib/python2.6/site-packages/CherryPy-2.3.0-py2.6.egg/cherrypy/_cphttptools.py", line 264, in main
    body = page_handler(*virtual_path, **self.params)
  File "<string>", line 3, in utilisation_graph
  File "/usr/lib/python2.6/site-packages/turbogears/controllers.py", line 361, in expose
    *args, **kw)
  File "<generated code>", line 0, in run_with_transaction
  File "/usr/lib/python2.6/site-packages/peak/rules/core.py", line 153, in __call__
    return self.body(*args, **kw)
  File "/usr/lib/python2.6/site-packages/turbogears/database.py", line 458, in sa_rwt
    retval = func(*args, **kw)
  File "/usr/lib/python2.6/site-packages/turbogears/controllers.py", line 244, in _expose
    @abstract()
  File "<generated code>", line 0, in _expose
  File "/usr/lib/python2.6/site-packages/peak/rules/core.py", line 153, in __call__
    return self.body(*args, **kw)
  File "/usr/lib/python2.6/site-packages/turbogears/controllers.py", line 390, in <lambda>
    fragment, options, args, kw)))
  File "/usr/lib/python2.6/site-packages/turbogears/controllers.py", line 425, in _execute_func
    output = errorhandling.try_call(func, *args, **kw)
  File "/usr/lib/python2.6/site-packages/turbogears/errorhandling.py", line 77, in try_call
    return func(self, *args, **kw)
  File "/usr/lib/python2.6/site-packages/bkr/server/reports.py", line 147, in utilisation_graph
    groups = Group.query.join('systems').order_by(Group.group_name)
  File "<string>", line 1, in <lambda>
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/util.py", line 294, in go
    return fn(*args, **kw)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/query.py", line 1224, in join
    from_joinpoint=from_joinpoint)
  File "<string>", line 1, in <lambda>
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/query.py", line 52, in generate
    fn(self, *args[1:], **kw)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/query.py", line 1326, in _join
    raise NotImplementedError("query.join(a==b) not supported.")
NotImplementedError: query.join(a==b) not supported.

Comment 1 Dan Callaghan 2012-06-13 23:39:20 UTC
This is a regression that was introduced in commit ca896a6a for bug 797584. That commit introduced an association object SystemGroup and so Group.systems is no longer a usable join relationship.

I have a feeling we hit this same problem elsewhere already, the stack trace looks very familiar...

Comment 2 Dan Callaghan 2012-06-14 00:25:06 UTC
(In reply to comment #1)
> I have a feeling we hit this same problem elsewhere already, the stack trace
> looks very familiar...

I was thinking of bug 817568, which is the same issue (joining on Group.systems) but in a different place.

I've just checked all references to Group.systems and System.groups, they are not used in any other joins. We have a few places where we filter on those relationships using .contains() and .any() but it seems sqlalchemy is smart enough to figure out the right thing in those cases.

Comment 3 Dan Callaghan 2012-06-14 00:32:59 UTC
On Gerrit: http://gerrit.beaker-project.org/1135

Comment 5 Dan Callaghan 2012-06-26 06:40:57 UTC
Beaker 0.9.0 has been released.