Project

General

Profile

Bug #57141

Fix APIv1 bug that prevented deletion of a cloned zvol

Added by Manuel Lanctot 5 months ago. Updated 3 months ago.

Status:
Done
Priority:
No priority
Assignee:
Eric Turgeon
Category:
Middleware
Target version:
Seen in:
Severity:
Low Medium
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No
Tags:

Description

I'm trying to delete a cloned ZFS snapshot:

curl -v -X DELETE /api/v1.0/storage/volume/tank/zvols/<volname>/

This returns the following response:

* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Content-Type: application/json
< Content-Length: 121
< Server: Werkzeug/0.14.1 Python/3.6.5
< Date: Tue, 13 Nov 2018 11:30:39 GMT
<
"The object '&lt;ZFSVol: tank/volname&gt;' has an empty attribute 'description' and doesn't allow a default or null value." 

Cloned volumes have the comments/description attribute empty and there is no REST method to PUT a description on an existing Zvol - it can only be set at ZVol creation.

If I use the web GUI to manually set random comments to ZVols, I can then delete them via the API.

In /usr/local/www/freenasUI/api/resources.py, in the ZVolResource class, I made the following change by hand:

-    comments = fields.CharField(attribute='description')
+    comments = fields.CharField(attribute='description', null=True)

And now I can delete ZFS vols via the API without issues.

So, the tastypie-defined comments field for ZVols should be made optional or cloning a snapshot should set a default comment or allow the ZVolResource.put() method to edit the "comments" attribute.


Related issues

Copied to FreeNAS - Bug #57519: Fix APIv1 bug that prevented deletion of a cloned zvolDone

Associated revisions

Revision f1b2acb4 (diff)
Added by Waqar Ahmed 5 months ago

Bug fix for cloned zvols

This commit fixes a bug where there was an issue with how api v1 handles cloned zvols.
Ticket: #57141

Revision 9ba95d83 (diff)
Added by Waqar Ahmed 5 months ago

Bug fix for cloned zvols

This commit fixes a bug where there was an issue with how api v1 handles cloned zvols.
Ticket: #57141

Revision 30d4b42b (diff)
Added by Waqar Ahmed 5 months ago

Bug fix for cloned zvols

This commit fixes a bug where there was an issue with how api v1 handles cloned zvols.
Ticket: #57141

Revision e700995f (diff)
Added by Waqar Ahmed 5 months ago

Bug fix for cloned zvols

This commit fixes a bug where there was an issue with how api v1 handles cloned zvols.
Ticket: #57141

History

#1 Updated by Dru Lavigne 5 months ago

  • Assignee changed from Release Council to William Grzybowski

#2 Updated by William Grzybowski 5 months ago

  • Assignee changed from William Grzybowski to Waqar Ahmed
  • Target version changed from Backlog to TrueNAS 11.1-U6.2
  • Severity changed from New to Low Medium

#3 Updated by Waqar Ahmed 5 months ago

  • Status changed from Unscreened to In Progress

#4 Updated by Waqar Ahmed 5 months ago

  • Copied to Bug #57519: Fix APIv1 bug that prevented deletion of a cloned zvol added

#5 Updated by Waqar Ahmed 5 months ago

  • Status changed from In Progress to Ready for Testing
  • Needs Doc changed from Yes to No
  • Needs Merging changed from Yes to No

#6 Updated by Dru Lavigne 5 months ago

  • Subject changed from API bug: Impossible to delete a cloned ZVol to Fix APIv1 bug that prevented deletion of a cloned zvol

#7 Updated by Bonnie Follweiler 5 months ago

  • Status changed from Ready for Testing to Passed Testing
  • Needs QA changed from Yes to No

Test Passed in TrueNAS-11.1-U7-INTERNAL1

#9 Updated by Dru Lavigne 5 months ago

  • Status changed from Passed Testing to Done

#10 Updated by Dru Lavigne 5 months ago

  • Target version changed from TrueNAS 11.1-U6.2 to 11.1-U7

#12 Updated by Eric Turgeon 3 months ago

  • Assignee changed from Waqar Ahmed to Eric Turgeon

#14 Updated by Eric Turgeon 3 months ago

I was tasked to double check this, and everything looks fine.

Also available in: Atom PDF