yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #60291
[Bug 1654195] Re: query resource with some filter return 500 error
Reviewed: https://review.openstack.org/416932
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=22707fb3d2a621d2f632f395f8d77c3f9e83c90d
Submitter: Jenkins
Branch: master
commit 22707fb3d2a621d2f632f395f8d77c3f9e83c90d
Author: ZhaoBo <zhaobo6@xxxxxxxxxx>
Date: Thu Jan 5 17:36:18 2017 +0800
Add filter check for quering
Neutron rasises 500 error if the filter is the resources'
object property.
This patch add the check to prevent querying with base_db property.
Change-Id: I1aec4c1537e687e9087c468a592802779f370cb3
Closes-Bug: #1654195
** 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/1654195
Title:
query resource with some filter return 500 error
Status in neutron:
Fix Released
Bug description:
Use restAPI to query resource with the filter key like our base db
model attributes. It will hit internel error. As the api layer not
stop these kind values to db layer. The process will take these values
to query the resource in db.
GET /v2.0/networks?__contains__=1
2017-01-05 11:59:26.592 ERROR neutron.api.v2.resource [req-be7a2100-f0e2-4604-abfa-63f290b08719 admin a4d7fafd8b6e42f5aa1de690e360d285] index failed: No details.
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource Traceback (most recent call last):
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/resource.py", line 79, in resource
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource result = method(request=request, **args)
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/db/api.py", line 92, in wrapped
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource setattr(e, '_RETRY_EXCEEDED', True)
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource self.force_reraise()
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/db/api.py", line 88, in wrapped
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource return f(*args, **kwargs)
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 151, in wrapper
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource ectxt.value = e.inner_exc
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource self.force_reraise()
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 139, in wrapper
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource return f(*args, **kwargs)
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/db/api.py", line 128, in wrapped
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource traceback.format_exc())
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource self.force_reraise()
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/db/api.py", line 123, in wrapped
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource return f(*dup_args, **dup_kwargs)
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/base.py", line 369, in index
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource return self._items(request, True, parent_id)
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/base.py", line 308, in _items
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource obj_list = obj_getter(request.context, **kwargs)
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/db/api.py", line 163, in wrapped
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource return method(*args, **kwargs)
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/db/api.py", line 92, in wrapped
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource setattr(e, '_RETRY_EXCEEDED', True)
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource self.force_reraise()
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/db/api.py", line 88, in wrapped
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource return f(*args, **kwargs)
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 151, in wrapper
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource ectxt.value = e.inner_exc
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource self.force_reraise()
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 139, in wrapper
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource return f(*args, **kwargs)
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/db/api.py", line 128, in wrapped
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource traceback.format_exc())
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource self.force_reraise()
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource six.reraise(self.type_, self.value, self.tb)
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/db/api.py", line 123, in wrapped
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource return f(*dup_args, **dup_kwargs)
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/plugins/ml2/plugin.py", line 856, in get_networks
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource limit, marker, page_reverse)
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/db/api.py", line 163, in wrapped
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource return method(*args, **kwargs)
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/db/db_base_plugin_v2.py", line 442, in get_networks
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource page_reverse=page_reverse)
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/db/common_db_mixin.py", line 238, in _get_collection
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource page_reverse=page_reverse)
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/db/common_db_mixin.py", line 221, in _get_collection_query
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource context)
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/db/common_db_mixin.py", line 156, in _apply_filters_to_query
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource query = query.filter(column.in_(value))
2017-01-05 11:59:26.592 TRACE neutron.api.v2.resource AttributeError: 'function' object has no attribute 'in_'
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1654195/+subscriptions
References