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

Bug #1616793 reported by brenda
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
Ann Taraday

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

Tags: db
brenda (tian-mingming)
Changed in neutron:
assignee: nobody → brenda (tian-mingming)
description: updated
Henry Gessau (gessau)
tags: added: db
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/381520

Changed in neutron:
assignee: brenda (tian-mingming) → Ann Taraday (akamyshnikova)
status: New → In Progress
Changed in neutron:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

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 <email address hidden>
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
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 10.0.0.0b1

This issue was fixed in the openstack/neutron 10.0.0.0b1 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.