API return 500 when data on TrueNAS side are unavailable

Tomaae

Dabbler
Joined
Feb 24, 2021
Messages
12
Hello,
I'm working on TrueNAS integration for Home Assistant and I ran into unusial API behavior.
API will return code 500 not just on server failure, but also when data is not available for existing query.
For example, CPU temperature for TrueNAS running in VM (confirmed on ESX, VirtualBox and Proxmox).
Example query:
Code:
query: reporting/get_data, post, {'graphs': [{'name': 'cputemp'}], 'reporting_query': {'start': 'now-90s', 'end': 'now-30s', 'aggregate': True}}

There are other cases, but I were not able to pinpoint it, just that some graphs are not showing in TrueNAS as well. It happens for different user.
Both core and scale are reacting in this way.

Is this an intended behaviour for TrueNAS API and if so, can all code 500 error be handles as no-issue from API client side? That is, assuming error 500 would never be raised on actual error.
 

Kris Moore

SVP of Engineering
Administrator
Moderator
iXsystems
Joined
Nov 12, 2015
Messages
1,471
This sounds like a legit bug we need to fix on the TrueNAS side. Can you please file a ticket with details at https://jira.ixsystems.com so we can get this resolved in an upcoming update for you?
 
Top