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

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

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/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3.7/site-packages/flask/_compat.py", line 35, in reraise
raise value
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
  File "/usr/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/lib/python3.7/site-packages/graphite_api/app.py", line 401, in render
series_list = evaluateTarget(context, target, data_store)
  File "/usr/lib/python3.7/site-packages/graphite_api/app.py", line 496, in evaluateTarget
result = evaluateTokens(requestContext, tokens, data_store)
  File "/usr/lib/python3.7/site-packages/graphite_api/app.py", line 506, in evaluateTokens
return evaluateTokens(requestContext, tokens.expression, data_store)
  File "/usr/lib/python3.7/site-packages/graphite_api/app.py", line 520, in evaluateTokens
ret = func(requestContext, *args, **kwargs)
  File "/usr/lib/python3.7/site-packages/graphite_api/functions.py", 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:
grafana-6.3.4-1.fc29.x86_64.rpm
python3-carbon-1.1.4-1.fc29.1.noarch.rpm
python3-whisper-1.1.4-1.fc29.1.noarch.rpm
netdata v1.29.3-205-nightly – from kickstart.sh

Thanks

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