Bug 963825 - Sorting distros in web UI throws internal server errors
Sorting distros in web UI throws internal server errors
Status: CLOSED DUPLICATE of bug 972397
Product: Beaker
Classification: Community
Component: web UI (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified (vote)
: ---
: ---
Assigned To: beaker-dev-list
Depends On:
  Show dependency treegraph
Reported: 2013-05-16 11:46 EDT by Jaroslav Kortus
Modified: 2018-02-05 19:41 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-08-02 02:25:15 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jaroslav Kortus 2013-05-16 11:46:34 EDT
Description of problem:

When clicking Distros -> All and then header of the table (like "OS Major Version"), the 500 error is returned to the browser. Logs on beaker side show (0.11.3 version):

2013-05-16 17:42:56,030 cherrypy.msg INFO HTTP: Page handler: <bound method Distros.index of <bkr.server.distro.Distros object at 0x7f7feae485d0>>
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
  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 index
  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
  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 "<string>", line 3, in index
  File "/usr/lib/python2.6/site-packages/turbogears/paginate.py", line 268, in decorated
    output[var_name] = var_data[offset:endpoint]
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/query.py", line 1560, in __getitem__
    return list(res)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/query.py", line 1721, in __iter__
    return self._execute_and_instances(context)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/query.py", line 1726, in _execute_and_instances
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/orm/session.py", line 724, in execute
    clause, params or {})
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 1191, in execute
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 1271, in _execute_clauseelement
    return self.__execute_context(context)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 1302, in __execute_context
    context.parameters[0], context=context)
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 1401, in _cursor_execute
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 1394, in _cursor_execute
  File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/default.py", line 299, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/lib64/python2.6/site-packages/MySQLdb/cursors.py", line 173, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib64/python2.6/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (OperationalError) (1066, "Not unique table/alias: 'osversion'") 'SELECT distro.id AS distro_id, distro.name AS distro_name, distro.osversion_id AS distro_osversion_id, distro.date_created AS distro_date_created \nFROM distro INNER JOIN osversion ON osversion.id = distro.osversion_id INNER JOIN osmajor ON osmajor.id = osversion.osmajor_id LEFT OUTER JOIN osversion ON osversion.id = distro.osversion_id LEFT OUTER JOIN osmajor ON osmajor.id = osversion.osmajor_id \nWHERE EXISTS (SELECT 1 \nFROM distro_tree \nWHERE distro.id = distro_tree.distro_id AND (EXISTS (SELECT 1 \nFROM distro_tree_lab_controller_map \nWHERE distro_tree.id = distro_tree_lab_controller_map.distro_tree_id))) ORDER BY osmajor.osmajor ASC, distro.name ASC, distro.date_created DESC \n LIMIT 0, 50' ()

Version-Release number of selected component (if applicable):
Logs from 0.11.3
Reproducible on 0.12.1

How reproducible:

Steps to Reproduce:
1. Click Distros -> All and try to sort by OS Major version
Actual results:
error 500

Expected results:
sorted list in UI

Additional info:
Comment 2 Dan Callaghan 2013-08-02 02:25:15 EDT

*** This bug has been marked as a duplicate of bug 972397 ***

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