grafana-backup-tool icon indicating copy to clipboard operation
grafana-backup-tool copied to clipboard

KeyError: 'folderUid' during restore

Open israelshenkar opened this issue 2 years ago • 3 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'

israelshenkar avatar Mar 07 '22 10:03 israelshenkar

#179

israelshenkar avatar Mar 07 '22 10:03 israelshenkar

Which Grafana version do you use? I guess your changes would break functionality for others.

nileger avatar Mar 10 '22 10:03 nileger

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

ysde avatar Mar 14 '22 09:03 ysde

Closing, if this is still not addressed in your case please comment @israelshenkar

acjohnson avatar Jul 28 '23 02:07 acjohnson