Installation of InfluxDB aborts via openhabian-config

Hello,

after installation of openHab 3.4.1 package with openhabian on Raspberry pi4 the installation of the optional components InfluxDB an Grafana fails:
“Installing InfluxDB… FAILED”

Debug log contains following:

Err:3 https://repos.influxdata.com/debian bullseye InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D8FF8E1F7DF8B07E
Reading package lists... Done
W: GPG error: https://repos.influxdata.com/debian bullseye InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D8FF8E1F7DF8B07E
E: The repository 'https://repos.influxdata.com/debian bullseye InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

I’m not a linux expert (I’m dependent on openhabian-config) but it seems that the public key is not known.

Any idea to fix it?
Kind regards

Same here

Err:7 https://repos.influxdata.com/debian bullseye InRelease                                                                                                                   
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D8FF8E1F7DF8B07E

Because of an alert ( see CircleCI security alert: Rotate any secrets stored in CircleCI (Updated Jan 13) ) keys were rotated/new ones were created.
To get the new keys onto your system you may follow instructions described at
Update: Linux Package Signing Key Rotation | InfluxData for influxdb and https://packages.grafana.com/oss/ for grafana.

Hi Wolfgang,

thanks for your hints, that sounds simple…

But:
InfluxDB instructions copy&paste via SSH, no errors
Grafana instructions copy&paste via SSH, error at the second command “persmission denied”

Nonetheless started the installation routine in openhabian-config, but I’ve got the same error again:

 There was an error or interruption during the execution of: "20 | Optional Components"   
 
 $ influxdb_install admin [PASSWORD]
