← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1430606] [NEW] Internal server error when associating health monitor to pool with wrong monitor id

 

Public bug reported:

Step to reproduce:
neutron lb-pool-list
+--------------------------------------+------+----------+-------------+----------+----------------+--------+
| id                                   | name | provider | lb_method   | protocol | admin_state_up | status |
+--------------------------------------+------+----------+-------------+----------+----------------+--------+
| d10382e9-e666-45ee-92e0-7418708d95f0 | test | haproxy  | ROUND_ROBIN | TCP      | True           | ACTIVE |
+--------------------------------------+------+----------+-------------+----------+----------------+--------+
neutron lb-healthmonitor-list
+--------------------------------------+------+----------------+
| id                                   | type | admin_state_up |
+--------------------------------------+------+----------------+
| 2572a92e-d27e-433a-9140-9a7bd25ad643 | PING | True           |
+--------------------------------------+------+----------------+

neutron lb-healthmonitor-associate 3572a92e-d27e-433a-9140-9a7bd25ad641 test
Request Failed: internal server error while processing your request.
2015-03-10 16:35:13.257 ERROR neutron.api.v2.resource [req-315250ca-dceb-43d2-a30f-9b0ea982575f admin 2eceabbb9b5f4bb5af3710f1b638131d] create failed
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource Traceback (most recent call last):
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/data/stack/neutron/neutron/api/v2/resource.py", line 83, in resource
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     result = method(request=request, **args)
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/data/stack/neutron/neutron/api/v2/base.py", line 452, in create
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     obj = obj_creator(request.context, **kwargs)
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/data/stack/neutron-lbaas/neutron_lbaas/services/loadbalancer/plugin.py", line 313, in create_pool_health_monitor
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     pool_id
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/data/stack/neutron-lbaas/neutron_lbaas/db/loadbalancer/loadbalancer_db.py", line 639, in create_pool_health_monitor
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     monitors = [monitor['monitor_id'] for monitor in pool['monitors']]
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 470, in __exit__
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     self.rollback()
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/langhelpers.py", line 60, in __exit__
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     compat.reraise(exc_type, exc_value, exc_tb)
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 467, in __exit__
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     self.commit()
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 377, in commit
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     self._prepare_impl()
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 357, in _prepare_impl
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     self.session.flush()
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1919, in flush
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     self._flush(objects)
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 2037, in _flush
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     transaction.rollback(_capture_exception=True)
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/langhelpers.py", line 60, in __exit__
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     compat.reraise(exc_type, exc_value, exc_tb)
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 2001, in _flush
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     flush_context.execute()
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py", line 372, in execute
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     rec.execute(self)
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py", line 526, in execute
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     uow
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 65, in save_obj
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     mapper, table, insert)
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 570, in _emit_insert_statements
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     execute(statement, multiparams)
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 729, in execute
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     return meth(self, multiparams, params)
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py", line 322, in _execute_on_connection
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     return connection._execute_clauseelement(self, multiparams, params)
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 826, in _execute_clauseelement
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     compiled_sql, distilled_params
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 958, in _execute_context
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     context)
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1155, in _handle_dbapi_exception
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     util.raise_from_cause(newraise, exc_info)
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 199, in raise_from_cause
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     reraise(type(exception), exception, tb=exc_tb)
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 951, in _execute_context
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     context)
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 436, in do_execute
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     cursor.execute(statement, parameters)
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     s
elf.errorhandler(self, exc, value)
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     raise errorclass, errorvalue
2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource DBReferenceError: (IntegrityError) (1452, 'Cannot add or update a child row: a foreign key constraint fails (`neutron`.`poolmonitorassociations`, CONSTRAINT `poolmonitorassociations_ibfk_2` FOREIGN KEY (`monitor_id`) REFERENCES `healthmonitors` (`id`))') 'INSERT INTO poolmonitorassociations (status, status_description, pool_id, monitor_id) VALUES (%s, %s, %s, %s)' ('PENDING_CREATE', None, 'd10382e9-e666-45ee-92e0-7418708d95f0', '2572a92e-d27e-433a-9140-9a7bd25ad641')

** Affects: neutron
     Importance: Undecided
     Assignee: Liyingjun (liyingjun)
         Status: New

** Changed in: neutron
     Assignee: (unassigned) => Liyingjun (liyingjun)

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

