Update/upgrade grafana

Probably because you need to follow all the instructions here. Anybody looking at this later should go to that link, but here is what it has now for the OSS release:

sudo apt-get install -y apt-transport-https
sudo apt-get install -y software-properties-common wget
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -

# Alternatively you can add the beta repository, see in the table above
sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"

sudo apt-get update
sudo apt-get install grafana

But I don’t think that will change your problem. You only have Grafana server, right? Could the IP address you have point to the wrong/different server?

Do you see any messages in /var/log/syslog or /var/log/grafana/grafana.log that indicate the version as it starts up?

1 Like

@jswim788:
Thank you for your helpfulness and patience.

I use only one rpi as server with the openhabian distribution and grafana. For openhab and grafana I use the same IP-Adress. Only the port is chanched.

No, unfortunality I don’t see nothing that idicate the version of grafana.

When I use the command (link)

grafana-cli -v

I get the massages

Grafana cli version 6.6.1

It is possible that I have installed on my rpi to versions of grafana (old and new) because on the one site the installation of the new version of grafana is completed and on the other site I see on my browser the old version of grafana?
what could I do now? :thinking:

Sorry, I’m not an expert with linux. How can I delete the message or rather correct the installationspaket of grafana. I get this message:

Thank you!

What do you see if you type this?

systemctl status grafana-server

Something like this?

● grafana-server.service - Grafana instance
   Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2020-03-22 19:39:36 PDT; 5 days ago
     Docs: http://docs.grafana.org
 Main PID: 1379 (grafana-server)
    Tasks: 11 (limit: 4139)
   CGroup: /system.slice/grafana-server.service
           └─1379 /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini --pidfile=/var/run/grafana/grafana-server.pid --packaging=deb cfg:default.paths.logs=/var/log/grafana cfg:default.p

If the last line is similar, type this and see what you get for the version:

/usr/sbin/grafana-server -v

What I see is:

Version 6.7.1 (commit: ca6d08d5cb, branch: HEAD)

Let’s see if that gives a clue.

If you think you may have two versions running try running:

ps axx | grafana

(copy and paste that command).
If you get two versions of /usr/sbin/grafana-server showing then you may have two installations.

Hello!

I get the message:

[10:32:53] openhabian@openhab:~$ /usr/sbin/grafana-server -v
Version 6.6.1 (commit: 21bf8b71bc, branch: HEAD)

When I copy and paste your command I get the message:

[10:35:52] openhabian@openhab:~$ ps axx | grafana
-bash: grafana: command not found

Sorry my bad.
It should be

ps axx | grep grafana

No problem.
I get this message:

[11:42:58] openhabian@openhab:~$ ps axx | grep grafana
427 ? Ssl 7:23 /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini --pidfile=/var/run/grafana/grafana-server.pid --packaging=deb cfg:default.paths.logs=/var/log/grafana cfg:default.paths.data=/var/lib/grafana cfg:default.paths.plugins=/var/lib/grafana/plugins cfg:default.paths.provisioning=/etc/grafana/provisioning
16050 pts/0 S+ 0:00 grep --color=auto grafana

That suggests that you only have the one installation of grafana which is good.
If you are getting
Grafana cli version 6.6.1

then maybe uninstall grafana and try a re-install:

sudo apt-get purge grafana

and then re-install with

sudo apt-get update
sudo apt-get install grafana

Thank you for your helpfulness!

Yes, I think the same.
It’s only strange that I get this answer when I enter this command:

Somewhere are files from the new version of grafana on my system…

This command

will remove all config files and give you a clean start when you re-install.

@robb01:
I’m without words.
Now I have done:

