KeyError: 'folderUid' during restore
Closed this issue · 4 comments
Hi, when trying to restore grafana from backup, getting KeyError: 'folderUid'.
restoring dashboard: ##/tmp/tmp_sf1nnrm/OUTPUT/dashboards/202203070850/mY9p7dQmz.dashboard
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/grafana_backup/dashboardApi.py", line 260, in get_folder_id
folder_uid = dashboard['meta']['folderUid']
KeyError: 'folderUid'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/grafana-backup", line 33, in
sys.exit(load_entry_point('grafana-backup==1.2.3', 'console_scripts', 'grafana-backup')())
File "/usr/lib/python3.9/site-packages/grafana_backup/cli.py", line 55, in main
restore(args, settings)
File "/usr/lib/python3.9/site-packages/grafana_backup/restore.py", line 90, in main
restore_components(args, settings, restore_functions, tmpdir)
File "/usr/lib/python3.9/site-packages/grafana_backup/restore.py", line 128, in restore_components
restore_functions[ext](args, settings, file_path)
File "/usr/lib/python3.9/site-packages/grafana_backup/create_dashboard.py", line 21, in main
'folderId': get_folder_id(content, grafana_url, http_post_headers, verify_ssl, client_cert, debug),
File "/usr/lib/python3.9/site-packages/grafana_backup/dashboardApi.py", line 263, in get_folder_id
folder_uid = matches.group(1)
AttributeError: 'NoneType' object has no attribute 'group'
Which Grafana version do you use? I guess your changes would break functionality for others.
Hi @israelshenkar
thank you for the PR. And as @NilsLeger said, this might break the program.
I have a comment in your PR, it needs more tests.
Thank you
Closing, if this is still not addressed in your case please comment @israelshenkar