flutterhole icon indicating copy to clipboard operation
flutterhole copied to clipboard

fetchClientsOverTime failed with unexpected error

Open djh82 opened this issue 4 years ago • 6 comments

I have recently set privacy to maximum, so I'm not recording what clients are querying. Where the graph once was, is now replaced with the following warning :

{message: fetchClientsOverTime failed with unexpected error, error: type '_GrowableList<dynamic>' is not a subtype of type 'Map<dynamic, dynamic>' in type cast}

djh82 avatar Jun 13 '20 12:06 djh82

The clients and domains tabs at the bottom, also suffer from this.

djh82 avatar Jun 13 '20 12:06 djh82

Hello @davidhart82 👋 - Thanks for opening an issue!

Sounds like the requests that require authentication are failing. Could you try out the following URL in your browser (adjust as necessary and add your API token):

http://pi.hole/admin/api.php?getClientNames&auth=MY_TOKEN

A successful response yields some JSON data. If authentication fails, you should see something like [ ].

sterrenb avatar Jun 16 '20 14:06 sterrenb

Everything else works; its because there is no data available due to enhanced privacy settings. I will run that when I am at home later tonight though for you!

djh82 avatar Jun 16 '20 14:06 djh82

This is what is returned:

{"clients":[]}

It looks like _valueToHitsOverTime is casting an empty list to a map, which causes the error?

djh82 avatar Jun 16 '20 20:06 djh82

{"clients":[]}

That seems like a normal response... I will look into handling empty lists more gracefully, that seems to be the culprit.

sterrenb avatar Jun 21 '20 13:06 sterrenb

I'm facing this same issue. This same issue occurs on client page and query page also if your pi is offline it occurs there too.

hey24sheep avatar Jun 30 '20 18:06 hey24sheep