[11:47:31] openhabian@openhab:~$ sudo apt-get purge grafana
[sudo] password for openhabian:
Sorry, try again.
[sudo] password for openhabian:
Sorry, try again.
[sudo] password for openhabian:
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages will be REMOVED:
grafana*
0 upgraded, 0 newly installed, 1 to remove and 5 not upgraded.
After this operation, 105 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database … 50524 files and directories currently installed.)
Removing grafana (6.7.1) …
(Reading database … 50186 files and directories currently installed.)
Purging configuration files for grafana (6.7.1) …
Updating FireMotD available updates count …
[14:41:52] openhabian@openhab:~$ sudo apt-get purge grafana
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package ‘grafana’ is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
[14:42:16] openhabian@openhab:~$ sudo apt-get update
Hit:1 http://archive.raspberrypi.org/debian buster InRelease
Get:2 https://packages.grafana.com/oss/deb stable InRelease [12.1 kB]
Ign:3 https://dl.bintray.com/openhab/apt-repo2 stable InRelease
Hit:4 https://repos.influxdata.com/debian buster InRelease
Get:5 https://dl.bintray.com/openhab/apt-repo2 stable Release [6,051 B]
Err:2 https://packages.grafana.com/oss/deb stable InRelease
The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 8C8C34C524098CB6
Err:7 http://raspbian.raspberrypi.org/raspbian buster InRelease
Cannot initiate the connection to raspbian.raspberrypi.org:80 (2a00:1098:0:80:1000:75:0:3). - connect (101: Network is unreachable) Could not connect to ra spbian.raspberrypi.org:80 (93.93.128.193), connection timed out
Reading package lists… Done
W: GPG error: https://packages.grafana.com/oss/deb stable InRelease: The following signatures couldn’t be verified because the public key is not available: N O_PUBKEY 8C8C34C524098CB6
E: The repository ‘https://packages.grafana.com/oss/deb stable 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.
[14:43:37] openhabian@openhab:~$ sudo apt-get install -y apt-transport-https
Reading package lists… Done
Building dependency tree
Reading state information… Done
apt-transport-https is already the newest version (1.8.2).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
[14:46:54] openhabian@openhab:~$ sudo apt-get install -y software-properties-common wget
Reading package lists… Done
Building dependency tree
Reading state information… Done
software-properties-common is already the newest version (0.96.20.2-2).
wget is already the newest version (1.20.1-1.1).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
[14:46:57] openhabian@openhab:~$ wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
OK
[14:47:22] openhabian@openhab:~$ sudo add-apt-repository “deb https://packages.grafana.com/oss/deb stable main”
Traceback (most recent call last):
File “/usr/bin/add-apt-repository”, line 95, in
sp = SoftwareProperties(options=options)
File “/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py”, line 109, in init
self.reload_sourceslist()
File “/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py”, line 599, in reload_sourceslist
self.distro.get_sources(self.sourceslist)
File “/usr/lib/python3/dist-packages/aptsources/distro.py”, line 93, in get_sources
(self.id, self.codename))
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Raspbian/buster
[14:47:37] openhabian@openhab:~$ sudo apt-get update
Get:1 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Ign:2 https://dl.bintray.com/openhab/apt-repo2 stable InRelease
Get:3 https://dl.bintray.com/openhab/apt-repo2 stable Release [6,051 B]
Hit:4 https://repos.influxdata.com/debian buster InRelease
Hit:5 http://archive.raspberrypi.org/debian buster InRelease
Get:6 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages [13.0 MB]
Err:8 https://packages.grafana.com/oss/deb stable InRelease
Cannot initiate the connection to packages.grafana.com:443 (2a04:4e42:39::729). - connect (101: Network is unreachable) Could not connect to packages.grafa na.com:443 (151.101.242.217), connection timed out
Fetched 13.0 MB in 30s (429 kB/s)
Reading package lists… Done
W: Failed to fetch https://packages.grafana.com/oss/deb/dists/stable/InRelease Cannot initiate the connection to packages.grafana.com:443 (2a04:4e42:39::729 ). - connect (101: Network is unreachable) Could not connect to packages.grafana.com:443 (151.101.242.217), connection timed out
W: Some index files failed to download. They have been ignored, or old ones used instead.
[14:48:26] openhabian@openhab:~$ sudo apt-get update
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Get:3 https://packages.grafana.com/oss/deb stable InRelease [12.1 kB]
Hit:4 https://repos.influxdata.com/debian buster InRelease
Ign:5 https://dl.bintray.com/openhab/apt-repo2 stable InRelease
Get:6 https://dl.bintray.com/openhab/apt-repo2 stable Release [6,051 B]
Get:7 https://packages.grafana.com/oss/deb stable/main armhf Packages [15.0 kB]
Fetched 21.1 kB in 2s (9,759 B/s)
Reading package lists… Done
[14:49:14] openhabian@openhab:~$ sudo apt-get install grafana
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following NEW packages will be installed:
grafana
0 upgraded, 1 newly installed, 0 to remove and 6 not upgraded.
Need to get 35.6 MB of archives.
After this operation, 105 MB of additional disk space will be used.
Get:1 https://packages.grafana.com/oss/deb stable/main armhf grafana armhf 6.7.1 [35.6 MB]
Fetched 35.6 MB in 14s (2,525 kB/s)
Selecting previously unselected package grafana.
(Reading database … 50186 files and directories currently installed.)
Preparing to unpack …/grafana_6.7.1_armhf.deb …
Unpacking grafana (6.7.1) …
Replaced by files in installed package grafana-rpi (6.6.1) …
Setting up grafana (6.7.1) …

NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd

sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable grafana-server

You can start grafana-server by executing

sudo /bin/systemctl start grafana-server
Processing triggers for systemd (241-7~deb10u3+rpi1) …
Updating FireMotD available updates count …
[14:50:17] openhabian@openhab:~$ sudo systemctl enable grafana-server
Synchronizing state of grafana-server.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable grafana-server
[14:58:27] openhabian@openhab:~$ sudo systemctl start grafana-server
[14:59:20] openhabian@openhab:~$ /usr/sbin/grafana-server -v
Version 6.6.1 (commit: 21bf8b71bc, branch: HEAD)

[15:10:15] openhabian@openhab:~$ sudo /bin/systemctl daemon-reload
[sudo] password for openhabian:
[15:11:44] openhabian@openhab:~$ sudo /bin/systemctl enable grafana-server
Synchronizing state of grafana-server.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable grafana-server
[15:11:59] openhabian@openhab:~$ sudo /bin/systemctl start grafana-server
[15:12:19] openhabian@openhab:~$ /usr/sbin/grafana-server -v
Version 6.6.1 (commit: 21bf8b71bc, branch: HEAD)

Even after a rebbot i get with the command

/usr/sbin/grafana-server -v
allways the same answer.

Version 6.6.1 (commit: 21bf8b71bc, branch: HEAD)

Hello guys,
Does nobody have a possible solution?
Thank you for your support!

It seems this is where your problem lies. It looks to me like the config files are being over-written by this earlier installation. I haven’t previously come across grafana-rpi.

I would do something like

sudo find / -iname \grafana-rpi

and see if you can find any config or cfg files.

Has anybody upgraded to 7.0 yet? I tried installing via dpkg but the service didn’t start. I was able to revert to 6.6.2 without issues though…
This is what I tried:
sudo apt-get install -y adduser libfontconfig1
wget https://dl.grafana.com/oss/release/grafana_7.0.0_armhf.deb
sudo dpkg -i grafana_7.0.0_armhf.deb

I’m on a RPi, during upgrade (via “openhabian-config”) from 2.5.4 to 2.5.5 I got grafana 7.0.0 without any problem.

In my case updating openHAB from 2.5.3 to 2.5.5 my RPi via openhabian-config Grafana does not start any more (it was also updatet to v7.0).

If I call grafana-cli (or grafana-server) manually on console I get also following error:
/usr/share/grafana/bin/grafana-cli: /lib/arm-linux-gnueabihf/libc.so.6: version 'GLIBC_2.28' not found (required by /usr/share/grafana/bin/grafana-cli)

I also tried to solve it by updating core libs:
sudo apt-get dist-upgrade

No success.

I’m on a Pi4B, updated via 02 “Upgrade all installed software packages to their newest version”
I remember that I got a warning during update from 2.5.3 to 2.5.4 that a grafana setting file would be overwritten, I skipped that and stayed so on grafana 6.x.
Last update on 2.5.5 was then flawless without any warning or so.

are you running Stretch or Buster? Maybe you need to get to Buster if you don’t have it? That’s just a guess - I don’t have a way to test this theory.

Yes, I still use Stretch. That is a good point. I will try to switch to Buster.
But I think on the other hand Grafana then should stop update to version 7 on Stretch …

Edit: after upgrade to Buster (using this how-to: http://baddotrobot.com/blog/2019/08/29/upgrade-raspian-stretch-to-buster/) Grafana 7.0 works again!

As confirmed here, it is a stretch issue.
Our friends at Domoticz were hit hard by this (Domoticz stopped working and they needed upgrading to Buster to get it working again after an automatic update of Domoticz).
Someone over there did find a solution to still make it work on Stretch: https://www.domoticz.com/forum/viewtopic.php?f=6&t=31157&start=180#p240741.
I followed these instructions and have Grafana 7.0.0 running again on an RPi 3B+ with Stretch.