← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1616793] Re: neutron availability-zone-list got a db error using postgresql

 

Reviewed:  https://review.openstack.org/381520
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=5b9fe3494a80b3185b5d35dccbc71132211dd989
Submitter: Jenkins
Branch:    master

commit 5b9fe3494a80b3185b5d35dccbc71132211dd989
Author: Ann Kamyshnikova <akamyshnikova@xxxxxxxxxxxx>
Date:   Tue Oct 4 11:20:27 2016 +0300

    Fix _list_availability_zones for PostgreSQL
    
    For PostgreSQL  _list_availability_zones crashes if you're using
    GROUP BY without object id. Use with_entities to use group_by
    correctly.
    
    Closes-bug: #1616793
    
    Change-Id: Ibc09666bc5863a1980acd0a34d6545841a93a481


** Changed in: neutron
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1616793

Title:
  neutron availability-zone-list got a db error using postgresql

Status in neutron:
  Fix Released

Bug description:
  when use cli command "neutron availability-zone-list" with postgresql
  db backend,I got a server error,like below:

  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource Traceback (most recent call last):
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/api/v2/resource.py", line 84, in resource
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource     result = method(request=request, **args)
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/oslo_db/api.py", line 148, in wrapper
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource     ectxt.value = e.inner_exc
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource     self.force_reraise()
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource     six.reraise(self.type_, self.value, self.tb)
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/oslo_db/api.py", line 138, in wrapper
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource     return f(*args, **kwargs)
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/api/v2/base.py", line 341, in index
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource     return self._items(request, True, parent_id)
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/api/v2/base.py", line 267, in _items
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource     obj_list = obj_getter(request.context, **kwargs)
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/db/agents_db.py", line 155, in get_availability_zones
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource     context, filters))]
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource   File "/usr/lib/python2.7/site-packages/neutron/db/agents_db.py", line 132, in _list_availability_zones
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource     Agent.agent_type):
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource   File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/query.py", line 2736, in __iter__
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource     return self._execute_and_instances(context)
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource   File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/query.py", line 2751, in _execute_and_instances
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource     result = conn.execute(querycontext.statement, self._params)
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 914, in execute
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource     return meth(self, multiparams, params)
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource   File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource     return connection._execute_clauseelement(self, multiparams, params)
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource     compiled_sql, distilled_params
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource     context)
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1337, in _handle_dbapi_exception
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource     util.raise_from_cause(newraise, exc_info)
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource   File "/usr/lib64/python2.7/site-packages/sqlalchemy/util/compat.py", line 200, in raise_from_cause
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource     reraise(type(exception), exception, tb=exc_tb)
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource     context)
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource     cursor.execute(statement, parameters)
  2016-08-25 13:41:17.808 29748 ERROR neutron.api.v2.resource DBError: (psycopg2.ProgrammingError) column "agents.id" must appear in the GROUP BY clause or be used in an aggregate function

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1616793/+subscriptions


References