yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #60242
[Bug 1654195] [NEW] query resource with some filter return 500 error
Public bug reported:
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_'
** Affects: neutron
Importance: Undecided
Assignee: zhaobo (zhaobo6)
Status: New
--
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:
New
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
Follow ups