Problems installing influxDB

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…

What happens when you use the USE command?

Example:
USE myDB

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.

What do you have in this file?

 /etc/openhab2/services/influxdb.cfg:

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

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!

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

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

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?

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

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.

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…

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?

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.

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

@noppes123: Thanks that worked!

Sorry I tried all these solutions. I’m able to run Grafana with Darksky plugin, no problem, but unable to setup connexion with openhab_db.
First I launched openhabian-config and selected the option to install Grafana with influxdb. Carefully noted the login and password I used. Now in the CLI console, unable to lauch a basic command like SHOW DATABASES, in return I get:ERR: Autorization failed Warning, it is possible this error is due to not setting a database…
I also installed the InfluxDB Persistence in Openhabian. To be clear, I was sure the openhabian-script was doing everything about the rights. Running on Raspberry Pi3+ with latest 2.5.x dev. version.
One point, is the database name created by the script openhab_db? This is not mentioned somewere…
Any help appreciated!
Edit, found solution there InfluxDB+Grafana persistence and graphing

1 Like