grafana-statusmap icon indicating copy to clipboard operation
grafana-statusmap copied to clipboard

Cannot read property 'map' of undefined

Open di97mni opened this issue 5 years ago • 20 comments

Grafana 7.2.2 Statusmap : 0.3.4

Getting this error when upgrading to Grafana 7.2.2 and Statusmap 0.3.4 Any ideas what to look for?

image

image

image

image

di97mni avatar Oct 21 '20 17:10 di97mni

Hello. My first thought it is a 'no data' case. It is a known and long-lasting bug.

diafour avatar Oct 21 '20 18:10 diafour

Hi, and thanks for answering The query, to log analytics in Azure, returns data. This is what it looked like before the upgrade.

image

di97mni avatar Oct 22 '20 06:10 di97mni

Example of data from Azure

image

di97mni avatar Oct 22 '20 06:10 di97mni

Yep, it is definitely not a "No data" issue. Unfortunately, I have no access to Log Analytics Workspace to reproduce the issue. I've tried Azure Monitor queries and it works as expected.

Can you please help gather some debug information to fix this issue? You need to navigate to a 'module.ts' in 'Sources' pane of DevTools and set a breakpoint on line 365. Then press 'reload' button in a dashboard. Next scroll to Scope and expand 'dataList' variable.

Example 1 with Prometheus datasource with 2 queries: Снимок экрана 2020-10-23 в 21 00 37

Example 2 with Azure Monitor also with 2 queries. Снимок экрана 2020-10-23 в 21 03 27

diafour avatar Oct 23 '20 18:10 diafour

Haven't forgot this but I haven't been able to test it again. Needed to roll back to 7.0.0. Will test it again as soon as I can

di97mni avatar Nov 10 '20 13:11 di97mni

Hi @di97mni, are there any news on that?

shurup avatar Jan 15 '21 03:01 shurup

Had the same problem

  • Grafana v7.3.7 (1e261642f4)
  • Datasource https://github.com/alexanderzobnin/grafana-zabbix v4.1.1
  • Statusmap v0.3.4

Console errors: image

Debug tools: image

Let me know if there is any extra info needed for debugging.

tambetliiv avatar Jan 26 '21 15:01 tambetliiv

@tambetliiv statusmap doesn't support "table" data from datasources, only "timeseries".

diafour avatar Jan 27 '21 07:01 diafour

Ok, thanks for the quick answer, seems like datasource provides "table". When testing with timeseries, no issues, and after changing to "table" it produces that error.

Will try to find a way to provide data as a "timeseries"

tambetliiv avatar Jan 27 '21 08:01 tambetliiv

Today I tried to upgrade again. Sorry for the delay. Grafana 7.0.0 => 7.4.3

I've set the breakpoint in module.ts but it's never hit

image

Instead I see this errors in the console.log Now I don't even come to getting any data from Azure.

image

My javascript knowledge is very limited...

@shurup have you had the same issue?

di97mni avatar Feb 24 '21 16:02 di97mni

Looking in the issue list I can see the plugin isn’t compatible with Grafana 7.4 I’ll try this again when it’s compatible

di97mni avatar Feb 24 '21 17:02 di97mni

Testing with 7.3.6 and using a query from the docs we can see that in 7.0.0 it's a time series whereas in 7.3.6 the same query is returned as a table Haven't found the reason why it, at least from 7.2.2, behaves like this

AzureActivity
| where $__timeFilter(TimeGenerated)
| summarize count() by Category, bin(TimeGenerated, 1h)
| order by TimeGenerated asc

image

image

di97mni avatar Feb 24 '21 20:02 di97mni

Thank you for debugging! You've also shed the light on the mystery with Grafana 7.3.6 from https://github.com/flant/grafana-statusmap/issues/176

diafour avatar Feb 24 '21 22:02 diafour

Changing to a query from the help section and using Graph panel we can see the same issue with type: "table". Looks like the Graph panel supports it though.

Maybe this issue should go to the Grafana issue list instead? I have looked in the list for similar issue but no success.

image

di97mni avatar Feb 25 '21 10:02 di97mni

@di97mni I'm taking a look at this from Grafana POV - it looks like you're having problems with both Azure Monitor (Logs) and ADX?

Do you have a sample query (preferably using the datatable fn?) I could run to try and dig into this? Unfortunately none of our Workspaces have AzureActivity data populated

joshhunt avatar Mar 04 '21 16:03 joshhunt

@joshhunt we are not using ADX, only log analytics and application insights. I don't think it matters what log analytics query you are writing, we get the same issue. I can create a sample workspace for you if you need something to query.

di97mni avatar Mar 05 '21 10:03 di97mni

@di97mni Is it possible to reproduce this with the datatable operator within a Logs query with just a couple of rows? Unforunately I'm not too familiar with Statusmap and the fields it expects in the results.

Just trying to figure out exactly what's breaking down here - it is likely that Statusmap adding support for Dataframes could fix this, but Grafana should be automatically converting back to the older format anyway.

joshhunt avatar Mar 15 '21 15:03 joshhunt

@joshhunt I've added a docker compose and some Grafana datasource and dashboard to hopefully make it easier to find it. The dashboard contains datatable. However, due to it's not supported to use environment variables in Grafana dashboard you need to manually set WS and subscription ID in the dashboard file

"REPLACE_WITH_WORKSPACE_ID" "REPLACE_WITH_SUBSCRIPTION_ID"

You also need to set the values for your Azure account in the docker compose file

Then when I open panel in Grafana 7.0.0 I see this

http://localhost:3000/d/Z3lF6oQGz/flant_grafana-statusmap_issues_143?orgId=1&editPanel=2 image

But when open it in Grafana 7.2.2 I see this

http://localhost:3001/d/Z3lF6oQGz/flant_grafana-statusmap_issues_143?orgId=1&editPanel=2

image

di97mni avatar Mar 22 '21 15:03 di97mni

Hi @joshhunt Any updates on this? Do you need more info from me? Thanks!

di97mni avatar Apr 13 '21 05:04 di97mni

Probably same as #227

di97mni avatar Jan 14 '22 08:01 di97mni