Problems with Influxdb

Influxdb has really caused all sorts of problems for me. I managed to get the Influxdb persistence working finally but now I’m facing problems with backing up Influxdb.

I thought that I could just copy the c:\users\myuser.influxdbv2\engine\data\bucketID folder to my NAS but it has turned out to be more difficult than this. Today I imported more data in annotated csv format to Infludb and it seemed to be ok until I noticed that the database was empty. I don’t know why this happened. I then copied the directory from my NAS to the Influxdb data folder but the bucket was still empty. I also tried to delete the bucket and recreate it but it didn’t help. I then started to look at Influxdb community how the backup should be done.

I have now tried to use command in influxdb cli:

influx backup --bucket openhab d:\tmp --token Awe0kgAnAW1wGE5yCeQ5RuYAy4gwXwDRsbu35pWr3wg-ES4d2aGikBrXH8taHIDDsfhEH5Nu5Ry1tFUWepQS4A==

I’m not quite sure how to give the path for the backup, though. I get an error message:

There were some other cases for the “401 Unauthorized: unauthorized access” errors in the InfluxDB community but no actual solutions which would have worked in my case. So, I’m wondering whether anyone in this community has faced this unauthorized access problem.

I’m getting somewhat annoyed about Influxdb. It seems that I have to create a bucket for the 3rd time by importing my historic data which is in annotated csv format. At first I want to get the backup working.

I read this error as a problem with access privileges to get access to the data.

This page mentions

The influx backup command requires:

  • The directory path for where to store the backup file set
  • The root authorization token (the token created for the first user in the InfluxDB setup process).

Could it be that you use a different token ?

Haven’t done it but I would expect that copying would work:

  • when influxdb is offline
  • and all related directories are copied
    not only data but also meta data directory which on linux is a directory next to the data directory

Thanks. I installed influxdb last November and most likely I have missed completely the setup for operator token so I have been trying to use the all access token which doesn’t seem to work. I had a quick look at the link for managing the tokens and it seems that it is possible to create the operator token manually. Perhaps I will reinstall influxdb just to see how the operator token is created. I haven’t used influxdb yet for actual production.

I’m somewhat confused about the backup by copying the directory under data folder because I noticed yesterday when importing one csv file that a new folder was created under data folder so there was a bucket with new ID and it seemed that I lost the previous data although the old folder with old ID was still there.

I managed to get the backup working. Problem was that I used All access API token instead of root token. It seems that the Influx GUI shows only the name of the operator token but I found a link where it is explained how to get the root token. So I used command:

influx auth list -t <temporary token>

The backup seems to create lots of .tar.gz files. I then deleted the bucket and made a restore so I backup/restore seems to work now.

Many thanks for your help.

1 Like