ysde/grafana-backup-tool

Crash on save_folders.py

Closed this issue · 0 comments

Version Affected: 1.1.6
Environment: Kubernetes

Background:
Been using the tool successfully for a while but backups recently started failing with the following Traceback information:

Traceback (most recent call last):
  File "/usr/bin/grafana-backup", line 11, in <module>
    load_entry_point('grafana-backup==1.1.6', 'console_scripts', 'grafana-backup')()
  File "/usr/lib/python3.8/site-packages/grafana_backup/cli.py", line 43, in main
    save(args, settings)
  File "/usr/lib/python3.8/site-packages/grafana_backup/save.py", line 43, in main
    backup_functions[backup_function](args, settings)
  File "/usr/lib/python3.8/site-packages/grafana_backup/save_folders.py", line 26, in main
    get_individual_folder_setting_and_save(folders, folder_path, log_file, grafana_url, http_get_headers, verify_ssl, client_cert, debug, pretty_print, uid_support)
  File "/usr/lib/python3.8/site-packages/grafana_backup/save_folders.py", line 59, in get_individual_folder_setting_and_save
    (status, content) = get_folder(folder_uri, grafana_url, http_get_headers, verify_ssl, client_cert, debug)
  File "/usr/lib/python3.8/site-packages/grafana_backup/dashboardApi.py", line 120, in get_folder
    (status_code, content) = send_grafana_get('{0}/api/folders/{1}'.format(grafana_url, uid), http_get_headers,
  File "/usr/lib/python3.8/site-packages/grafana_backup/dashboardApi.py", line 187, in send_grafana_get
    return (r.status_code, r.json())
  File "/usr/lib/python3.8/site-packages/requests/models.py", line 898, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Seems to be related to the stage Save Folders. Any thoughts on what might be happening or what this traceback might be indicating beyond just not returning the expected JSON (i.e. None)?

Thanks!