deleting role with implied role fails

Bug #1546562 reported by Adam Young
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
High
Steve Martinelli

Bug Description

Create two roles. Make one imply the other (need curl for now)

$ openstack role delete identity_policy_manager
ERROR: openstack An unexpected error prevented the server from fulfilling your request. (HTTP 500) (Request-ID: req-a2b89f42-ad24-4985-a599-33cc182d8f80)

Looking in the log

Feb 17 14:05:44 ayoung541 admin: 2016-02-17 14:05:44.042 31 ERROR keystone.common.wsgi [req-a2b89f42-ad24-4985-a599-33cc182d8f80 6259462f07a940f19b1ad8d36ee42612 b0fa955539c442cc838067a55605102d - default default] (pymysql.err.IntegrityError) (1451, u'Cannot delete or update a parent row: a foreign key constraint fails (`keystone`.`implied_role`, CONSTRAINT `implied_role_prior_role_id_fkey` FOREIGN KEY (`prior_role_id`) REFERENCES `role` (`id`))') [SQL: u'DELETE FROM role WHERE role.id = %(id)s'] [parameters: {'id': u'142340f53b624665a86641cf13135615'}]

This is supposed to be a cascading delete.

Tags: sql
Changed in keystone:
importance: Undecided → Critical
status: New → Triaged
Changed in keystone:
milestone: none → mitaka-3
Revision history for this message
Alexander Makarov (amakarov) wrote :

Looks like we need to pay attention to cascading deletion: http://docs.sqlalchemy.org/en/latest/orm/cascades.html

Changed in keystone:
assignee: nobody → Alexander Makarov (amakarov)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

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

Changed in keystone:
status: Triaged → In Progress
Changed in keystone:
assignee: Alexander Makarov (amakarov) → Steve Martinelli (stevemar)
Changed in keystone:
assignee: Steve Martinelli (stevemar) → Alexander Makarov (amakarov)
Changed in keystone:
assignee: Alexander Makarov (amakarov) → Steve Martinelli (stevemar)
Changed in keystone:
assignee: Steve Martinelli (stevemar) → Alexander Makarov (amakarov)
Changed in keystone:
importance: Critical → High
tags: added: sql
Changed in keystone:
assignee: Alexander Makarov (amakarov) → Dave Chen (wei-d-chen)
Dave Chen (wei-d-chen)
Changed in keystone:
assignee: Dave Chen (wei-d-chen) → Alexander Makarov (amakarov)
Changed in keystone:
assignee: Alexander Makarov (amakarov) → Steve Martinelli (stevemar)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/281921
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=15ca0f27f13031afa591e1c07846bd1fe9d92b15
Submitter: Jenkins
Branch: master

commit 15ca0f27f13031afa591e1c07846bd1fe9d92b15
Author: Alexander Makarov <email address hidden>
Date: Thu Feb 18 18:57:40 2016 +0300

    Implied roles index with cascading delete

    Currently, when deleting a role that has an implied role, only one
    is removed from the database. This is because the initial FKs that
    were created did not take delete and update into account.

    Change-Id: I09ef96cf9e4a863337399ae880e0511125f5239c
    Closes-Bug: 1546562

Changed in keystone:
status: In Progress → Fix Released
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/keystone 9.0.0.0b3

This issue was fixed in the openstack/keystone 9.0.0.0b3 development milestone.

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.