Variable created for JSON datasource returns Error TypeError: Cannot read property 'storage' of undefined

  • What Grafana version and what operating system are you using? Grafana v8.0.2 (5c5d45e19f)

  • What are you trying to achieve? Create a Dashboard Query Variable using a JSON API datasource

  • How are you trying to achieve it? Dashboard Settings → Variables → New → Type=Query → Select Datasource

  • What happened? An unexpected error happened. TypeError: Cannot read property ‘storage’ of undefined

  • What did you expect to happen? To continue to create the variable

  • Can you copy/paste the configuration(s) that you are having problems with? Source is URL. Sample JSON (with changed values) is {"?xml":{“version”:“1.0”,“encoding”:“UTF-8”},“Portfolios”:{“Portfolio”:[{“key”:“AAA”,“name”:“AAA”,“visible”:“true”,“product”:“AAA”,“label”:“AAA”},{“key”:“BBB”,“name”:“BBB”,“visible”:“true”,“product”:“BBB”,“label”:“BBB”},{“key”:“CCC”,“name”:“CCC”,“visible”:“true”,“product”:“CCC”,“label”:“CCC”},{“key”:“DDD”,“name”:“DDD”,“visible”:“true”,“product”:“DDD”,“label”:“DDD”},{“key”:“EEE”,“name”:“EEE”,“visible”:“true”,“product”:“EEE”,“label”:“EEE”},{“key”:“FFF”,“name”:“FFF”,“visible”:“true”,“product”:“FFF”,“label”:“FFF”},{“key”:“GGG”,“name”:“GGG”,“visible”:“true”,“product”:“GGG”,“label”:“GGG”},{“key”:“HHH”,“name”:“HHH”,“visible”:“true”,“product”:“HHH”,“label”:“HHH”},{“key”:“III”,“name”:“III”,“visible”:“true”,“product”:“III”,“label”:“III”},{“key”:“JJJ”,“name”:“JJJ”,“visible”:“true”,“product”:“JJJ”,“label”:“JJJ”},{“key”:“KKK”,“name”:“KKK”,“visible”:“true”,“product”:“KKK”,“label”:“KKK”},{“key”:“LLL”,“name”:“LLL”,“visible”:“true”,“product”:“LLL”,“label”:“LLL”},{“key”:“MMM”,“name”:“MMM”,“visible”:“true”,“product”:“MMM”,“label”:“MMM”}]}}

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    An unexpected error happened
    DetailsTypeError: Cannot read property ‘storage’ of undefined

    at q (/public/plugins/marcusolsson-csv-datasource/module.js:2:26028)
    at H (/public/plugins/marcusolsson-csv-datasource/module.js:2:32850)
    at eval (/public/plugins/marcusolsson-csv-datasource/module.js:2:35665)
    at div
    at div
    at div
    at d (/public/build/app.7f5a241f55df4a1c66ae.js:4204:210923)
    at p (/public/build/app.7f5a241f55df4a1c66ae.js:4204:211710)
    at div
    at div
    at d (/public/build/app.7f5a241f55df4a1c66ae.js:4204:210923)
    at p (/public/build/app.7f5a241f55df4a1c66ae.js:4204:211710)
    at div
    at div
    at d (/public/build/app.7f5a241f55df4a1c66ae.js:4204:210923)
    at p (/public/build/app.7f5a241f55df4a1c66ae.js:4204:211710)
    at _ (/public/build/app.7f5a241f55df4a1c66ae.js:845:6541)
    at k (/public/build/vendors~app.7f5a241f55df4a1c66ae.js:2:70367)
    at div
    at div
    at d (/public/build/app.7f5a241f55df4a1c66ae.js:4204:210923)
    at p (/public/build/app.7f5a241f55df4a1c66ae.js:4204:211710)
    at form
    at div
    at Z (/public/build/app.7f5a241f55df4a1c66ae.js:266:4225)
    at k (/public/build/vendors~app.7f5a241f55df4a1c66ae.js:2:70367)
    at div
    at Ce (/public/build/app.7f5a241f55df4a1c66ae.js:288:1710)
    at k (/public/build/vendors~app.7f5a241f55df4a1c66ae.js:2:70367)
    at div
    at div
    at div
    at div
    at div
    at t (/public/build/vendors~app.7f5a241f55df4a1c66ae.js:2:706836)
    at h (/public/build/app.7f5a241f55df4a1c66ae.js:5437:31539)
    at div
    at on (/public/build/app.7f5a241f55df4a1c66ae.js:301:68)
    at div
    at W (/public/build/DashboardPage.7f5a241f55df4a1c66ae.js:482:667)
    at DashboardPage
    at k (/public/build/vendors~app.7f5a241f55df4a1c66ae.js:2:70367)
    at n (/public/build/vendors~app.7f5a241f55df4a1c66ae.js:2:462197)
    at dr (/public/build/app.7f5a241f55df4a1c66ae.js:5612:3196)
    at t (/public/build/vendors~app.7f5a241f55df4a1c66ae.js:2:1206671)
    at t (/public/build/vendors~app.7f5a241f55df4a1c66ae.js:2:1208716)
    at div
    at t (/public/build/vendors~app.7f5a241f55df4a1c66ae.js:2:1203276)
    at div
    at at (/public/build/app.7f5a241f55df4a1c66ae.js:3076:1106)
    at h (/public/build/app.7f5a241f55df4a1c66ae.js:5435:19792)
    at Di (/public/build/app.7f5a241f55df4a1c66ae.js:3726:564)
    at Ei (/public/build/app.7f5a241f55df4a1c66ae.js:3726:848)
    at l (/public/build/vendors~app.7f5a241f55df4a1c66ae.js:2:68275)
    at Nr (/public/build/app.7f5a241f55df4a1c66ae.js:5625:300)

  • Did you follow any online instructions? If so, what is the URL? https://marcus.se.net/grafana-json-datasource/variables

@marcusolsson, any thoughts?

Are you sure you’ve configured the JSON API data source? It looks from the logs like you’ve added the CSV data source?

Yes, JSON (and I have setup a Panel that displays the data for the same Datasource in a Table). I actually have a Variable defined for a CSV Datasource which works (though I’m also not sure why the Datasource type would matter for a Variable).

Sample JSON is
{
“portfolios”: [
{
“name”: “TEST A”,
“key”: “TEST_A”,
“label”: “TEST A”,
“rating1”: “1.0”,
“rating2”: “5.0”,
“AAA”: “507741”,
“rating3”: “4.0”,
“rating4”: “5.0”,
“projects”: “1”,
“B”: “0”,
“url”: “https://aaa”,
“rating5”: {
“rating”: 1,
“projects”: 0
}
},
{
“name”: “TEST B”,
“key”: “TESTB”,
“label”: “TEST B”,
“rating1”: “2.0”,
“rating2”: “2.0”,
“AAA”: “144253”,
“rating3”: “2.0”,
“rating4”: “3.0”,
“projects”: “6”,
“B”: “7”,
“url”: “https://bbb”,
“rating5”: {
“rating”: 1,
“projects”: 0
}
}
]
}

I believe this has been fixed in a later version of the JSON API plugin. Could you try with a recent version, and see if that fixes your problem?

This topic was automatically closed after 365 days. New replies are no longer allowed.