CPU temp reporting broken in Reporting UI and API

Description

Since TrueNAS-12.0-U6 the CPU temp graph (see attached screenshot) and the CPU temps in the REST API are broken. In TrueNAS-12-U5 this was not the case.

This Bug affects all of my three TrueNAS servers. The atteched debug-file and screenshot is from my main server.

When requesting CPU temps via REST API (see python code below) TrueNAS reponds with the following error trace :

{'message': "'NoneType' object is not iterable", 'traceback': 'Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/middlewared/restful.py", line 575, in do
result = await self.middleware.call(methodname, *method_args, **method_kwargs)
File "/usr/local/lib/python3.9/site-packages/middlewared/main.py", line 1256, in call
return await self._call(
File "/usr/local/lib/python3.9/site-packages/middlewared/main.py", line 1224, in _call
return await self.run_in_executor(prepared_call.executor, methodobj, *prepared_call.args)
File "/usr/local/lib/python3.9/site-packages/middlewared/main.py", line 1128, in run_in_executor
return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs))
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.9/site-packages/middlewared/schema.py", line 979, in nf
return f(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/middlewared/plugins/reporting/update.py", line 231, in get_data
rrd.export(i[\'identifier\'], starttime, endtime, aggregate=query[\'aggregate\'])
File "/usr/local/lib/python3.9/site-packages/middlewared/plugins/reporting/rrd_utils.py", line 196, in export
for rrd_file in self.get_rrd_files(identifier):
File "/usr/local/lib/python3.9/site-packages/middlewared/plugins/reporting/rrd_utils.py", line 144, in get_rrd_files
for rrd_type in self.get_rrd_types(identifier):
TypeError: \'NoneType\' object is not iterable
'}

Python-Code to reproduce the broken API:

def fetchFreenasCpuTemps(sApiKey):
headers = {
"Accept" : "application/json",
"Content-Type" : "application/json",
"Authorization" : "Bearer " + sApiKey + ""
}
payload = {"graphs":[{"name":"cputemp"}],"reporting_query":{"unit":"HOUR","page":0,"aggregate":True}}
jsonPayload = json.dumps(payload)
return requests.post(FREENAS_CPU_TEMPS_URL, data=jsonPayload, headers=headers, verify=False).content

Problem/Justification

None

Impact

None

Activity

Show:

Bug Clerk October 27, 2021 at 4:13 PM

Bug Clerk October 20, 2021 at 11:32 AM

Florian Westphal October 13, 2021 at 6:27 AM

Update for the python code: 

 

Complete

Details

Assignee

Reporter

Labels

Impact

Low

Time remaining

0m

Components

Fix versions

Affects versions

Priority

Katalon Platform

Created October 12, 2021 at 7:02 PM
Updated July 6, 2022 at 8:56 PM
Resolved October 27, 2021 at 4:18 PM