DBReferenceError when Deploy or delete vnffg

Bug #1658364 reported by sajuptpm
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tacker
Fix Released
High
dharmendra

Bug Description

2017-01-20 22:29:42.158 ERROR root [req-0b1fe9db-b06d-4cfc-be79-683e7bf889e7 demo e7f6422457fa4950b6721cb6c89f682f] Original exception being dropped: ['Traceback (most recent call last):\n', ' File "/opt/stack/tacker/tacker/nfvo/nfvo_plugin.py", line 242, in create_vnffg\n symmetrical=sfc[\'symmetrical\'])\n', ' File "/opt/stack/tacker/tacker/common/driver_manager.py", line 70, in invoke\n return getattr(driver, method_name)(**kwargs)\n', ' File "/opt/stack/tacker/tacker/nfvo/drivers/vim/openstack_driver.py", line 334, in create_flow_classifier\n sfc_classifier_params)\n', ' File "/opt/stack/tacker/tacker/nfvo/drivers/vim/openstack_driver.py", line 467, in flow_classifier_create\n fc = self.client.create_flow_classifier({\'flow_classifier\': fc_dict})\n', "AttributeError: 'Client' object has no attribute 'create_flow_classifier'\n"]
2017-01-20 22:29:42.159 ERROR tacker.api.v1.resource [req-0b1fe9db-b06d-4cfc-be79-683e7bf889e7 demo e7f6422457fa4950b6721cb6c89f682f] create failed
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource Traceback (most recent call last):
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource File "/opt/stack/tacker/tacker/api/v1/resource.py", line 83, in resource
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource result = method(request=request, **args)
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource File "/opt/stack/tacker/tacker/api/v1/base.py", line 395, in create
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource obj = obj_creator(request.context, **kwargs)
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource File "/opt/stack/tacker/tacker/common/log.py", line 35, in wrapper
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource return method(*args, **kwargs)
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource File "/opt/stack/tacker/tacker/nfvo/nfvo_plugin.py", line 251, in create_vnffg
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource self.delete_vnffg(context, vnffg_id=vnffg_dict['id'])
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource File "/opt/stack/tacker/tacker/common/log.py", line 35, in wrapper
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource return method(*args, **kwargs)
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource File "/opt/stack/tacker/tacker/nfvo/nfvo_plugin.py", line 353, in delete_vnffg
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource super(NfvoPlugin, self)._delete_vnffg_post(context, vnffg_id, False)
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource File "/opt/stack/tacker/tacker/db/nfvo/vnffg_db.py", line 853, in _delete_vnffg_post
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource nfp_query.delete()
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 3104, in delete
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource delete_op.exec_()
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 1131, in exec_
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource self._do_exec()
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 1315, in _do_exec
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource mapper=self.mapper)
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1097, in execute
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource bind, close_with_result=True).execute(clause, params or {})
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 914, in execute
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource return meth(self, multiparams, params)
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource return connection._execute_clauseelement(self, multiparams, params)
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource compiled_sql, distilled_params
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource context)
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1337, in _handle_dbapi_exception
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource util.raise_from_cause(newraise, exc_info)
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 202, in raise_from_cause
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource reraise(type(exception), exception, tb=exc_tb, cause=cause)
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource context)
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 450, in do_execute
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource cursor.execute(statement, parameters)
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/pymysql/cursors.py", line 166, in execute
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource result = self._query(query)
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/pymysql/cursors.py", line 322, in _query
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource conn.query(q)
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/pymysql/connections.py", line 835, in query
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource self._affected_rows = self._read_query_result(unbuffered=unbuffered)
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/pymysql/connections.py", line 1019, in _read_query_result
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource result.read()
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/pymysql/connections.py", line 1302, in read
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource first_packet = self.connection._read_packet()
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/pymysql/connections.py", line 981, in _read_packet
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource packet.check_error()
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/pymysql/connections.py", line 393, in check_error
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource err.raise_mysql_exception(self._data)
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/pymysql/err.py", line 107, in raise_mysql_exception
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource raise errorclass(errno, errval)
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource DBReferenceError: (pymysql.err.IntegrityError) (1451, u'Cannot delete or update a parent row: a foreign key constraint fails (`tacker`.`aclmatchcriterias`, CONSTRAINT `aclmatchcriterias_ibfk_1` FOREIGN KEY (`vnffgc_id`) REFERENCES `vnffgclassifiers` (`id`))') [SQL: u'DELETE FROM vnffgclassifiers WHERE vnffgclassifiers.tenant_id = %(tenant_id_1)s AND vnffgclassifiers.id = %(id_1)s AND vnffgclassifiers.status = %(status_1)s'] [parameters: {u'id_1': u'9e17c5f5-88c9-440c-b612-f4e07a26a120', u'status_1': 'PENDING_DELETE', u'tenant_id_1': u'e7f6422457fa4950b6721cb6c89f682f'}]
2017-01-20 22:29:42.159 TRACE tacker.api.v1.resource
2017-01-20 22:29:42.180 INFO tacker.wsgi [req-0b1fe9db-b06d-4cfc-be79-683e7bf889e7 demo e7f6422457fa4950b6721cb6c89f682f] 192.168.56.20 - - [20/Jan/2017 22:29:42] "POST //v1.0/vnffgs.json HTTP/1.1" 500 304 1.094265
2017-01-20 22:29:51.716 DEBUG tacker.common.log [-] tacker.nfvo.nfvo_plugin.NfvoPlugin method monitor_vim called with arguments ({'status': u'REACHABLE', 'description': u'', 'tenant_id': u'd977d3e1f16c479faecd3c864ae429e5', 'created_at': datetime.datetime(2017, 1, 13, 15, 15, 19), 'vim_project': {u'project_domain_name': u'Default', u'id': u'', u'name': u'nfv'}, 'updated_at': datetime.datetime(2017, 1, 13, 15, 15, 19), 'is_default': True, 'auth_url': u'http://localhost:5000/v3', 'auth_cred': {u'username': u'nfv_user', u'project_name': u'nfv', u'user_id': u'', u'user_domain_name': u'Default', u'project_id': u'', u'auth_url': u'http://localhost:5000/v3', 'password': '***', u'project_domain_name': u'Default'}, 'placement_attr': {u'regions': [u'RegionOne']}, 'shared': True, 'type': u'openstack', 'id': u'c1623f32-499b-4b6c-8995-c173b630a0fb', 'name': u'VIM0'},) {} from (pid=22422) wrapper /opt/stack/tacker/tacker/common/log.py:34

