-
Notifications
You must be signed in to change notification settings - Fork 82
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
Can't load dashboard json file #191
Comments
@gaetanBelliere woud you be able to provide the dashboard that provoke the failure ? I wonder if I could add it in the tests. |
What's weird is that when I tried to upload the conflicting files only it would work perfectly, making my example not relevant.. So instead I used the Grafana provisioning, which is way easier to maintain than using Ansible (because it doesn't require to keep an exact list of every dashboard config file and it's destination). I guess we can close this issue, even though the problem remains |
SUMMARY
While trying to provision a CentOS7 VM with Ansible, some dashboards configuration files fail to load. Those json files are fetched from the grafana GUI. The dashboards that fail are dashboards containing Markdown Text panel. Issue is the following :
One quick fix is to convert the text to HTML with appropriate flags.
ISSUE TYPE
COMPONENT NAME
grafana_dashboard
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
The targeted os is a CentOS7 local VM. I use a Windows docker container as an Ansible runner.
STEPS TO REPRODUCE
Create a grafana dashboard with a Mardown text panel.
Copy the json model of the dashboard and store it in dashboard.json.
Provision grafana dashboard.
EXPECTED RESULTS
The dashboard to load and to be provision like other dashboards with no markdown text.
ACTUAL RESULTS
Dashboard fails to load
I know how to fix this bug. I have tested it locally. Thanks to this post : https://stackoverflow.com/questions/491921/unicode-utf-8-reading-and-writing-to-files-in-python/844443#844443
Here : https://github.com/ansible-collections/community.grafana/blob/main/plugins/modules/grafana_dashboard.py#L308
Should be changed to :
Of course import io at the top of the file.
The text was updated successfully, but these errors were encountered: