[Yahoo-eng-team] [Bug 1608378] [NEW] Creating metering-label-rule with non-existent UUID of metering_label_id raised 500 Internal Server Error

2016-08-01 Thread Rahmad Ade Putra
86 1448 ERROR neutron.api.v2.resource   File 
"/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1146, 
in _execute_context
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource context)
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource   File 
"/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1337, 
in _handle_dbapi_exception
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource 
util.raise_from_cause(newraise, exc_info)
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource   File 
"/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 202, 
in raise_from_cause
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource 
reraise(type(exception), exception, tb=exc_tb, cause=cause)
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource   File 
"/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1139, 
in _execute_context
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource context)
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource   File 
"/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 
450, in do_execute
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource 
cursor.execute(statement, parameters)
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource   File 
"/usr/local/lib/python2.7/dist-packages/pymysql/cursors.py", line 161, in 
execute
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource result = 
self._query(query)
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource   File 
"/usr/local/lib/python2.7/dist-packages/pymysql/cursors.py", line 317, in _query
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource conn.query(q)
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource   File 
"/usr/local/lib/python2.7/dist-packages/pymysql/connections.py", line 837, in 
query
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource 
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource   File 
"/usr/local/lib/python2.7/dist-packages/pymysql/connections.py", line 1021, in 
_read_query_result
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource result.read()
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource   File 
"/usr/local/lib/python2.7/dist-packages/pymysql/connections.py", line 1304, in 
read
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource first_packet = 
self.connection._read_packet()
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource   File 
"/usr/local/lib/python2.7/dist-packages/pymysql/connections.py", line 983, in 
_read_packet
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource 
packet.check_error()
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource   File 
"/usr/local/lib/python2.7/dist-packages/pymysql/connections.py", line 395, in 
check_error
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource 
err.raise_mysql_exception(self._data)
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource   File 
"/usr/local/lib/python2.7/dist-packages/pymysql/err.py", line 120, in 
raise_mysql_exception
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource 
_check_mysql_exception(errinfo)
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource   File 
"/usr/local/lib/python2.7/dist-packages/pymysql/err.py", line 112, in 
_check_mysql_exception
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource raise 
errorclass(errno, errorvalue)
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource DBReferenceError: 
(pymysql.err.IntegrityError) (1452, u'Cannot add or update a child row: a 
foreign key constraint fails (`neutron`.`meteringlabelrules`, CONSTRAINT 
`meteringlabelrules_ibfk_1` FOREIGN KEY (`metering_label_id`) REFERENCES 
`meteringlabels` (`id`) ON DELETE CASCADE)') [SQL: u'INSERT INTO 
meteringlabelrules (id, direction, remote_ip_prefix, metering_label_id, 
excluded) VALUES (%(id)s, %(direction)s, %(remote_ip_prefix)s, 
%(metering_label_id)s, %(excluded)s)'] [parameters: {'remote_ip_prefix': 
u'10.0.1.0/24', 'direction': u'ingress', 'metering_label_id': 
u'0fd2758c-0754-4773-997f-44d3db288a75', 'id': 
'e57b01bc-59fa-4d44-a4dc-1a11c7fc3582', 'excluded': 0}]
2016-07-29 10:35:24.186 1448 ERROR neutron.api.v2.resource
2016-07-29 10:35:24.191 1448 INFO neutron.wsgi 
[req-f4e2ae59-4d4b-491f-96be-58d9ce6ebc39 e01bc3eadeb045edb02fc6b2af4b5d49 
867929bfedca4a719e17a7f3293845de - - -] 192.168.122.139 - - [29/Jul/2016 
10:35:24] "POST /v2.0/metering/metering-label-rules HTTP/1.1" 500 344 0.139746

** Affects: neutron
 Importance: Undecided
 Assignee: Rahmad Ade Putra (leksokmy)
 Status: New


** Tags: metering

