Netdata->Graphite->Grafana: sortByMaxima = internal server error

I have set up Netdata->Graphite->Grafana, and am able to graph metrics (e.g. **), but as soon as I select ‘sortByMaxima()’ as the only function, Grafana puts up a big red banner saying “Internal Server Error”:

Here’s the working (unsorted) query and graph:

When I look at the network response, I see a long python error:

Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/flask/", line 2292, in wsgi_app
response = self.full_dispatch_request()
  File "/usr/lib/python3.7/site-packages/flask/", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
  File "/usr/lib/python3.7/site-packages/flask/", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3.7/site-packages/flask/", line 35, in reraise
raise value
  File "/usr/lib/python3.7/site-packages/flask/", line 1813, in full_dispatch_request
rv = self.dispatch_request()
  File "/usr/lib/python3.7/site-packages/flask/", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/lib/python3.7/site-packages/graphite_api/", line 401, in render
series_list = evaluateTarget(context, target, data_store)
  File "/usr/lib/python3.7/site-packages/graphite_api/", line 496, in evaluateTarget
result = evaluateTokens(requestContext, tokens, data_store)
  File "/usr/lib/python3.7/site-packages/graphite_api/", line 506, in evaluateTokens
return evaluateTokens(requestContext, tokens.expression, data_store)
  File "/usr/lib/python3.7/site-packages/graphite_api/", line 520, in evaluateTokens
ret = func(requestContext, *args, **kwargs)
  File "/usr/lib/python3.7/site-packages/graphite_api/", line 1905, in sortByMaxima
return list(sorted(seriesList, key=max))
TypeError: '>' not supported between instances of 'NoneType' and 'NoneType'

Any idea why my metrics have a type of ‘NoneType’ and how I can fix it?

My system is running Fedora29, with these packages/versions:
netdata v1.29.3-205-nightly – from


On further introspection, it appears that Graphite is the one emitting the error. Sigh. Ok, off to debug Graphite.