Issues
- RESTful API 2.0 bug with /disk/id/{id}NAS-122246Resolved issue: NAS-122246Vladimir Vinogradenko
- local users missing after rebootNAS-109004Resolved issue: NAS-109004Triage Team
- Timezone mismatch in reporiting graphsNAS-107552Resolved issue: NAS-107552Dennis Mullen
- Panic due to possible corruption of sa_layout_num_treeNAS-106631Resolved issue: NAS-106631Triage Team
- FreeNAS disks forget their assigned poolNAS-106583Resolved issue: NAS-106583Lola Yang
- Download stock BIOSNAS-106536Resolved issue: NAS-106536Triage Team
- Replication tasks - entire dataset keeps being resentNAS-106517Resolved issue: NAS-106517Vladimir Vinogradenko
- rsync can't backup linux box, fresh copy from ports worksNAS-106403Resolved issue: NAS-106403Triage Team
- Editing user does not work without change usernameNAS-106356Resolved issue: NAS-106356Triage Team
- Some paths of multpath disks are showing as available discs to add to poolNAS-106334Resolved issue: NAS-106334Triage Team
- SMB and AFP still don't work after restart, with auto service onNAS-106322Resolved issue: NAS-106322Triage Team
- Accounts: User: Edit existing user, field username no change causes errorNAS-106320Resolved issue: NAS-106320Triage Team
- Accounts:User: cannot change password, "save" stays greyed outNAS-106319Resolved issue: NAS-106319Triage Team
- itpitak-admin-bt4NAS-106315Resolved issue: NAS-106315Triage Team
- popup href not opening in new browser tabNAS-106312Resolved issue: NAS-106312Lola Yang
- FreeNAS Deleted All files 1 by 1 in front of eyesNAS-106307Resolved issue: NAS-106307Triage Team
- IOCage jails network failure after upgrade to 11.3-U3.1NAS-106306Resolved issue: NAS-106306Waqar Ahmed
- Importing DiskNAS-106305Resolved issue: NAS-106305Triage Team
- Selective replication on a recursive taskNAS-106304Resolved issue: NAS-106304Triage Team
- Replication Never FinishesNAS-106296Resolved issue: NAS-106296Vladimir Vinogradenko
- Random RebootsNAS-106294Resolved issue: NAS-106294Triage Team
- UI not honoring custom portsNAS-106292Resolved issue: NAS-106292Ryan Moeller
- no if_mxge.ko FreeNAS 11.3-U3.1NAS-106287Resolved issue: NAS-106287Triage Team
- Dataset not able to access via SMB after changing ACLNAS-106285Resolved issue: NAS-106285Triage Team
- Inconsistent datetime format in reportingNAS-106283Resolved issue: NAS-106283Damian Szidiropulosz
- Cannot create user starting with a numberNAS-106274Resolved issue: NAS-106274Dennis Mullen
- German and English text strings mingled in message after logoutNAS-106273Resolved issue: NAS-106273Erin Clark
- virtual machines broken?NAS-106270Resolved issue: NAS-106270Triage Team
- Some Text In UI don't show up in the .PO file (11.3-U3.1)NAS-106269Resolved issue: NAS-106269Erin Clark
- Jails GUI (IP) is not updated after starting/stoppingNAS-106267Resolved issue: NAS-106267Lola Yang
- Cloud Sync Tasks for gdrive using encryption should show unencrypted dir/files in UINAS-106261Resolved issue: NAS-106261Vladimir Vinogradenko
- User configurationNAS-106256Resolved issue: NAS-106256Triage Team
- Inactive save button in Accounts/Users -> Edit userNAS-106255Resolved issue: NAS-106255Triage Team
- Jail MAC ADDRESS validation fails in "Advanced Jail Creation"NAS-106254Resolved issue: NAS-106254Waqar Ahmed
- Cron doesn't behave as cron shouldNAS-106251Resolved issue: NAS-106251Timothy Moore II
- No help text in System>Alert SettingsNAS-106249Resolved issue: NAS-106249Lola Yang
- MineOS plugin fails due to renamed package rdiff-backupNAS-106245Resolved issue: NAS-106245Triage Team
- Empty snapshots still taken on parent datasetsNAS-106243Resolved issue: NAS-106243Triage Team
- Dashboard only reporting 1 thread for CPUNAS-106242Resolved issue: NAS-106242Triage Team
- Global config default gateway setting is not IPv4/IPv6 specificNAS-106240Resolved issue: NAS-106240Triage Team
- IPv6 default gateway disappearsNAS-106239Resolved issue: NAS-106239Vladimir Vinogradenko
- Since update 11.3 problems starting services AFP / SMBNAS-106237Resolved issue: NAS-106237Andrew Walker
- After system upgrade to FreeNAS-11.3-U3.1 (4ad557f5ec) I still must restart manually the samba service to workNAS-106236Resolved issue: NAS-106236Triage Team
- After Update Dashboard is always emptyNAS-106232Resolved issue: NAS-106232Damian Szidiropulosz
- Scrub Time Remaining FixNAS-106230Resolved issue: NAS-106230Dennis Mullen
- Debian VM EFI Boot Manager Not Found/MountedNAS-106229Resolved issue: NAS-106229Triage Team
- Unscheduled System rebootNAS-106228Resolved issue: NAS-106228Triage Team
- Bridge adds additional members after rebootNAS-106227Resolved issue: NAS-106227Triage Team
- Can't edit usersNAS-106226Resolved issue: NAS-106226Triage Team
- 11.3-U3.1 - Config Upload File Too LargeNAS-106225Resolved issue: NAS-106225Triage Team
RESTful API 2.0 bug with /disk/id/{id}
Description
Problem/Justification
Impact
Details
Details
Assignee
Reporter
Labels
Impact
Time remaining
Components
Fix versions
Priority
Katalon Platform
Katalon Platform
Activity
Automation for Jira June 20, 2023 at 8:25 AM
This issue has now been closed. Comments made after this point may not be viewed by the TrueNAS Teams. Please open a new issue if you have found a problem or need to re-engage with the TrueNAS Engineering Teams.
Bug Clerk June 20, 2023 at 7:25 AM
Vladimir Vinogradenko June 20, 2023 at 7:23 AM
Non-numeric identifiers work for me on 23.10
root@truenas[~/freenas/freenas/tests]# curl -u root:password localhost/api/v2.0/disk/id/%7Bserial%7DVB3fadf901-46ac94df/
{
"identifier": "{serial}VB3fadf901-46ac94df",
"name": "sda",
...
Christian Marg June 13, 2023 at 8:27 AMEdited
Yes, I tried that to no avail via URLencode and GET-Body - the RESTful API 2.0 wrapper expects an integer value, `identifier` is a string…
See also the Post of the Forum Moderator Samuel Tai: https://www.truenas.com/community/threads/how-to-discover-disk-uids-for-freenas-http-api-v2-0.86968/post-762795 :
Yes, this is a bug in the RESTful 2.0 API. The API call works correctly using
midclt call disk.update '{serial_lunid}P4HEY9UC_5000cca249d46e61' '{"smartoptions":"-d sat"}'
. The basic issue is the dictionary for the storage_disk table in the configuration database doesn't have a field corresponding to id.
William Gryzbowski June 12, 2023 at 6:04 PM
Did you try using “identifier
" ?
As discussed in this forum thread https://www.truenas.com/community/threads/how-to-discover-disk-uids-for-freenas-http-api-v2-0.86968/ there is an Issue with the
/disk/id/{id}
RESTful API 2.0 call, because disks don’t have a numeric ID assigned to them. To fix this, the config database scheme would need to be changed to include a numeric ID or the RESTful API wrapper would need to accept “string” typed IDs, too, either via GET/POST body or as URI component, but the latter would mean that the current “identifier” values need to be URLencoded before putting them in the URI because of special chars…
If one isn’t limited to RESTful API 2.0, there are workarounds like using ‘midclt’ to call the needed method as described in the forum post. But you either need shell access or use websocket API to use the workaround, which might not be feasible for everyone.
Here is what currently happens when I try to GET disk id 0:
curl -X GET "https://hostname/api/v2.0/disk/id/0" -H "accept: */*" -H "Authorization: Bearer $APIKEY" -H "Content-Type: application/json" | sed 's/\\n/\n/g' { "message": "'id'", "traceback": "Traceback (most recent call last): File \"/usr/local/lib/python3.9/site-packages/middlewared/restful.py\", line 580, in do result = await self.middleware.call(methodname, *method_args, **method_kwargs) File \"/usr/local/lib/python3.9/site-packages/middlewared/main.py\", line 1279, in call return await self._call( File \"/usr/local/lib/python3.9/site-packages/middlewared/main.py\", line 1236, in _call return await methodobj(*prepared_call.args) File \"/usr/local/lib/python3.9/site-packages/middlewared/schema.py\", line 975, in nf return await f(*args, **kwargs) File \"/usr/local/lib/python3.9/site-packages/middlewared/plugins/disk.py\", line 89, in query return await super().query(filters, options) File \"/usr/local/lib/python3.9/site-packages/middlewared/schema.py\", line 975, in nf return await f(*args, **kwargs) File \"/usr/local/lib/python3.9/site-packages/middlewared/service.py\", line 490, in query return await self.middleware.call( File \"/usr/local/lib/python3.9/site-packages/middlewared/main.py\", line 1279, in call return await self._call( File \"/usr/local/lib/python3.9/site-packages/middlewared/main.py\", line 1236, in _call return await methodobj(*prepared_call.args) File \"/usr/local/lib/python3.9/site-packages/middlewared/schema.py\", line 975, in nf return await f(*args, **kwargs) File \"/usr/local/lib/python3.9/site-packages/middlewared/plugins/datastore/read.py\", line 102, in query qs = qs.where(and_(*self._filters_to_queryset(filters, table, prefix, aliases))) File \"/usr/local/lib/python3.9/site-packages/middlewared/plugins/datastore/filter.py\", line 51, in _filters_to_queryset col = self._get_col(table, name, prefix) File \"/usr/local/lib/python3.9/site-packages/middlewared/plugins/datastore/schema.py\", line 23, in _get_col raise KeyError(name) KeyError: 'id' " }#
As you can see, there is no ‘id’ listed when querying a disk:
curl -X GET "https://hostname/api/v2.0/disk" -H "accept: */*" -H "Authorization: Bearer $APIKEY" -H "Content-Type: application/json" -d '{"query-filters":[],"query-options":{"limit":1}}' [ { "identifier": "{serial_lunid}REPLACED _5000000000000000", "name": "da118", "subsystem": "da", "number": 118, "serial": "REPLACED", "lunid": "5000000000000000", "size": 3000592982016, "multipath_name": "disk23", "multipath_member": "da141", "description": "", "transfermode": "Auto", "hddstandby": "ALWAYS ON", "hddstandby_force": false, "advpowermgmt": "DISABLED", "acousticlevel": "DISABLED", "togglesmart": true, "smartoptions": "", "expiretime": null, "critical": null, "difference": null, "informational": null, "model": "HITACHI HUASOMETHING", "rotationrate": 7200, "type": "HDD", "zfs_guid": "5973852185995294423", "bus": "MPS", "devname": "multipath/disk23", "enclosure": null, "pool": null } ]#
This issue exists at least since Version 11.3-U3.1 and since in 13.0-U4 it’s still the same, I guess that the bug is in all releases inbetween those two.