** Changed in: neutron
 Assignee: (unassigned) => Rahmad Ade Putra (l

[Yahoo-eng-team] [Bug 1607172] [NEW] Updating metering-labels and metering-label-rules return 500 error because of unexpected AttributeError

2016-07-27 Thread Rahmad Ade Putra
b-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

** Affects: neutron
 Importance: Undecided
 Assignee: Rahmad Ade Putra (leksokmy)
 Status: New


** Tags: metering

** Changed in: neutron
 Assignee: (unassigned) => Rahmad Ade Putra (leksokmy)

-- 
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:
  New

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:~$

[Yahoo-eng-team] [Bug 1606431] [NEW] Flavor create and update with service_profiles is not working properly

2016-07-25 Thread Rahmad Ade Putra
utron.api.v2.resource 
instance_dict(instance), value, None)
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource   File 
"/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/attributes.py", line 
1027, in set
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource lambda adapter, 
i: adapter.adapt_like_to_iterable(i))
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource   File 
"/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/attributes.py", line 
1062, in _set_iterable
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource 
collections.bulk_replace(new_values, old_collection, new_collection)
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource   File 
"/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/collections.py", line 
791, in bulk_replace
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource 
new_adapter.append_with_event(member)
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource   File 
"/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/collections.py", line 
654, in append_with_event
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource 
self._data()._sa_appender(item, _sa_initiator=initiator)
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource   File 
"/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/collections.py", line 
1073, in append
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource item = 
__set(self, item, _sa_initiator)
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource   File 
"/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/collections.py", line 
1045, in __set
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource item = 
executor.fire_append_event(item, _sa_initiator)
2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource   File 
"/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/collections.py", line 
717, in fire_append_event

** Affects: neutron
 Importance: Undecided
 Assignee: Rahmad Ade Putra (leksokmy)
 Status: New

** Tags removed: flavor

** Changed in: neutron
 Assignee: (unassigned) => Rahmad Ade Putra (leksokmy)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1606431

Title:
  Flavor create and update with service_profiles is not working properly

Status in neutron:
  New

Bug description:
  1. When creating a new Flavor with service_profiles, is not working
  properly due the it showing empty service_profiles, I entered the
  correct UUID of service_profiles, however the UUID of service_profiles
  is empty.

  2. And another happened when I try to update the existing of Flavor by
  inserting the UUID of service_profiles, the 500 Internal Server Error
  occured.

  Here are my log from the first one (Creating new Falvor with
  service_profiles) and then the second one (Update Existing Flavor by
  Inserting service_profiles)

  
  Creating a new Flavor with service_profiles

  Request Command :
  vagrant@ubuntu:~$ curl -g -i -X POST http://192.168.122.139:9696/v2.0/flavors 
-H "X-Auth-Token: $TOKEN" -d '{"flavor": 
{"service_type":"LOADBALANCER","enabled":"true"n$
  HTTP/1.1 201 Created
  Content-Type: application/json
  Content-Length: 173
  X-Openstack-Request-Id: req-6f3047a4-07e9-4dbe-b22a-b61ba167f705
  Date: Mon, 25 Jul 2016 16:12:41 GMT

  {"flavor": {"description": "", "enabled": true, "service_profiles":
  [], "service_type": "LOADBALANCER", "id":
  "79eaa203-5913-41b0-92c5-d6c2a0211a9c", "name": "flavor-test"}}

  
  -
  Update Existing Flavor By Inserting service_profiles

  Request Command :
  vagrant@ubuntu:~$ curl -g -i -X PUT 
http://192.168.122.139:9696/v2.0/flavors/79eaa203-5913-41b0-92c5-d6c2a0211a9c 
-H "X-Auth-Token: $TOKEN" -d '{"flavor": {"enabled":"$
  HTTP/1.1 500 Internal Server Error
  Content-Type: application/json
  Content-Length: 150
  X-Openstack-Request-Id: req-d8581b95-a798-4d83-9980-414892553cd3
  Date: Mon, 25 Jul 2016 17:18:56 GMT

  2016-07-25 17:18:56.650 24207 DEBUG neutron.api.v2.base 
[req-b42a4171-1c3d-4e67-a375-c5ce7c08546b e01bc3eadeb045edb02fc6b2af4b5d49 
867929bfedca4a719e17a7f3293845de ---] Request body: {u'flavor': 
{u'service_profiles': [u'8e843ed6-cbd0-4ede-b765-d98e765f1135'], u'enabled': 
u'false'}} prepare_request_body /opt/stack/neutron/neutron/api/v2/base.py:649
  2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource 
[req-b42a4171-1c3d-4e67-a375-c5ce7c08546b e01bc3eadeb045edb02fc6b2af4b5d49 
867929bfedca4a719e17a7f3293845de- - -] update failed: No details.
  2016-07-25 17:18:56.674 24207 ERROR neutron.api.v2.resource Traceback (most 
rec