+ influxdb_install admin [PASSWORD]
+ local address=http://localhost:8086
+ local adminPassword=[PASSWORD]
+ local adminUsername=admin
+ local keyName=influxdb
+ local myOS
+ local myRelease
+ is_pi
+ is_pifour
+ [[ '' == \p\i\4 ]]
+ grep -q '^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]11[0-9a-fA-F]$' /proc/cpuinfo
+ return 0
+ return 0
+ myOS=debian
++ lsb_release -sc
+ myRelease=bullseye
+ [[ bullseye == \n\/\a ]]
+ influxdb_is_installed
+ dpkg -s influxdb
+ return 1
+ add_keys https://repos.influxdata.com/influxdb.key influxdb
+ local repoKey=/usr/share/keyrings/influxdb.gpg
++ timestamp
++ printf '%(%F_%T_%Z)T\n' -1
+ echo -n '2023-02-11_16:50:36_CET [openHABian] Adding required keys to apt... '
2023-02-11_16:50:36_CET [openHABian] Adding required keys to apt... + curl -fsSL https://repos.influxdata.com/influxdb.key
+ gpg --dearmor
+ echo OK
OK
+ echo 'deb [signed-by=/usr/share/keyrings/influxdb.gpg] https://repos.influxdata.com/debian bullseye stable'
++ timestamp
++ printf '%(%F_%T_%Z)T\n' -1
+ echo -n '2023-02-11_16:50:36_CET [openHABian] Installing InfluxDB... '
2023-02-11_16:50:36_CET [openHABian] Installing InfluxDB... + cond_redirect apt-get update
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ apt-get update \033[39;49;00m'

$ apt-get update
+ apt-get update
Hit:1 http://security.debian.org/debian-security bullseye-security InRelease
Hit:2 http://deb.debian.org/debian bullseye InRelease
Hit:3 http://deb.debian.org/debian bullseye-updates InRelease
Hit:4 http://davesteele.github.io/comitup/repo comitup InRelease
Hit:5 https://repos.influxdata.com/debian stable InRelease
Get:6 https://repos.influxdata.com/debian bullseye InRelease [7,022 B]
Hit:7 https://deb.nodesource.com/node_16.x bullseye InRelease
Hit:8 http://archive.raspberrypi.org/debian bullseye InRelease
Hit:9 https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable InRelease
Err:6 https://repos.influxdata.com/debian bullseye InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D8FF8E1F7DF8B07E
Reading package lists... Done
W: GPG error: https://repos.influxdata.com/debian bullseye InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D8FF8E1F7DF8B07E
E: The repository 'https://repos.influxdata.com/debian bullseye InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
+ return 100
+ echo 'FAILED (update apt lists)'
FAILED (update apt lists)
+ return 1
+ return 1
+ echo FAILED
FAILED

The problem with influxdb installation seems to be that openhabian checks if influxdb is already installed ( dpkg -s influxdb ). If it is not installed then the gpg key is installed/written again. In case the same name is used then it is overwritten.

With regard to grafana error in second command: do you refer to the following one ?

wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor > /etc/apt/keyrings/grafana.gpg

I suggest to do

sudo bash

with provides you with a root shell. Then execute the commands in that shell. Ones finished do exit to return to previous user’s shell.

This is the case with openhabian-config openHAB3 branch. The openhabian-config main branch contains a fix for the changed gpg key.

“sudo bash” and no error for Grafana, thanks.
But if there will be no error at installation I will see after successful installation of InfluxDB.

When openhabian-config ist started, there is no choise between main branch and openHAB3 branch. Maybe I’m blind… :wink:

In openhabian-config I choose “20 | Optional Components” and " 24 | InfluxDB+Grafana".
How to get the openhabian-config main branch, please?

Extract from openHABian | openHAB :

You can switch branches using menu option 01 in openhabian-config but ATTENTION you cannot up- or downgrade this way and you cannot arbitrarily change versions. There’s a high risk you mess up your system if you do.

Menu then looks like:

( ) release  recommended version that supports openHAB 3.x (openHAB3 branch) 
(*) latest   the latest of openHABian, not well tested (main branch) 
( ) legacy   no longer updated, use for openHAB 2.x support (stable branch)

Yes, I was blind…
Entry 01 in openhabian-config changes the branches.
Sorry.

Switched to openhabian main branch, the setup of InfluxDB and grafana is successful!

Thanks a lot!

1 Like

Hello.
I switch the branch to latest in openhabian-config. The InfluxDB has been installed, but grafana is not.
Here is the log:

Creating InfluxDB user grafana
+ cond_redirect curl --user admin:PASSWORD --insecure http://localhost:8086/query --data-u                         rlencode 'q=CREATE USER grafana WITH PASSWORD '\''PASSWORD'\'''
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ curl --user admin:PASSWORD --insecure http://localhost:8086/quer                         y --data-urlencode q=CREATE USER grafana WITH PASSWORD '\''PASSWORD'\'' \033[39;49;00m'

$ curl --user admin:PASSWORD --insecure http://localhost:8086/query --data-urlencode q=CRE                         ATE USER grafana WITH PASSWORD 'PASSWORD'
+ curl --user admin:PASSWORD --insecure http://localhost:8086/query --data-urlencode 'q=CR                         EATE USER grafana WITH PASSWORD '\''PASSWORD'\'''
{"results":[{"statement_id":0}]}
+ return 0
+ cond_redirect curl --user admin:PASSWORD --insecure http://localhost:8086/query --data-u                         rlencode 'q=SET PASSWORD FOR grafana = '\''PASSWORD'\'''
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ curl --user admin:PASSWORD --insecure http://localhost:8086/quer                         y --data-urlencode q=SET PASSWORD FOR grafana = '\''PASSWORD'\'' \033[39;49;00m'

$ curl --user admin:PASSWORD --insecure http://localhost:8086/query --data-urlencode q=SET                          PASSWORD FOR grafana = 'PASSWORD'
+ curl --user admin:PASSWORD --insecure http://localhost:8086/query --data-urlencode 'q=SET PASSWORD FOR grafana = '\''PASSWORD'\'''                         
{"results":[{"statement_id":0}]}
+ return 0
+ cond_redirect curl --user admin:PASSWORD --insecure http://localhost:8086/query --data-u                         rlencode 'q=GRANT READ ON openhab TO grafana'
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ curl --user admin:PASSWORD --insecure http://localhost:8086/quer                         y --data-urlencode q=GRANT READ ON openhab TO grafana \033[39;49;00m'

$ curl --user admin:PASSWORD --insecure http://localhost:8086/query --data-urlencode q=GRA                         NT READ ON openhab TO grafana
+ curl --user admin:PASSWORD --insecure http://localhost:8086/query --data-urlencode 'q=GR               ANT READ ON openhab TO grafana'
{"results":[{"statement_id":0}]}
+ return 0
+ echo OK
OK
++ timestamp
++ printf '%(%F_%T_%Z)T\n' -1
+ echo -n '2023-03-19_09:50:31_MSK [openHABian] Installing Grafana.. '
2023-03-19_09:50:31_MSK [openHABian] Installing Grafana.. + cond_redirect grafana_install 
+ [[ -n '' ]]
+ echo -e '\n\033[90;01m$ grafana_install PASSWORD \033[39;49;00m'

$ grafana_install PASSWORD
+ grafana_install PASSWORD
+ local adminPassword=PASSWORD
+ local keyName=grafana
+ grafana_is_installed
+ dpkg -s grafana
+ return 1
+ add_keys https://packages.grafana.com/gpg.key grafana
+ local repoKey=/usr/share/keyrings/grafana.gpg
++ timestamp
++ printf '%(%F_%T_%Z)T\n' -1
+ echo -n '2023-03-19_09:50:31_MSK [openHABian] Adding required keys to apt... '
2023-03-19_09:50:31_MSK [openHABian] Adding required keys to apt... + curl -fsSL https://packages.gr                         afana.com/gpg.key
+ gpg --dearmor
curl: (22) The requested URL returned error: 403
gpg: no valid OpenPGP data found.
+ echo FAILED
FAILED
+ rm -f /usr/share/keyrings/grafana.gpg
+ return 1
+ return 1
+ return 1
+ echo FAILED
FAILED
+ return 1
+ '[' 1 -ne 0 ']'

The link to grafana site from the message number 2 is not working any more (“Sorry, the provided token is not valid”).
I`m not a Linux user. What should I do? Please help me to install grafana.

That’s strange I would say.
Accessing https://packages.grafana.com/gpg.key using a browser as well as using the curl command that is being used by openhabian-config both work.

I would suggest to try it again.

If that fails again try:

sudo bash
curl -fsSL https://packages.grafana.com/gpg.key | gpg --dearmor > /usr/share/keyrings/grafana.gpg

Although I would expect this then also to fail again as it is the same command that is used in openhabian-config.

You then also require to execute following command in the same root shell:

echo "deb [signed-by=/usr/share/keyrings/grafana.gpg] https://packages.grafana.com/oss/deb stable main" > /etc/apt/sources.list.d/grafana.list

That’s the problem: Grafana Labs’ enterprise binaries are subject to export regulations and are not made available in Russia.

1 Like

Hi
i have the same Problem as OP but i cannot change to the main Branch.
I also got the new keys wich seemd to work but didn’t change anything.

[openHABian] Updating myself... mv: cannot stat '/opt/openhabian/docs/NEWS.md': No such file or directory
OK - No remote changes detected. You are up to date!

I also got the new keys wich seemd to work but didn’t change anything. Also i am running Openhabian on a Pi4 and am trying to install InfluxDB & Grafana for the first time.

ok seems like updating the keys didn’t work as i get the following error when trying to install just InfluxDB:

Err:2 http://davesteele.github.io/comitup/repo comitup InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0959C4A3DCF89FBF
Err:8 https://repos.influxdata.com/debian bullseye InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D8FF8E1F7DF8B07E
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://davesteele.github.io/comitup/repo comitup InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0959C4A3DCF89FBF
W: GPG error: https://repos.influxdata.com/debian bullseye InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D8FF8E1F7DF8B07E
E: The repository 'https://repos.influxdata.com/debian bullseye InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

i tried doing at as in the official documentation as well as with in the bash shell. any ideas or more hints?

based on the error message I have the impression that the old keys are still in use.

What is the output of following script being executed on your pi:

for i in `grep -l influx /etc/apt/sources.list.d/*`; do echo $i:; cat $i; echo; done

thank you for your response i eventually was able to install it but not quit sure what the issue was.

1 Like