Grafana update error

in the latest dietpi-update, this error comes up:

Get:1 https://apt.grafana.com stable/main arm64 grafana arm64 13.1.1 [282 MB]
Fetched 282 MB in 49s (5,710 kB/s)
(Reading database ... 63686 files and directories currently installed.)
Preparing to unpack .../grafana_13.1.1_arm64.deb ...
Unpacking grafana (13.1.1) over (13.1.0) ...
Setting up grafana (13.1.1) ...
mv: inter-device move failed: '/usr/share/grafana/data/plugins-bundled' to '/var/lib/grafana/plugins-bundled'; unable to remove target: Directory not empty
dpkg: error processing package grafana (--configure):
 installed grafana package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 grafana

This is DietPi v10.5.2. I saw that the /var/lib/grafana/plugins-bundled/ was owned by root and changed it (recursively) to grafana:grafana to match the other folders in that area, but that didn’t fix it - the same error re-appears on the next dietpi-update run.

The previous install is still working fine, so it’s no big deal. Just wanted to report this …

-jcw

PS. /mnt/dietpi_userdata is mounted on a different partition, perhaps that’s the issue here.

This has literally nothing to do with DietPi. Grafana is installed from its own package repository. This is out of our control as we don’t manage nor maintain Grafana. There might be an issue with the package released by Grafana

There you go Debian postinst script : upgrading is broken · Issue #128983 · grafana/grafana · GitHub

It will be fixed in Grafana 13.1.2

A workaround has been provided by on of the Grafana maintainer

sudo rm -rf /var/lib/grafana/plugins-bundled
sudo dpkg --configure -a

See also here, in the PR which introduced the bug: Build: Move plugins-bundled to writeable directory in rpm, deb by njvrzm · Pull Request #125080 · grafana/grafana · GitHub

Good to see a PR up to solve it. But uff, this is an ugly hack to mv away packaged files. A true/cleaner solution, that would be accepted as well by distros (unlike #128983), was suggested already, but it requires a bit more work.