InfluxDB2 backup Unauthorized

I am trying to run a simple backup on my whole Influxdb 2 instance to move to another server.

I run this command :

influx backup InfluxBackup --token <Long Token>

But when I run it I always get this output :

2021-07-07T19:31:05.639155Z     info    Backing up KV store     {"log_id": "0VCc4o7l000", "path": "InfluxBackup/20210707T193105Z.bolt"}
Error: Failed to download KV backup: read:authorizations is unauthorized.
See 'influx backup -h' for help

This does generat a very small .bolt file in the InflucBackup folder, but it is only about 4KB while my database ( stored in /var/lib/influxdb/engin/ ) is about 2MB, so to me I dont think it has worked.

I can’t seem to understand why this is, I am running this on the local system, the token I am using is an “All Access Token” - That I just created after a bit of reading and searching for why I was failing.

I found that I need to use thr “Root Auth Token” but I either deleted that while I was setting up the system or I never got it.

Any ideas would be of great help.

1 Like

@Duck999 your observation is correct: the/backup API requires the initial “operator”/super-user token to pass authentication. It’s not (currently) possible to create a new token with those permissions.

Unless you explicitly deleted it, you should be able to find the initial token in the UI. It’ll be under Data > Tokens, with the name <initial user>'s Token

Ahh, ok thank you.

I was able to uninstall and reinstall a new system to check that, I deleted it, lessons learnt the hard way.

Do you know if it is possible to delete the users and some how keep the database ?
Or how I can backup the old database before going over to the new system ?
Just to get around this problem for now.

Thanks for your help.

I have the same problem and I have deleted the <initial user>'s Token. Is there any way to get a new user token capable to perform backups? I can’t reinstall the system

I have the same issue…
I can not reinstall the system and the creators Token has been accidentally deleted.

Because of that I can not even restore an old backup.
Is there a solution to this issue?

If that Token can not be created again and is so different from others please add an extra confirmation step before deleting or prevent the possibility to delete that token at all.

2 Likes

Same thing happening to me.
I wish I don’t have to reinstall influxdb for this…