← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1607172] Re: Updating metering-labels and metering-label-rules return 500 error because of unexpected AttributeError

 

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

commit bcbe6d2ee28bdaee2f5146bbdcd5d5f47eaac945
Author: hobo.kengo <hobo.kengo@xxxxxxxxxxxxxx>
Date:   Fri Aug 12 09:46:54 2016 +0000

    Raise 501 instead of 500 when updating meter-lebel and rule
    
    Currently, there is no action for updating meter-label and rule.
    Thus, InternalServerError is returned to user because of
    unexpected internal AttributeError.
    This patch defines action for updating meter-label and rule
    so that user can see NotImplementedError.
    
    Change-Id: I7b179b2179a3e6cef0fd53df8f59fb6fb9433d40
    Closes-Bug: #1607172


** 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/1607172

Title:
  Updating metering-labels and metering-label-rules return 500 error
  because of unexpected AttributeError

Status in neutron:
  Fix Released

Bug description:
  Updating metering-labels and metering-label-rules return 500 error
  because of unexpected AttributeError.

  These my explanations

  1. I faced these issues that perhaps did not expected to me, when I
  tried to update metering-label by using PUT, the log shows that there
  was 500 Internal Server Error occured with no parameters inserted
  after metering_label object. I think this should not be 500 Internal
  Server Error, but this supposed to be 501 MethodNotSupported since
  there no method for supporting Update(PUT) and because the 501 Error
  could give proper explanation to the user itself.

  2. And the second one is perhaps the same as the first one, when I
  tried to update metering-label-rules by using PUT, the log also
  showing that there was 500 Internal Server Error occured, the actual
  issue is similar with the first one, I guess the 501
  MethodNotSupported supposed to be happen instead of 500 Internal
  Server Error.

  Here I also attached all of my traceback (logs) and my request
  parameter commands.

  ---------
  Updating metering-labels request to API

  vagrant@ubuntu:~$ curl -g -i -X PUT http://192.168.122.139:9696/v2.0/metering/metering-labels/1f3ec85a-e250-4e3e-a6c6-58745121f0bf -H "X-Auth-Token: $TOKEN" -d '{"metering_label":{}}'
  HTTP/1.1 500 Internal Server Error
  Content-Type: application/json
  Content-Length: 150
  X-Openstack-Request-Id: req-8b02de2a-3ed6-48ba-b9d8-d7ae34268fe2
  Date: Wed, 27 Jul 2016 17:20:57 GMT

  {"NeutronError": {"message": "Request Failed: internal server error
  while processing your request.", "type": "HTTPInternalServerError",
  "detail": ""}}

  
  --------
  Log Trackback

  2016-07-27 17:20:57.504 1448 DEBUG neutron.api.v2.base [req-8b02de2a-3ed6-48ba-b9d8-d7ae34268fe2 e01bc3eadeb045edb02fc6b2af4b5d49 867929bfedca4a719e17a7f3293845de - - -] Request body: {u'metering_label': {}} prepare_request_body /opt/stack/neutron/neutron/api/v2/base.py:649
  2016-07-27 17:20:57.521 1448 ERROR neutron.api.v2.resource [req-8b02de2a-3ed6-48ba-b9d8-d7ae34268fe2 e01bc3eadeb045edb02fc6b2af4b5d49 867929bfedca4a719e17a7f3293845de - - -] update failed: No details.
  2016-07-27 17:20:57.521 1448 ERROR neutron.api.v2.resource Traceback (most recent call last):
  2016-07-27 17:20:57.521 1448 ERROR neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/resource.py", line 79, in resource
  2016-07-27 17:20:57.521 1448 ERROR neutron.api.v2.resource     result = method(request=request, **args)
  2016-07-27 17:20:57.521 1448 ERROR neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/base.py", line 571, in update
  2016-07-27 17:20:57.521 1448 ERROR neutron.api.v2.resource     return self._update(request, id, body, **kwargs)
  2016-07-27 17:20:57.521 1448 ERROR neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 148, in wrapper
  2016-07-27 17:20:57.521 1448 ERROR neutron.api.v2.resource     ectxt.value = e.inner_exc
  2016-07-27 17:20:57.521 1448 ERROR neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
  2016-07-27 17:20:57.521 1448 ERROR neutron.api.v2.resource     self.force_reraise()
  2016-07-27 17:20:57.521 1448 ERROR neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
  2016-07-27 17:20:57.521 1448 ERROR neutron.api.v2.resource     six.reraise(self.type_, self.value, self.tb)
  2016-07-27 17:20:57.521 1448 ERROR neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 138, in wrapper
  2016-07-27 17:20:57.521 1448 ERROR neutron.api.v2.resource     return f(*args, **kwargs)
  2016-07-27 17:20:57.521 1448 ERROR neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/base.py", line 613, in _update
  2016-07-27 17:20:57.521 1448 ERROR neutron.api.v2.resource     obj_updater = getattr(self._plugin, action)
  2016-07-27 17:20:57.521 1448 ERROR neutron.api.v2.resource AttributeError: 'MeteringPlugin' object has no attribute 'update_metering_label'
  2016-07-27 17:20:57.521 1448 ERROR neutron.api.v2.resource
  2016-07-27 17:20:57.523 1448 INFO neutron.wsgi [req-8b02de2a-3ed6-48ba-b9d8-d7ae34268fe2 e01bc3eadeb045edb02fc6b2af4b5d49 867929bfedca4a719e17a7f3293845de - - -] 192.168.122.139 - - [27/Jul/2016 17:20:57] "PUT /v2.0/metering/metering-labels/1f3ec85a-e250-4e3e-a6c6-58745121f0bf HTTP/1.1" 500 344 0.055912

  =========

  Updating metering-label-rules request to API

  vagrant@ubuntu:~$ curl -g -i -X PUT http://192.168.122.139:9696/v2.0/metering/metering-label-rules/c4deb0b6-0fee-4166-a574-8f4582e301ec -H "X-Auth-TOken: $TOKEN" -d '{"metering_label_rule":{}}'
  HTTP/1.1 500 Internal Server Error
  Content-Type: application/json
  Content-Length: 150
  X-Openstack-Request-Id: req-342881fb-f466-4adb-a6f4-d78b5d568a96
  Date: Wed, 27 Jul 2016 17:24:45 GMT

  {"NeutronError": {"message": "Request Failed: internal server error
  while processing your request.", "type": "HTTPInternalServerError",
  "detail": ""}}

  ----------
  Log Traceback

  2016-07-27 17:24:45.439 1449 DEBUG neutron.api.v2.base [req-342881fb-f466-4adb-a6f4-d78b5d568a96 e01bc3eadeb045edb02fc6b2af4b5d49 867929bfedca4a719e17a7f3293845de - - -] Request body: {u'metering_label_rule': {}} prepare_request_body /opt/stack/neutron/neutron/api/v2/base.py:649
  2016-07-27 17:24:45.456 1449 ERROR neutron.api.v2.resource [req-342881fb-f466-4adb-a6f4-d78b5d568a96 e01bc3eadeb045edb02fc6b2af4b5d49 867929bfedca4a719e17a7f3293845de - - -] update failed: No details.
  2016-07-27 17:24:45.456 1449 ERROR neutron.api.v2.resource Traceback (most recent call last):
  2016-07-27 17:24:45.456 1449 ERROR neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/resource.py", line 79, in resource
  2016-07-27 17:24:45.456 1449 ERROR neutron.api.v2.resource     result = method(request=request, **args)
  2016-07-27 17:24:45.456 1449 ERROR neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/base.py", line 571, in update
  2016-07-27 17:24:45.456 1449 ERROR neutron.api.v2.resource     return self._update(request, id, body, **kwargs)
  2016-07-27 17:24:45.456 1449 ERROR neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 148, in wrapper
  2016-07-27 17:24:45.456 1449 ERROR neutron.api.v2.resource     ectxt.value = e.inner_exc
  2016-07-27 17:24:45.456 1449 ERROR neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
  2016-07-27 17:24:45.456 1449 ERROR neutron.api.v2.resource     self.force_reraise()
  2016-07-27 17:24:45.456 1449 ERROR neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
  2016-07-27 17:24:45.456 1449 ERROR neutron.api.v2.resource     six.reraise(self.type_, self.value, self.tb)
  2016-07-27 17:24:45.456 1449 ERROR neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/oslo_db/api.py", line 138, in wrapper
  2016-07-27 17:24:45.456 1449 ERROR neutron.api.v2.resource     return f(*args, **kwargs)
  2016-07-27 17:24:45.456 1449 ERROR neutron.api.v2.resource   File "/opt/stack/neutron/neutron/api/v2/base.py", line 613, in _update
  2016-07-27 17:24:45.456 1449 ERROR neutron.api.v2.resource     obj_updater = getattr(self._plugin, action)
  2016-07-27 17:24:45.456 1449 ERROR neutron.api.v2.resource AttributeError: 'MeteringPlugin' object has no attribute 'update_metering_label_rule'
  2016-07-27 17:24:45.456 1449 ERROR neutron.api.v2.resource AttributeError: 'MeteringPlugin' object has no attribute 'update_metering_label_rule'
  2016-07-27 17:24:45.456 1449 ERROR neutron.api.v2.resource
  2016-07-27 17:24:45.459 1449 INFO neutron.wsgi [req-342881fb-f466-4adb-a6f4-d78b5d568a96 e01bc3eadeb045edb02fc6b2af4b5d49 867929bfedca4a719e17a7f3293845de - - -] 192.168.122.139 - - [27/Jul/2016 17:24:45] "PUT /v2.0/metering/metering-label-rules/c4deb0b6-0fee-4166-a574-8f4582e301ec HTTP/1.1" 500 344 0.253948

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


References