autorestic icon indicating copy to clipboard operation
autorestic copied to clipboard

Running `autorestic check` breaks the YAML file by adding invalid parameters

Open ResponsiblyUnranked opened this issue 1 year ago • 3 comments

Describe the bug When I run autorestic check after creating a new backend (in order to initialise the backend) it modifies my ~/.autorestic.yml file and breaks the syntax. After running it, if I run check a second time I get:

3 error(s) decoding:

* 'locations[apps]' has invalid keys: forgetoption
* 'locations[jellyfin-config]' has invalid keys: forgetoption
* 'locations[jellyfin-media]' has invalid keys: forgetoption
Could not parse config file!

I did not add this forgetoption to my locations and the issue seems resolved when I remove it. Autorestic seems to add it to every location (amongst other properties), for example:

  jellyfin-config:
    from:
    - jellyfin-config
    type: volume
    to:
    - local-config
    - backblaze
    - local-two
    hooks:
      dir: ""
      prevalidate: []
      before: []
      after: []
      success: []
      failure: []
    cron: ""
    options: {}
    forgetoption: ""
    copyoption: {}

It's that forgetoption: "" which autorestic check is adding, and then causing problems with.

Before running autorestic check all that I had was:

  jellyfin-config:
    from: jellyfin-config
    type: volume
    to: backblaze

Expected behavior Running autorestic check should not break the YAML file I have already created. I also find it strange that it adds loads of empty parameters. Is it possible to not do this, as the config file is much smaller and easier to work with, as I only need a barebones setup.

Environment

  • Ubuntu 24.04.1 LTS
  • Autorestic Version 1.8.3

Additional context It seems to happen whenever I create a new backend and then run autorestic check.

ResponsiblyUnranked avatar Feb 09 '25 15:02 ResponsiblyUnranked

Exactly the same issue here, check seems to modify the configuration file and adding invalid parameters like the mentioned forgetoption. It happens when running check after adding a second backend, no matter if the configuration is correct or now.

waza-ari avatar Feb 19 '25 14:02 waza-ari

The fix for this is actually already merged in #402 , but it's not in a release yet, so you'll need to build it yourself in order to take advantage of it.

faekiva avatar Apr 24 '25 05:04 faekiva

This is still the same for me. When will a new release be coming?

lr101 avatar Oct 04 '25 09:10 lr101

Any update on this issue?

clemwo avatar Dec 07 '25 22:12 clemwo