Upgrade grafana from version 8.1.X to a newer version

Hello,

I try to update an installation of grafana under ubuntu but I encounter problems.

Operating system : Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-194-generic x86_64).
Grafana version : OSS 8.1.1 (from repo).

I managed to upgrade grafana from version 8.1.1 to version 8.1.8 but then I have problems.
Note that I tried to upgrade to version 8.2, 8.3, 8.5, 9.0 and 9.1 but it never worked.
Note that to upgrade from 8.1.1 to 8.1.8 I had to use the command :

sudo setcap 'cap_net_bind_service=+ep' /usr/sbin/grafana-server

In fact to upgrade to a new version now, the web server is not starting, see the resutlt of the command :

Server@Server-grafana-02:~$ sudo systemctl status grafana-server
● grafana-server.service - Grafana instance
   Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; enabled; vendor preset: enabled)
   Active: failed (Result: signal) since Thu 2022-10-13 17:36:45 CEST; 7s ago
     Docs: http://docs.grafana.org
  Process: 21292 ExecStart=/usr/sbin/grafana-server --config=${CONF_FILE} --pidfile=${PID_FILE_DIR}/grafana-server.pid --packaging=deb cfg:default.paths.logs=${LOG_DIR} cfg:default.paths.data=${DATA_DIR} cfg:d
 Main PID: 21292 (code=killed, signal=SYS)

oct. 13 17:36:45 Server-grafana-02 systemd[1]: grafana-server.service: Service hold-off time over, scheduling restart.
oct. 13 17:36:45 Server-grafana-02 systemd[1]: grafana-server.service: Scheduled restart job, restart counter is at 5.
oct. 13 17:36:45 Server-grafana-02 systemd[1]: Stopped Grafana instance.
oct. 13 17:36:45 Server-grafana-02 systemd[1]: grafana-server.service: Start request repeated too quickly.
oct. 13 17:36:45 Server-grafana-02 systemd[1]: grafana-server.service: Failed with result 'signal'.
oct. 13 17:36:45 Server-grafana-02 systemd[1]: Failed to start Grafana instance.
lines 1-13/13 (END)

See the log in the file grafana.log just after the uprgade :

sudo cat /var/log/grafana/grafana.log

t=2022-10-13T17:36:23+0200 lvl=info msg="Shutdown started" logger=server reason="System signal: terminated"

Also after the upgrade I do the command below an see the result :

sudo setcap 'cap_net_bind_service=+ep' /usr/sbin/grafana-server
sudo getcap /usr/sbin/grafana-server
/usr/sbin/grafana-server = cap_net_bind_service+ep

Is there anything special to do to upgrade to 8.1.X to higher versions?
Are there any other logs to look at or commands to execute in order to better understand what is going on?

I know that my distribution is not recent, I have to update it too but I do not think that my problem comes from there, I tried to pass granular updates for grafana with the commands below to try to manage version upgrades (so as not to go from version 8.1.1 to version 9.1.8), I also tried to update the distro + grafana at the same time but it didn’t work either.

sudo apt install grafana=8.2.2
sudo apt install grafana=8.5.13
sudo apt install grafana=9.1.8

Thanks

Hi,

I answer myself.
Apparently to solve the problem one could replace the file /usr/lib/systemd/system/grafana-server.service of the higher version (8.2.X for example) with the version of the file of a version 8.1.X (the 8.1.7 for example).
I’m testing this and I’ll let you know.

Hi,

For information, the issue was solved by use the old file “/usr/lib/systemd/system/grafana-server.service”, I just copied it before the upgrade an replace the new one with my copy.
I don’t know if it’s good in time but for the moment it works…