Is there still no solution to lost root token?

I am trying to backup influxdb 2 but get the usual error that has been discussed many times here with no solution.

INFO: Downloading metadata snapshot
Error: failed to backup metadata: failed to download metadata snapshot: 401 Unauthorized: read:authorizations is unauthorized

I found a token called admin by running “influx auth list -t ” but that does not work for the backup command, is there really no progress on this continually recurring issue?

Thanks

Hello @HenrysCat,
I understand your frustration with the 401 Unauthorized error when trying to back up InfluxDB 2. This is a common issue that many users encounter :(.

The key issue here is that you need to use a token with operator-level permissions (also called a “root authorization token”). This is typically the token that was created during the initial setup process of InfluxDB, not just any admin token.

Have you tried the following? :

  1. Use the root/operator token: The backup command requires “the root authorization token (the token created for the first user in the InfluxDB setup process)” as seen in the InfluxDB backup documentation.

  2. Create a new operator token: If you don’t have access to the original operator token, you might need to create a new one. influxd recovery auth create-operator | InfluxDB OSS v2 Documentation.

also please note: the influx backup command does not work with InfluxDB Cloud, as mentioned in the InfluxDB Cloud CLI documentation.

Tried to create new operator token and I get,

 influxd recovery auth create-operator \
  --org esp8266 \
  --username admin

WARN[0000]log.go:228 gosnowflake.(*defaultLogger).Warn DBUS_SESSION_BUS_ADDRESS envvar looks to be not set, this can lead to runaway dbus-daemon processes. To avoid this, set envvar DBUS_SESSION_BUS_ADDRESS=$XDG_RUNTIME_DIR/bus (if it exists) or DBUS_SESSION_BUS_ADDRESS=/dev/null.
2025-04-16T06:16:55.130826Z     info    Resources opened        {"log_id": "0vwJjlM0000", "system": "bolt-kvstore", "path": "/root/.influxdbv2/influxd.bolt"}
Error: bucket "authorizationsv1": bucket not found
See 'influxd -h' for help

Any ideas on how to create a new operator token anyone?

@HenrysCat,
Let me ask @scott to see if he knows what to do once that command fails.

1 Like

Did you stop the influxd service prior to running the command? Have you confirmed that you are running the command against the correct BOLT file?

This post has some relevant info on the BOLT path: Best practice of stopping InfluxDB inside a docker container without stopping the container - #4 by Jeffrey

1 Like

I’m not using Docker, tried stopping influxd with same result.

did you confirm the location of your BOLT file? Maybe you are running the command against the wrong file.

How may bolt files are there? why is there more than one?

I don’t know. I’m just trying to help you out based on some of the things I read while trying to solve a similar problem. The guy in the link I posted above was apparently running against the wrong BOLT file.

Any news from @scott ?

You are definitely using the wrong Bolt file. Try searching for the file here: /var/lib/influxdb or /var/lib/influxdb2

Why is there more than one? Nobody knows what you have done with the system so far. You probably migrated from version 1.x?

Nothing in the instructions posted by @Anaisdg mention anything about any bolt file influxd recovery auth create-operator | InfluxDB OSS v2 Documentation

this is a v2 install from the start so don’t assume what you dont know.

I gotta say, you don’t seem very interested in the help that we are offering. It would be great if there were clear instructions for every possible issue, but that’s not the case. You’re going to have to do a little bit of legwork.

I suggest that you take a look in the directories that @Marc-Berg mentioned and confirm that the BOLT file exists there. Then, when you run influxd recovery auth create-operator, do it using the explicit path of the BOLT file. There is an example of this usage in step 6 of this post: Best practice of stopping InfluxDB inside a docker container without stopping the container - #8 by tkohhh

Why are you posting about Docker? As I said before I am not using Docker

I also lost my root token. Any idea on how to get this back?

You won’t get any help here, probably no way to get it back

Yes, it’s definitely possible. You need to run influxd recovery auth create-operator (documentation here: influxd recovery auth create-operator | InfluxDB OSS v2 Documentation).

There are some gotcha’s you need to be aware of:

  • You can only run this command while the influxd service is not running. If you’re using docker, it’s not obvious how to proceed, but you can follow the instructions posted here: Best practice of stopping InfluxDB inside a docker container without stopping the container - #8 by tkohhh
  • By default, this will update the bolt file in this path: ~/.influxdbv2/influxd.bolt In some cases, that’s not the correct location of your live bolt file. If that’s the case, you’ll need to specify the correct path using --bolt-path
  • Make sure you include the --org and --username as these are required.

I hope this helps!

1 Like