Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] grafana 4.5.x and graphite-api ( not default graphite ) #9258

Closed
derkgort opened this issue Sep 15, 2017 · 19 comments
Closed

[Bug] grafana 4.5.x and graphite-api ( not default graphite ) #9258

derkgort opened this issue Sep 15, 2017 · 19 comments
Milestone

Comments

@derkgort
Copy link

I'm getting this error in the webinterface after the update from 4.4.3 to 4.5.0. Tried 4.5.1 too. Same issue
I think the new version and the check for 1.0 vs 0.9 of graphite made this pop-up.

graphite plugin failed
TypeError: Cannot read property 'graphiteVersion' of undefined

Graphite API is a api only alternative to graphite web. We use it because it's leaner and easier to configure for multiple carbon directories. I think it does not have the params/json content that grafana is looking for.

Please include this information:

  • What Grafana version are you using?
    4.5.0, 4.5.1

  • What datasource are you using?
    graphite with graphite-api

  • What OS are you running grafana on?
    centos 7 latests

  • What did you do?
    usage graphite-api, not graphite-web and update from 4.4 to 4.5

  • What was the expected result?
    Still working

  • What happened instead?
    Got the error

@torkelo
Copy link
Member

torkelo commented Sep 15, 2017

When / where do you get the error?

@bergquist
Copy link
Contributor

bergquist commented Sep 15, 2017

@torkelo
Copy link
Member

torkelo commented Sep 15, 2017

It should not be null, empty object maybe

@bergquist
Copy link
Contributor

yea. Me and @daniellee is trying to reproduce this.

I have the same error last week but now I cannot reproduce it.

@derkgort
Copy link
Author

I get the error when i try to open grafana in the browser. Linux Chrome.
I had some tabs open and those still work.

I've downgraded back to 4.4 and it worked again.

@derkgort
Copy link
Author

And i have multiple orgs that connect to the different api's running on different ports.

@azhiltsov
Copy link
Contributor

Seems updater during update does not update json_data for graphite datasources. Can be manually fixed by updating each graphite datasource from the web-interface or by running SQL:

update data_source set json_data='{"graphiteVersion":"0.9"}' where type='graphite' and json_data='{}'

@daniellee
Copy link
Contributor

Can recreate this now. If the json_data field in the data_source table is null, then you get this error. When we first tried to recreate the error and failed, the json_data field was empty string rather than null.

This line in the frontendsettings api code, skips adding the json_data field if the value is null. A simple fix would be to have an else clause here and create an empty object.

@daniellee daniellee added this to the 4.5.2 milestone Sep 15, 2017
@derkgort
Copy link
Author

thanks for the attention to this issue!

@rotanid
Copy link

rotanid commented Sep 16, 2017

thanks @azhiltsov for the hint, that fixes the issue!

@torkelo
Copy link
Member

torkelo commented Sep 17, 2017

a temp workaround until patch release is out should be going into data source edit view and hit update

@azhiltsov
Copy link
Contributor

I attempted to migrate from 4.4.3 to 4.5.2 and seems the issue with wrong values in the json_data column is still there.
I am still getting "TypeError: Cannot read property 'graphiteVersion' of null" on dashboard load
And json_data is either null or {}

mysql> select json_data from data_source where type = 'graphite';
+-----------+
| json_data |
+-----------+
| null      |
| null      |
| null      |
| {}        |
| {}        |
| {}        |
| {}        |
| {}        |
| {}        |
+-----------+
9 rows in set (0.01 sec)

In migration_log there is only one new record: "alter table user ADD COLUMN last_seen_at DATETIME NULL"

@torkelo
Copy link
Member

torkelo commented Sep 25, 2017

we did not solve it via sql migration, but when we read the data and send to the frontend.

When do you get the error ? if you do "view source" (read html, there should be a json blob at the end with your data sources, what is the property of jsonData ?

@azhiltsov
Copy link
Contributor

azhiltsov commented Sep 25, 2017

As mentioned earlier - on dashboard load. Basically all dashboards with graphite datasoure became broken after update.
In the page source json blob contains the same as the database either: "jsonData":null or "jsonData":"{}"

@torkelo
Copy link
Member

torkelo commented Sep 25, 2017

strange, and your sure your running 4.5.2 ? (btw, the same fix for 4.5.1 should still work, go into data source edit view and save datasource, do a full page reload)

@lathiat
Copy link

lathiat commented Sep 27, 2017

Also having this problem on 4.5.2 -- the data source edit/save fixed it but it did not fix itself.

@davidlmaldonado
Copy link

This worked for me. Upgraded from grafana-4.4.3 to grafana-4.5.2.

@alaphoid
Copy link

alaphoid commented Oct 4, 2017

I upgraded from 4.4.3 to 4.5.2 and had to edit each data source and click 'Save & Test'. Before doing this I was getting the error: "TypeError: Cannot read property 'graphiteVersion' of null" when loading a dashboard.

@hanynowsky
Copy link

I got the same issue saying a.JsonData null when upgraded from 4.2 to 4.5. The problem is that I had beforehand setup the home page to be a specific dashboard. SO no way to access whatever menu for you get a blank page.
Anyway, downgraded to 4.2, then set the home page to be the default, then edited each datasource. Upgraded again to 4.5 and voilà, it's working as torkelo suggested. Hopefully this should be fixed in 4.6. Thanks for your feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants