Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Cannot read property 'map' of undefined #143

Open
di97mni opened this issue Oct 21, 2020 · 20 comments
Open

Cannot read property 'map' of undefined #143

di97mni opened this issue Oct 21, 2020 · 20 comments
Labels
bug Something isn't working data frames Issues related to data frames support
Milestone

Comments

@di97mni
Copy link

di97mni commented Oct 21, 2020

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

@diafour
Copy link
Collaborator

diafour commented Oct 21, 2020

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

@diafour diafour added the bug Something isn't working label Oct 21, 2020
@di97mni
Copy link
Author

di97mni commented Oct 22, 2020

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
Copy link
Author

di97mni commented Oct 22, 2020

Example of data from Azure

image

@diafour
Copy link
Collaborator

diafour commented Oct 23, 2020

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

@di97mni
Copy link
Author

di97mni commented Nov 10, 2020

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

@diafour diafour added this to the 0.4.0 milestone Nov 30, 2020
@shurup
Copy link
Contributor

shurup commented Jan 15, 2021

Hi @di97mni, are there any news on that?

@tambetliiv
Copy link

Had the same problem

Console errors:
image

Debug tools:
image

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

@diafour
Copy link
Collaborator

diafour commented Jan 27, 2021

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

@tambetliiv
Copy link

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"

@di97mni
Copy link
Author

di97mni commented Feb 24, 2021

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
Copy link
Author

di97mni commented Feb 24, 2021

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
Copy link
Author

di97mni commented Feb 24, 2021

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

@diafour
Copy link
Collaborator

diafour commented Feb 24, 2021

Thank you for debugging! You've also shed the light on the mystery with Grafana 7.3.6 from #176

@di97mni
Copy link
Author

di97mni commented Feb 25, 2021

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

@diafour diafour modified the milestones: 0.4.0, 0.5.0 Mar 4, 2021
@diafour diafour added the data frames Issues related to data frames support label Mar 4, 2021
@joshhunt
Copy link

joshhunt commented Mar 4, 2021

@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

@di97mni
Copy link
Author

di97mni commented Mar 5, 2021

@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.

@joshhunt
Copy link

@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.

@di97mni
Copy link
Author

di97mni commented Mar 22, 2021

@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
Copy link
Author

di97mni commented Apr 13, 2021

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

@di97mni
Copy link
Author

di97mni commented Jan 14, 2022

Probably same as #227

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working data frames Issues related to data frames support
Projects
None yet
Development

No branches or pull requests

5 participants