Problems installing influxDB


(MrBurns) #1

Hi,

I tried to install influxDB on my raspPI 3B+ (openhbianpi) using the openhabian-config tool. During this I several time was asked to create a password for different users. So far no problem.
But then I don’t know how to go ahead. I tried to follow this tutorial:

https://community.openhab.org/t/influxdb-grafana-persistence-and-graphing/13761

then I started influx CLI using:

$ influx

following lines appeared:

Connected to http://localhost:8086 version 1.7.2
InfluxDB shell version: 1.7.2
Enter an InfluxQL query

Then I wanted to create a database using following command:

CREATE DATABASE myDB

But I got this error:

ERR: unable to parse authentication credentials
Warning: It is possible this error is due to not setting a database.
Please set a database with the command “use <database>”.

What I am missing please?

Thanks a lot…


(CM6.5 H102) #2

What happens when you use the USE command?

Example:
USE myDB


(MrBurns) #3

Hi H102,

then I get this error:

ERR: unable to parse authentication credentials
DB does not exist!

What I do not understand is what the opehabian-config tool is installing if choosing ‘InfluxDB+Grafana’.
Since it is asking me to enter several times a password I thought it will create some initial DB to work with. But it seems not.


(CM6.5 H102) #4

What do you have in this file?

 /etc/openhab2/services/influxdb.cfg:

The default database name will be openhab unless you change it here.


(MrBurns) #5

I have this:

url=http://localhost:8086
user=openhab
password=xxxyyy
db=openhab_db
retentionPolicy=autogen
url=http://localhost:8086
user=openhab
password=xxxyyy
db=openhab_db
retentionPolicy=autogen

I don’t know why all appears twice!?!

If I enter

use openhab_db

I get as well:

ERR: unable to parse authentication credentials
DB does not exist!


(CM6.5 H102) #6

That is strange.:thinking: Maybe try commenting out the duplicate stuff and change the file to match what you want to use e.g. db=myDB


(CM6.5 H102) #7

Try CREATE DATABASE instead of USE after you get your services file setup.


(MrBurns) #8

I tried to change this file but Visual Studio code (on my Mac) won’t let ne change this file. I got permission error.
It offers the option ‘retry as sudo’ which I did. Then I entered the credentials of my openhabian user but the password is declined - I tried several times without success - username openhabian and passwort are correct since I use it to login via ssh as well.
Other files like e.g. influxdb.persist I can change and save without any problems.

It is really strange - how can I change this file now?


(CM6.5 H102) #9

Change the file permissions manually or use the openhabian-config tool to fix permissions.

EDIT: Check what the permissions are with ls -al /etc/openhab2/services/influxdb.cfg you may need to change the owner as well.

If the owner:group is different than your other service files use sudo chown openhab:openhabian influxdb.cfg or however you have the user:group setup if not opehab:openhabian


(CM6.5 H102) #10

I forgot to mention in my post above that you’ll need to connect via ssh or directly to make permission, owner, group changes. I’m sure you are aware of this but it’s been a few minutes with no reply so I’m just making sure.:wink:

Also, if you need assistance with the commands for any changes let me know.


(MrBurns) #12

Hi,

I changed the group and user of the influxdb.cfg file and could delete the double entries.
Then I started influx CLI again and tried:

CREATE DATABASE myDB but again I get following error:

ERR: unable to parse authentication credentials
Warning: It is possible this error is due to not setting a database.
Please set a database with the command “use <database>”.

I also tried:

use myDB
ERR: unable to parse authentication credentials
DB does not exist!

and also

use openhab_db
ERR: unable to parse authentication credentials
DB does not exist!

As I understand the influxdb.cfg file has only to do with openHAB and not with influx CLI.
So changing of influxdb.cfg makes no difference - correct me if I am wrong.

For what reason the openhabin-config tool creates the different users - but not any default database which I can use?

I still need help - thanks…


(CM6.5 H102) #13

I think you are correct I was just hopping it would help b/c I don’t see what the issue could be. I followed the same tutorial when I installed influx but didn’t have issues so I’m kinda guessing at this point.

Did you install influxDB binding in PaperUI?


(MrBurns) #14

Hi,

yes I installed the influxDB binding as well.

BTW - is there any way to uninstall influxDB+Grafana? If yes - how?
May then I can run the openahbian-tool again to retry the installation.


(Ron) #15

This is an InfluxDB authentication error. I am not familiar with the openhabian setup but you need to have a user in InfluxDB that has the rights to create databases and usually you have to specify that user on the influx cli. Like this:
influx -port 'xxxx' -username admin -password PASSWORD -host localhost


(MrBurns) #16

@noppes123: Thanks that worked!