+++ This bug was initially created as a clone of Bug #1306444 +++ Description of problem: The "heat-manage purge_delete" cron job on the undercloud fails when attempting to purge the raw_template table. Version-Release number of selected component (if applicable): openstack-heat-common-2015.1.2-4.el7ost.noarch How reproducible: Not clear. Steps to Reproduce: 1. Run /bin/heat-manage purge_deleted manually Actual results: A stack trace and the raw_template table is left un-purged. Expected results: A purged raw_template table. 2016-02-05 00:03:13.658 15950 ERROR oslo_db.sqlalchemy.exc_filters [-] DBAPIError exception wrapped from (_mysql_exceptions.IntegrityError) (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (`heat`.`resource`, CONSTRAINT `current_template_fkey_ref` FOREIGN KEY (`current_template_id`) REFERENCES `raw_template` (`id`))') [SQL: u'DELETE FROM raw_template WHERE raw_template.id NOT IN (SELECT stack.raw_template_id \nFROM stack)'] 2016-02-05 00:03:13.658 15950 TRACE oslo_db.sqlalchemy.exc_filters Traceback (most recent call last): 2016-02-05 00:03:13.658 15950 TRACE oslo_db.sqlalchemy.exc_filters File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context 2016-02-05 00:03:13.658 15950 TRACE oslo_db.sqlalchemy.exc_filters context) 2016-02-05 00:03:13.658 15950 TRACE oslo_db.sqlalchemy.exc_filters File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute 2016-02-05 00:03:13.658 15950 TRACE oslo_db.sqlalchemy.exc_filters cursor.execute(statement, parameters) 2016-02-05 00:03:13.658 15950 TRACE oslo_db.sqlalchemy.exc_filters File "/usr/lib64/python2.7/site-packages/MySQLdb/cursors.py", line 174, in execute 2016-02-05 00:03:13.658 15950 TRACE oslo_db.sqlalchemy.exc_filters self.errorhandler(self, exc, value) 2016-02-05 00:03:13.658 15950 TRACE oslo_db.sqlalchemy.exc_filters File "/usr/lib64/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler 2016-02-05 00:03:13.658 15950 TRACE oslo_db.sqlalchemy.exc_filters raise errorclass, errorvalue 2016-02-05 00:03:13.658 15950 TRACE oslo_db.sqlalchemy.exc_filters IntegrityError: (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (`heat`.`resource`, CONSTRAINT `current_template_fkey_ref` FOREIGN KEY (`current_template_id`) REFERENCES `raw_template` (`id`))') 2016-02-05 00:03:13.658 15950 TRACE oslo_db.sqlalchemy.exc_filters ERROR: (_mysql_exceptions.IntegrityError) (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (`heat`.`resource`, CONSTRAINT `current_template_fkey_ref` FOREIGN KEY (`current_template_id`) REFERENCES `raw_template` (`id`))') [SQL: u'DELETE FROM raw_template WHERE raw_template.id NOT IN (SELECT stack.raw_template_id \nFROM stack)']
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHEA-2016-0603.html