resticprofile icon indicating copy to clipboard operation
resticprofile copied to clipboard

"cannot list system units: error decoding JSON" during unschedule

Open 021-projects opened this issue 7 months ago β€’ 4 comments

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

021-projects avatar Jun 10 '25 13:06 021-projects

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

021-projects avatar Jun 10 '25 13:06 021-projects

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 πŸ‘πŸ»

creativeprojects avatar Jun 12 '25 20:06 creativeprojects

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 Image

021-projects avatar Jun 13 '25 11:06 021-projects

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.

creativeprojects avatar Jun 13 '25 18:06 creativeprojects