Beam-Connectivity / grafana-dashboard-manager

Import and export Grafana dashboards for backup and dynamic provisioning
MIT License
59 stars 13 forks source link

dashboard.py - KeyError: 'folderId' #18

Closed ehudyonasi closed 11 months ago

ehudyonasi commented 1 year ago

I am running into this issue with the folderId not present with the cli tool. not sure why is that because it has a folderId and it seems to be passing it in the logs but not actually saving it. I have a fix for it that I can push via PR.

ERROR ❌ An exception occurred with General - MyDashboard dashboard_download.py:95 Traceback (most recent call last): File "/home/eyonasi/.local/lib/python3.10/site-packages/grafana_dashboard_manager/dashboard_download.py", line 85, in _write_dashboards_to_local_folder_from_grafana_folder dashboard_definition = update_dashlist_folder_ids(dashboard_definition) File "/home/eyonasi/.local/lib/python3.10/site-packages/grafana_dashboard_manager/dashboard.py", line 62, in update_dashlist_folder_ids panel = update_single_dashlist_folder_id(panel) File "/home/eyonasi/.local/lib/python3.10/site-packages/grafana_dashboard_manager/dashboard.py", line 92, in update_single_dashlist_folder_id if panels_definition["options"]["folderId"] == folder_id: KeyError: 'folderId'