purge command fails due to foreign key constraint
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
Fix Released
|
Undecided
|
Abhishek Kekane |
Bug Description
In our production environment some how we have encountered a issue in purge command. One of the example is, purge command fails if image is deleted but members entry for that particular image is not deleted.
Steps to reproduce:
1. Apply patch https:/
2. Run purge command "glance-manage db purge 1 1"
Purge command trace:
2016-03-08 08:25:16.127 CRITICAL glance [req-7ce644e9-
2016-03-08 08:25:16.127 TRACE glance Traceback (most recent call last):
2016-03-08 08:25:16.127 TRACE glance File "/usr/local/
2016-03-08 08:25:16.127 TRACE glance sys.exit(main())
2016-03-08 08:25:16.127 TRACE glance File "/opt/stack/
2016-03-08 08:25:16.127 TRACE glance return CONF.command.
2016-03-08 08:25:16.127 TRACE glance File "/opt/stack/
2016-03-08 08:25:16.127 TRACE glance db_api.
2016-03-08 08:25:16.127 TRACE glance File "/opt/stack/
2016-03-08 08:25:16.127 TRACE glance result = session.
2016-03-08 08:25:16.127 TRACE glance File "/usr/local/
2016-03-08 08:25:16.127 TRACE glance bind, close_with_
2016-03-08 08:25:16.127 TRACE glance File "/usr/local/
2016-03-08 08:25:16.127 TRACE glance return meth(self, multiparams, params)
2016-03-08 08:25:16.127 TRACE glance File "/usr/local/
2016-03-08 08:25:16.127 TRACE glance return connection.
2016-03-08 08:25:16.127 TRACE glance File "/usr/local/
2016-03-08 08:25:16.127 TRACE glance compiled_sql, distilled_params
2016-03-08 08:25:16.127 TRACE glance File "/usr/local/
2016-03-08 08:25:16.127 TRACE glance context)
2016-03-08 08:25:16.127 TRACE glance File "/usr/local/
2016-03-08 08:25:16.127 TRACE glance util.raise_
2016-03-08 08:25:16.127 TRACE glance File "/usr/local/
2016-03-08 08:25:16.127 TRACE glance reraise(
2016-03-08 08:25:16.127 TRACE glance File "/usr/local/
2016-03-08 08:25:16.127 TRACE glance context)
2016-03-08 08:25:16.127 TRACE glance File "/usr/local/
2016-03-08 08:25:16.127 TRACE glance cursor.
2016-03-08 08:25:16.127 TRACE glance File "/usr/local/
2016-03-08 08:25:16.127 TRACE glance result = self._query(query)
2016-03-08 08:25:16.127 TRACE glance File "/usr/local/
2016-03-08 08:25:16.127 TRACE glance conn.query(q)
2016-03-08 08:25:16.127 TRACE glance File "/usr/local/
2016-03-08 08:25:16.127 TRACE glance self._affected_rows = self._read_
2016-03-08 08:25:16.127 TRACE glance File "/usr/local/
2016-03-08 08:25:16.127 TRACE glance result.read()
2016-03-08 08:25:16.127 TRACE glance File "/usr/local/
2016-03-08 08:25:16.127 TRACE glance first_packet = self.connection
2016-03-08 08:25:16.127 TRACE glance File "/usr/local/
2016-03-08 08:25:16.127 TRACE glance packet.
2016-03-08 08:25:16.127 TRACE glance File "/usr/local/
2016-03-08 08:25:16.127 TRACE glance err.raise_
2016-03-08 08:25:16.127 TRACE glance File "/usr/local/
2016-03-08 08:25:16.127 TRACE glance _check_
2016-03-08 08:25:16.127 TRACE glance File "/usr/local/
2016-03-08 08:25:16.127 TRACE glance raise errorclass(errno, errorvalue)
2016-03-08 08:25:16.127 TRACE glance DBReferenceError: (pymysql.
2016-03-08 08:25:16.127 TRACE glance
Changed in glance: | |
assignee: | nobody → Abhishek Kekane (abhishek-kekane) |
tags: | added: newton-rc-potential |
Changed in glance: | |
status: | Confirmed → In Progress |
The following patch seems to partially address this bug by providing a more user friendly message: /review. openstack. org/299209/
https:/
Somehow OpenStack Infra missed linking to it. In any case, the patch doesn't root cause or solve the bug. Is a more thorough solution required?