sajuptpm (sajuptpm)
Changed in tacker:
assignee: nobody → sajuptpm (sajuptpm)
summary: - DBReferenceError when Deploying and deleteing vnffg
+ DBReferenceError when Deploy or delete vnffg
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tacker (master)

Fix proposed to branch: master
Review: https://review.openstack.org/423712

Changed in tacker:
status: New → In Progress
Changed in tacker:
milestone: none → pike-1
importance: Undecided → High
Changed in tacker:
milestone: pike-1 → pike-2
Changed in tacker:
milestone: pike-2 → pike-3
Changed in tacker:
milestone: pike-3 → none
Changed in tacker:
assignee: sajuptpm (sajuptpm) → Tim Rozet (trozet)
Changed in tacker:
milestone: none → queens-2
Changed in tacker:
milestone: queens-2 → queens-3
Changed in tacker:
assignee: Tim Rozet (trozet) → dharmendra (dharmendra-kushwaha)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tacker (master)

Reviewed: https://review.openstack.org/423712
Committed: https://git.openstack.org/cgit/openstack/tacker/commit/?id=073407ff2737165f1b0ef04456f689cbbc5b466d
Submitter: Zuul
Branch: master

commit 073407ff2737165f1b0ef04456f689cbbc5b466d
Author: dharmendra <email address hidden>
Date: Thu Jan 25 20:52:47 2018 +0000

    save tenant_id in ACLMatchCriteria table

    Because of null tenant_id, vnffg delete operation fails to delete
    entry from ACLMatchCriteria.Hence delete attemp on parent table fails
    with DBReferenceError.

    Co-Authored-By: Dharmendra Kushwaha<email address hidden>
    Closes-Bug: 1658364
    Change-Id: I699f66dfa2eab49dc5239e70973b68967f4d0142

Changed in tacker:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tacker 0.9.0

This issue was fixed in the openstack/tacker 0.9.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.