"cannot list system units: error decoding JSON" during unschedule
OS: AlmaLinux 8.10 (Cerulean Leopard)
$ resticprofile unschedule
2025/06/10 15:09:31 using configuration file: profiles.toml
2025/06/10 15:09:32 cannot list system units: error decoding JSON: invalid character 'U' looking for beginning of value
tion of SUB.
SUB = The low-level unit activation state, values depend on unit type.
2 loaded units listed.
To show all installed unit files use 'systemctl list-unit-files'.
2025/06/10 15:09:32 cannot list user units: error decoding JSON: json: cannot unmarshal number into Go value of type []schedule.SystemdUnit
2025/06/10 15:09:32 no scheduled jobs found
The issue was introduced in version 0.30.0 (https://github.com/creativeprojects/resticprofile/commit/8d8a0dac43b9023d951272ea95c0703b79207fd5)
AlmaLinux 8.10, unlike Almalinux 9.6, does not output a list of units in json format (tested on two servers). This version seems to ignore the output flag altogether.
Workaround until fix is ββreleased: roll back to version 0.29.1
I didn't realise some maintained distributions would still use such an old version of systemd π€·ββ
(Actually I just noticed that the prehistoric Amazon Linux 2 has the same issue)
For what I remember, json output for list-units was introduced some time in 2020 π It was apparently released between versions 239 and 252 https://repology.org/project/systemd/versions
I'll install the distribution in a VM and see what I can do ππ»
I didn't realise some maintained distributions would still use such an old version of
systemdπ€·ββ (Actually I just noticed that the prehistoric Amazon Linux 2 has the same issue)For what I remember, json output for list-units was introduced some time in 2020 π It was apparently released between versions 239 and 252 https://repology.org/project/systemd/versions
I'll install the distribution in a VM and see what I can do ππ»
What's interesting is that JSON output is actually stated in the systemctl help, but systemctl doesn't respond to the --output flag, no matter what value you specify
They've introduced the options against the different tools one at a time. Like journalctl got it first, then some commands of systemctl.
Actually they haven't converted the output of all subcommands yet.