question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'length' of undefined (influxdb)

See original GitHub issue

Query: SELECT top(total, router,10) FROM (SELECT sum(“value”) as total FROM “autogen”.“sessions” WHERE $timeFilter GROUP BY “router”) Format As: Table

TypeError: Cannot read property ‘length’ of undefined at a.isMsResolutionNeeded (http://192.168.75.40/public/app/boot.8fcdddf2.js:29:26428) at new a (http://192.168.75.40/public/app/boot.8fcdddf2.js:29:23352) at PieChartCtrl.seriesHandler (http://192.168.75.40/public/plugins/grafana-piechart-panel/piechart_ctrl.js?bust=1512049737347:168:26) at Array.map (<anonymous>) at PieChartCtrl.onDataReceived (http://192.168.75.40/public/plugins/grafana-piechart-panel/piechart_ctrl.js?bust=1512049737347:161:36) at f.emit (http://192.168.75.40/public/app/boot.8fcdddf2.js:62:13409) at a.emit (http://192.168.75.40/public/app/boot.8fcdddf2.js:62:15727) at PieChartCtrl.b.handleQueryResult (http://192.168.75.40/public/app/boot.8fcdddf2.js:56:15010) at i (http://192.168.75.40/public/app/boot.8fcdddf2.js:52:15288) at http://192.168.75.40/public/app/boot.8fcdddf2.js:52:15710

If I change the format as time series, it only displays one type of value where as the actual response contains more. The same query works fine if the panel is of type Table.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:15

github_iconTop GitHub Comments

5reactions
chershmacommented, Aug 15, 2018

I had this issue with elastic query and solved it by performing the first group-by on my field and then another group by on date histogram. probably not a good solution for everyone.

5reactions
kaiterramikecommented, Jun 28, 2018

The workaround I used was to use Format As: Time Series, name your fields according to what the plugin expects, then insert a dummy time_sec field using now():

SELECT
    UNIX_TIMESTAMP(NOW()) AS time_sec,
    ifnull(some_field, 'unknown') as metric,
    COUNT(some_other_field) as value
FROM
    ...

The ifnull() and COUNT() are just for color in this example.

Read more comments on GitHub >

github_iconTop Results From Across the Web

InfluxDB error messages - InfluxData Documentation
The database name required error occurs when certain SHOW queries do not specify a database. Specify a database with an ON clause in...
Read more >
Apparently no causes for the error "TypeError: Cannot read ...
you are trying to access a property from array[0] which does not exist yet. array.length is equivalent to array.length !== 0 so array[0].Name ......
Read more >
Developers - Cannot read property 'length' of undefined (influxdb) -
Query: SELECT top(total, router,10) FROM (SELECT sum("value") as total FROM "autogen"."sessions" WHERE $timeFilter GROUP BY "router") Format As: Table.
Read more >
Cannot read Property 'type' of undefined - Grafana
Tried with different internet browsers, same issue. And it worked without any problems with the same datasource (InfluxDB) and query with the ...
Read more >
SUSE-CU-2022:878-1: Security update of ses/7/ceph/grafana
SUSE Container Update Advisory: ses/7/ceph/grafana ... InfluxDB: Fix Cannot read property 'length' of undefined in when parsing response.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found