Autorestic could not read config from restic REST server - whom's't've to blame? Except me #421
-
ResticI setup a ---
services:
restic_rest_server:
image: restic/rest-server:latest
container_name: restic_rest_server
volumes:
- ./data:/data
env_file:
- .env
ports:
- "127.0.0.1:${PORT}:8000"
networks:
- somenetwork
networks:
somenetwork: and PASSWORD_FILE = "/data/.htpasswd"
PORT = 8010
OPTIONS = "--debug --log /data/log.txt" The Autorestic
version: 2
locations:
home_user:
from: /home/user
to:
- somehost
backends:
somehost:
type: rest
path: http://sub.example.tld:22002/
rest:
user: user
password: password After I launch check to initialize repository, it gets error: $kenyawest: ~ ❯ sudo ./backup-restic-node/autorestic/scripts/check.sh
Using config: /home/user/backup-restic-node/autorestic/config/.autorestic.yaml
Using env: /home/user/backup-restic-node/autorestic/config/.autorestic.env
1 error(s) decoding:
* 'locations[home_user]' has invalid keys: forgetoption
Could not parse config file!
Using lock: /home/user/backup-restic-node/autorestic/config/.autorestic.lock.yml And also config is being changed from original state to this: Details
backends:
somehost:
type: rest
path: http://sub.example.tld:22002/
key: key
requirekey: false
env: {}
rest:
user: user
password: password
options: {}
locations:
home_user:
from:
- /home/user
type: ""
to:
- somehost
hooks:
dir: ""
prevalidate: []
before: []
after: []
success: []
failure: []
cron: ""
options: {}
forgetoption: ""
copyoption: {}
version: 2 - but I guess it is OK. I try to backup: $kenyawest: ~ ❯ sudo ./backup-restic-node/autorestic/scripts/update.sh
Using config: /home/kenyawest/backup-restic-node/autorestic/config/.autorestic.yaml
Using env: /home/kenyawest/backup-restic-node/autorestic/config/.autorestic.env
Using lock: /home/kenyawest/backup-restic-node/autorestic/config/.autorestic.lock.yml
Backing up location "home_user"
Backend: somehost
> Executing: /usr/local/bin/restic backup --tag ar:location:home_user /home/user
Fatal: repository does not exist: unable to open config file: <config/> does not exist
Is there a repository at the following location?
rest:http://user:***@sub.example.tld:22002/
home_user@somehost:
Fatal: repository does not exist: unable to open config file: <config/> does not exist
Is there a repository at the following location?
rest:http://user:***@sub.example.tld:22002/
exit status 10
Error: 1 errors were found OthersThe
Which tool to blame for autorestic errors? Which config is not OK or am I doing it wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Nevermind, solved. Run: yq eval 'del(.locations[].forgetoption | select(. == "")) | del(.locations[].copyoption | select(length == 0))' config/.autorestic.yaml > config/.autorestic.yaml.tmp && mv config/.autorestic.yaml.tmp config/.autorestic.yaml - command to remove This code line uses Track this issue on |
Beta Was this translation helpful? Give feedback.
Nevermind, solved.
Run:
- command to remove
locations[your_location].forgetoption
andlocations[your_location].copyoption
props that are causing'locations[home_user]' has invalid keys: forgetoption
error.This code line uses
yq
package that should be installed. And this line does not make any backup copy. Instead, it rewrites the.autorestic.yaml
file, So change it accordingly if you need to keep original version of autorestic config file.Track this issue on
forgetoption