Bug 1310890 - DB Purge of raw_template fails on constraint from resources.current_template_id
DB Purge of raw_template fails on constraint from resources.current_template_id
Status: CLOSED ERRATA
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-heat (Show other bugs)
8.0 (Liberty)
Unspecified Unspecified
high Severity high
: ga
: 8.0 (Liberty)
Assigned To: Zane Bitter
Amit Ugol
:
Depends On: 1306444
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-22 17:24 EST by Zane Bitter
Modified: 2016-04-26 17:27 EDT (History)
10 users (show)

See Also:
Fixed In Version: openstack-heat-5.0.1-2.el7ost
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1306444
Environment:
Last Closed: 2016-04-07 17:30:40 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
OpenStack gerrit 278463 None None None 2016-02-22 17:24 EST

  None (edit)
Description Zane Bitter 2016-02-22 17:24:28 EST
+++ 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)']
Comment 3 errata-xmlrpc 2016-04-07 17:30:40 EDT
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

Note You need to log in before you can comment on or make changes to this bug.