Title:
  Internal server error when associating health monitor to pool with
  wrong monitor id

Status in OpenStack Neutron (virtual network service):
  New

Bug description:
  Step to reproduce:
  neutron lb-pool-list
  +--------------------------------------+------+----------+-------------+----------+----------------+--------+
  | id                                   | name | provider | lb_method   | protocol | admin_state_up | status |
  +--------------------------------------+------+----------+-------------+----------+----------------+--------+
  | d10382e9-e666-45ee-92e0-7418708d95f0 | test | haproxy  | ROUND_ROBIN | TCP      | True           | ACTIVE |
  +--------------------------------------+------+----------+-------------+----------+----------------+--------+
  neutron lb-healthmonitor-list
  +--------------------------------------+------+----------------+
  | id                                   | type | admin_state_up |
  +--------------------------------------+------+----------------+
  | 2572a92e-d27e-433a-9140-9a7bd25ad643 | PING | True           |
  +--------------------------------------+------+----------------+

  neutron lb-healthmonitor-associate 3572a92e-d27e-433a-9140-9a7bd25ad641 test
  Request Failed: internal server error while processing your request.
  2015-03-10 16:35:13.257 ERROR neutron.api.v2.resource [req-315250ca-dceb-43d2-a30f-9b0ea982575f admin 2eceabbb9b5f4bb5af3710f1b638131d] create failed
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource Traceback (most recent call last):
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/data/stack/neutron/neutron/api/v2/resource.py", line 83, in resource
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     result = method(request=request, **args)
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/data/stack/neutron/neutron/api/v2/base.py", line 452, in create
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     obj = obj_creator(request.context, **kwargs)
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/data/stack/neutron-lbaas/neutron_lbaas/services/loadbalancer/plugin.py", line 313, in create_pool_health_monitor
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     pool_id
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/data/stack/neutron-lbaas/neutron_lbaas/db/loadbalancer/loadbalancer_db.py", line 639, in create_pool_health_monitor
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     monitors = [monitor['monitor_id'] for monitor in pool['monitors']]
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 470, in __exit__
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     self.rollback()
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/langhelpers.py", line 60, in __exit__
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     compat.reraise(exc_type, exc_value, exc_tb)
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 467, in __exit__
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     self.commit()
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 377, in commit
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     self._prepare_impl()
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 357, in _prepare_impl
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     self.session.flush()
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1919, in flush
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     self._flush(objects)
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 2037, in _flush
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     transaction.rollback(_capture_exception=True)
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/langhelpers.py", line 60, in __exit__
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     compat.reraise(exc_type, exc_value, exc_tb)
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 2001, in _flush
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     flush_context.execute()
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py", line 372, in execute
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     rec.execute(self)
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py", line 526, in execute
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     uow
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 65, in save_obj
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     mapper, table, insert)
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 570, in _emit_insert_statements
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     execute(statement, multiparams)
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 729, in execute
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     return meth(self, multiparams, params)
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py", line 322, in _execute_on_connection
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     return connection._execute_clauseelement(self, multiparams, params)
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 826, in _execute_clauseelement
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     compiled_sql, distilled_params
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 958, in _execute_context
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     context)
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1155, in _handle_dbapi_exception
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     util.raise_from_cause(newraise, exc_info)
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 199, in raise_from_cause
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     reraise(type(exception), exception, tb=exc_tb)
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 951, in _execute_context
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     context)
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 436, in do_execute
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     cursor.execute(statement, parameters)
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     s
  elf.errorhandler(self, exc, value)
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource     raise errorclass, errorvalue
  2015-03-10 16:35:13.257 TRACE neutron.api.v2.resource DBReferenceError: (IntegrityError) (1452, 'Cannot add or update a child row: a foreign key constraint fails (`neutron`.`poolmonitorassociations`, CONSTRAINT `poolmonitorassociations_ibfk_2` FOREIGN KEY (`monitor_id`) REFERENCES `healthmonitors` (`id`))') 'INSERT INTO poolmonitorassociations (status, status_description, pool_id, monitor_id) VALUES (%s, %s, %s, %s)' ('PENDING_CREATE', None, 'd10382e9-e666-45ee-92e0-7418708d95f0', '2572a92e-d27e-433a-9140-9a7bd25ad641')

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


Follow ups

References