Error: You are not allowed to delete volume: $X

Bug #1502876 reported by sean redmond
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Confirmed
Low
Unassigned

Bug Description

When using Ceph as the back end storage a snapshot of a volume is dependent upon the original volume meaning it is an illegal operation to delete the volume without first deleting the snapshot.

Should you try and delete such a volume horizon {kilo} reports back the error "Error: You are not allowed to delete volume:" - This error message is confusing and leaves the end user unsure why the volume can not be removed.

I think we should handle this by better checking what cinder API reports back and displaying a more user friendly error message.

The below is an example of the error that comes back from cinder, passing this up in horizon would be very helpful.

$ cinder delete 34feea60-fb50-4fbe-8136-885f5553a8a8
Delete for volume 34feea60-fb50-4fbe-8136-885f5553a8a8 failed: Invalid volume: Volume still has 1 dependent snapshots. (HTTP 400) (Request-ID: req-320be24f-ce7a-4a79-9d6f-9166821c42e9)
ERROR: Unable to delete any of specified volumes.
$

Revision history for this message
Augustina Ragwitz (auggy) wrote :

I just want to clarify, I was attempting to reproduce a bug in Nova and after cleaning up the volumes I'd created, in Horizon I received this error when I tried to delete the volume. I had not used Ceph, I just created a volume snapshot off of a volume I created off of the default cirros image. I think it's fair to say, this bug affects any volume with an associated snapshot.

From the command line, I ran "cinder delete foo" and got the message "Delete for volume foo failed: Invalid volume: Volume still has 1 dependent snapshots. (HTTP 400) (Request-ID: req-74c69b6d-f687-4738-b7c9-42bca6bf5a5c)
ERROR: Unable to delete any of the specified volumes." In the Horizon UI, logged in as admin, I received the error listed in this bug when I tried to delete that volume. Once I had this information from cinder in the CLI, I returned to Horizon. I deleted the volume snapshot and then I was able to delete the volume.

Tyr Johanson (tyr-6)
Changed in horizon:
status: New → Confirmed
Revision history for this message
Tyr Johanson (tyr-6) wrote :

project/volumes/volumes/tables.py has DeleteVolume class. The "allowed" method checks if the volume has an attached snapshot. In this case, Horizon detects the volume has an attached snapshot, and fails the allowed check for the action, triggering a generic table action error toast message.

The message comes from horizon/tables/actions.py 'You are not allowed to %(action)s: %(objs)s'

The current structure of the "generic" table action does not allow the individual action to return a reason for why the action is not allowed.

The same generic error will be returned if the volume is not in a "deletable state".

In this case, it may be better to simply attempt the API call, then display the more detailed Cinder error message.

Revision history for this message
Rob Cresswell (robcresswell-deactivatedaccount) wrote :

So the issue here is not that an action is being processed incorrectly, but just that the error message in question is useless.

Changed in horizon:
importance: Undecided → Low
milestone: none → next
tags: added: error-reporting
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.