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

Restore is not done

Open nicosistemas opened this issue 1 year ago • 2 comments

Hello, I have a problem when restoring the backup hosted in S3. As you can see, the backup is done and uploaded correctly to S3, but when I try the restore it throws me the following error. I also had it run as Cronjobs in Kubernetes and it does the backup successfully but not the restore. Can someone give me a little help?

Docker:

sudo docker run --user $(id -u):$(id -g) --rm --name grafana-backup-tool
-e GRAFANA_TOKEN="glsa_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
-e GRAFANA_URL=https://sre-monitor-dev.gruposancristobal.org.ar
-e GRAFANA_ADMIN_ACCOUNT=admin
-e GRAFANA_ADMIN_PASSWORD=xxxxxxxxxxxxxxxxxxxxxxx
-e VERIFY_SSL=False
-v /tmp/backup/:/opt/grafana-backup-tool/OUTPUT
-e AWS_S3_BUCKET_NAME="sre-backup-grafana"
-e AWS_S3_BUCKET_KEY="backup"
-e AWS_DEFAULT_REGION="us-east-1"
-e AWS_ACCESS_KEY_ID="xxxxxxxxxxxxxxxxxxxxxxx"
-e AWS_SECRET_ACCESS_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
-e RESTORE="true"
-e ARCHIVE_FILE="202305101820.tar.gz"
ysde/docker-grafana-backup-tool

Error:

########################################

[Pre-Check] Server status is 'OK' !!

########################################

Download archives from S3: Download from S3 was successful restoring datasource: /tmp/tmpbn3zjt2e/OUTPUT/datasources/202305101820/rjriIiKVk.datasource [DEBUG] resp status: 409 [DEBUG] resp body: {'message': 'data source with the same name already exists', 'traceID': ''} create datasource: Prometheus, status: 409, msg: {'message': 'data source with the same name already exists', 'traceID': ''} restoring library_element: /tmp/tmpbn3zjt2e/OUTPUT/library-elements/202305101820/xMDOgqA4k.library_element [DEBUG] resp status: 200 [DEBUG] resp body: [] query folder:, status:200 Traceback (most recent call last): File "/usr/bin/grafana-backup", line 33, in sys.exit(load_entry_point('grafana-backup==1.3.0', 'console_scripts', 'grafana-backup')()) File "/usr/lib/python3.10/site-packages/grafana_backup/cli.py", line 55, in main restore(args, settings) File "/usr/lib/python3.10/site-packages/grafana_backup/restore.py", line 98, in main restore_components(args, settings, restore_functions, tmpdir) File "/usr/lib/python3.10/site-packages/grafana_backup/restore.py", line 136, in restore_components restore_functions[ext](args, settings, file_path) File "/usr/lib/python3.10/site-packages/grafana_backup/create_library_element.py", line 23, in main library_element["folderUid"] = folder_id_response[0]['uid'] IndexError: list index out of range

nicosistemas avatar May 10 '23 18:05 nicosistemas