Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

Problem on using api v1 DELETE request after upgrade from 11.2-U5 to 11.2-U6

Joined
Oct 7, 2019
Messages
6
Hello,
I'm using the Restful API v1 for a while, everything works fine.
But when I upgrade the OS from 11.2-U5 to U6, I found I got error response for DELETE request.
For example:
api/v1.0/services/iscsi/targettoextent/(int: id)/
or
/api/v1.0/storage/volume/(int:id|string:name)/zvols/(string: name)/
It'll return status=400 with reason=Bad Request
(they works on 9.10, 11.1, 11.2-U5)

I think it maybe something wrong with v1 and try api v2 again, but it also have problem:
DELETE for /api/v2.0/iscsi/targetextent/id/{id},
but got status=500 Internal Server Error with reason=Server got itself in trouble

Then I saw the U6 have a bug fixed changes for apiv1, does it change all RESTful API behavior for DELETE?:
https://jira.ixsystems.com/browse/NAS-102874

What am I missing ?
Any help would be appreciated.

Thank you.
 
Joined
Oct 7, 2019
Messages
6
don't know to resolve this,
now I backup config and rollback/reinstall 11.2-U5 to make sure function works.
 
Joined
Oct 7, 2019
Messages
6
Update again, this method seems still have problem. extent id can be delete but require several time trying

update:
found workaround way:
- Upgrade to or clean install 11.2-U6
- send DELETE RESTful request and failed confirmed
- based on the commit changes:
(NAS-102874 / 11.2 / Properly restart/reload services on object deletion ( api v1 ))
backup and remove the delete_detail() function section in utils.py, save then reboot system
(/usr/local/www/freenasUI/api/utils.py)
- send DELETE RESTful request and success as before
 
Joined
Dec 12, 2019
Messages
1
I have written (well enhanced) a plugin for the Proxmox VE environment and this seems to be exactly what we are experiencing. The users of the plugin cannot 'delete' their ZVOL's/extent/targets using the plugin which uses the API's to create, delete, update, read. It use to work like a champ but the 11.2-U5 to 11.2-U6 and beyond seems to be our breaking point. I have included the link to my github.com repo for this project and the issue with all the logs from a Proxmox view that the users of the plugin have uploaded.

https://github.com/TheGrandWazoo/freenas-proxmox/issues/51

In my lab I can not replicate this issue but I do not have a lot of luns (maybe 4 at most). But at my customers, which has about 30+ luns, and also the users of the Plugin seems to work after a reboot but will fail over time with the 400 'In Use' error.
Also, we can delete it from the GUI just fine.

Thanks
 
Joined
Oct 7, 2019
Messages
6
updated~ now I can delete extent without errors. on 11.2-U7
For my issue case, It's my coding issue and I guess after 11.2-U5, OS should be stricter about the REST handling

- using JAVA library (javax.ws.rs) to remove but still got failed
String del_url = "/services/iscsi/targettoextent/"+associateid+"/";
target = client.target(Account.targeturl).path(del_url);
response = target.request(MediaType.APPLICATION_JSON).delete(Response.class);
- change as below can pass
response = target.request()
.header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
.delete(Response.class);

using curl command with/without -H "Content-Type: application/json" also can get same result.
 
Top