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