[taskflow] Create volume revert fails when request is initiated by a member user

Bug #1230159 reported by Rohit Karajgi
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Abhijeet Malawade

Bug Description

Commit: 1874d913ecbf8f09809992c98496365327905211

If a non-admin (member) user initiates a Create volume request, and an error occurs in a task
after the EntryCreateTask is complete, the revert operation, or volume destroy db call fails as it uses the non-admin context
to do so.

The following stacktrace is seen in c-api.log:
2013-09-25 00:39:44.522 15017 ERROR cinder.volume.flows.create_volume [req-68daa6e9-e75e-42c6-8e67-91efe8605bb5 6b91f0e38a8144a183c653e8eddd58e7 74bb572081ec4dd7a5d3fb641c6c92c6] Failed destroying volume entry 3faea4c8-fc05-4b2d-a3b2-a0b
88d3c621d
2013-09-25 00:39:44.522 15017 TRACE cinder.volume.flows.create_volume Traceback (most recent call last):
2013-09-25 00:39:44.522 15017 TRACE cinder.volume.flows.create_volume File "/opt/stack/cinder/cinder/volume/flows/create_volume/__init__.py", line 580, in revert
2013-09-25 00:39:44.522 15017 TRACE cinder.volume.flows.create_volume self.db.volume_destroy(context, vol_id)
2013-09-25 00:39:44.522 15017 TRACE cinder.volume.flows.create_volume File "/opt/stack/cinder/cinder/db/api.py", line 203, in volume_destroy
2013-09-25 00:39:44.522 15017 TRACE cinder.volume.flows.create_volume return IMPL.volume_destroy(context, volume_id)
2013-09-25 00:39:44.522 15017 TRACE cinder.volume.flows.create_volume File "/opt/stack/cinder/cinder/db/sqlalchemy/api.py", line 119, in wrapper
2013-09-25 00:39:44.522 15017 TRACE cinder.volume.flows.create_volume raise exception.AdminRequired()
2013-09-25 00:39:44.522 15017 TRACE cinder.volume.flows.create_volume AdminRequired: User does not have admin privileges
2013-09-25 00:39:44.522 15017 TRACE cinder.volume.flows.create_volume

The volume gets stuck in "Creating" state and is unusable.

Commands snip:
$ cinder create 1
ERROR: The server has either erred or is incapable of performing the requested operation.
$ cinder list
+--------------------------------------+----------+--------------+------+-------------+----------+-------------+
| ID | Status | Display Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+----------+--------------+------+-------------+----------+-------------+
| 3faea4c8-fc05-4b2d-a3b2-a0b88d3c621d | creating | None | 1 | None | False | |
+--------------------------------------+----------+--------------+------+-------------+----------+-------------+

Tags: ntt
Changed in cinder:
assignee: nobody → Abhijeet Malawade (abhijeet-malawade)
Rohit Karajgi (rohitk)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

Changed in cinder:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/48891
Committed: http://github.com/openstack/cinder/commit/62e6c7268dcdf2479a7c8864acc32493df22b7e8
Submitter: Jenkins
Branch: master

commit 62e6c7268dcdf2479a7c8864acc32493df22b7e8
Author: Abhijeet Malawade <email address hidden>
Date: Fri Sep 27 05:38:59 2013 -0700

    Create volume revert fails for non admin user

    Done fixes in revert method of EntryCreateTask task
    to use elevated context while destroying volume.

    Fixes bug #1230159

    Change-Id: I41b7f2ae4e0235df40bcdaa511256775228751aa

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
milestone: none → havana-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: havana-rc1 → 2013.2
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.