yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #78713
[Bug 1659175] Re: Hit internal error when using StandardAttribute as sort-key
Reviewed: https://review.opendev.org/653903
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=335ac4e2d95c164d66a3b09d9fd08e9c563edfc2
Submitter: Zuul
Branch: master
commit 335ac4e2d95c164d66a3b09d9fd08e9c563edfc2
Author: pandatt <guojy8993@xxxxxxx>
Date: Fri Apr 19 11:29:54 2019 +0800
Fix bug: AttributeError arises while sorting with standard attributes
Common neutron resource(e.g, Port) consists of:
1. Resource Attributes, e.g: Port.mac_address, etc.
2. Standard Attributes, e.g: created_at, and are shared among all
neutron resources.
The `sort` opt only supports limited attributes. We need to filter
attributes that are defined with `is_sort_key=True` and it's preferred
to explicitly warn CLI & API users of illegal sort keys rather than
just accept without check, pass forward and then hit a internal error
which's quite confusing.
Depends-on: https://review.opendev.org/#/c/660097/
Change-Id: I8d206f909b09f1279dfcdc25c39989a67bff93d5
Closes-Bug: #1659175
** 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/1659175
Title:
Hit internal error when using StandardAttribute as sort-key
Status in neutron:
Fix Released
Bug description:
Maybe our server not support query resources with created_at. This is
a standard requirement.
cmd:
neutron port-list --sort-key created_at --sort-dir asc
Request Failed: internal server error while processing your request.
Neutron server returns request_ids: ['req-2da26481-ef77-4bf8-a83c-f0c412d2936c']
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m six.reraise(self.type_, self.value, self.tb)
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/opt/stack/neutron/neutron/db/api.py", line 88, in wrapped
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m return f(*args, **kwargs)
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 151, in wrapper
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m ectxt.value = e.inner_exc
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m self.force_reraise()
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m six.reraise(self.type_, self.value, self.tb)
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 139, in wrapper
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m return f(*args, **kwargs)
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/opt/stack/neutron/neutron/db/api.py", line 128, in wrapped
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m traceback.format_exc())
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m self.force_reraise()
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m six.reraise(self.type_, self.value, self.tb)
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/opt/stack/neutron/neutron/db/api.py", line 123, in wrapped
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m return f(*dup_args, **dup_kwargs)
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/opt/stack/neutron/neutron/api/v2/base.py", line 369, in index
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m return self._items(request, True, parent_id)
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/opt/stack/neutron/neutron/api/v2/base.py", line 308, in _items
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m obj_list = obj_getter(request.context, **kwargs)
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/opt/stack/neutron/neutron/db/api.py", line 163, in wrapped
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m return method(*args, **kwargs)
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/opt/stack/neutron/neutron/db/api.py", line 92, in wrapped
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m setattr(e, '_RETRY_EXCEEDED', True)
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m self.force_reraise()
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m six.reraise(self.type_, self.value, self.tb)
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/opt/stack/neutron/neutron/db/api.py", line 88, in wrapped
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m return f(*args, **kwargs)
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 151, in wrapper
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m ectxt.value = e.inner_exc
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m self.force_reraise()
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m six.reraise(self.type_, self.value, self.tb)
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 139, in wrapper
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m return f(*args, **kwargs)
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/opt/stack/neutron/neutron/db/api.py", line 128, in wrapped
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m traceback.format_exc())
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m self.force_reraise()
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m six.reraise(self.type_, self.value, self.tb)
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/opt/stack/neutron/neutron/db/api.py", line 123, in wrapped
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m return f(*dup_args, **dup_kwargs)
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/opt/stack/neutron/neutron/db/db_base_plugin_v2.py", line 1333, in get_ports
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m page_reverse=page_reverse)
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/opt/stack/neutron/neutron/db/db_base_plugin_v2.py", line 1317, in _get_ports_query
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m sort_keys = db_utils.get_and_validate_sort_keys(sorts, Port)
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m File "/usr/local/lib/python2.7/dist-packages/neutron_lib/db/utils.py", line 43, in get_and_validate_sort_keys
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m if isinstance(sort_key_attr.property,
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00mAttributeError: 'AssociationProxy' object has no attribute 'property'
2017-01-25 09:42:59.830 TRACE neutron.api.v2.resource ^[[01;35m^[[00m
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1659175/+subscriptions
References