garethgeorge / backrest

Backrest is a web UI and orchestrator for restic backup.
GNU General Public License v3.0
1.04k stars 34 forks source link

backup fails when using rclone protondrive backend invalid JSON #179

Closed ArjenR closed 5 months ago

ArjenR commented 5 months ago

I want to use the rclone backend for protondrive. I am not using rclone for another backend so cannot compare.

The repository initializes well. But backups fail. I run backrest from a podman container. The backup does work when running restic from a shell within the container.

Message:

ERROR   task failed     {"task": "onetime backup for plan \"proxmox\"", "error": "repo.Backup for repo \"proxmox_proton\": failed to get snapshots for plan: get snapshots for plan \"proxmox\": command \"/usr/bin/restic snapshots --json --tag plan:proxmox\" failed: command output is not valid JSON: invalid character 'd' looking for beginning of value\nProcess STDOUT: \ndebug log file /tmp/restic-debug.log\ndebug enabled\n[]\n", "duration": "27.010880632s"}
backrest    | 2024-03-25T22:31:19.612Z  INFO    Applying config to orchestrator, waiting for task queue reset.

JSON config of repository:

{
  "id": "proton",
  "uri": "rclone:pdrive:restic/proton1",
  "password": "xx",
  "prunePolicy": {
    "maxFrequencyDays": 7,
    "maxUnusedPercent": 25
  }
}

JSON config of the job:

{
  "id": "proton1",
  "repo": "proton",
  "paths": [
    "/source/mysource/"
  ],
  "excludes": [],
  "iexcludes": [],
  "cron": "3 * * *",
  "retention": {
    "policyTimeBucketed": {
      "yearly": 0,
      "monthly": 3,
      "weekly": 4,
      "daily": 7,
      "hourly": 24
    }
  },
  "disabled": true
}

backrest version: 0.15.1 rclone version:

rclone v1.66.0-DEV
- os/version: alpine 3.19.1 (64 bit)
- os/kernel: 6.5.13-3-pve (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.22.1
- go/linking: dynamic
- go/tags: none

restic version: 0.16.4 compiled with go1.22.1 on linux/amd64

Might be related to the similar issue for which a fix was made in 0.15.1 and the issue below:

Hey, thanks for documenting your path debugging this. I think backrest used to set ssh -o "BatchMode yes" as one of the options which minimizes log level for SSH and causes the process to fail immediately if no key is found (instead of dropping into an interactive mode).

Originally posted by @garethgeorge in https://github.com/garethgeorge/backrest/issues/165#issuecomment-2018656486

garethgeorge commented 5 months ago

Are you running a debug build of restic (or are you setting debug env vars?)? https://restic.readthedocs.io/en/latest/090_participating.html

ArjenR commented 5 months ago

Yes, I used DEBUG_LOG to analyze the error toast messages I had popping up on the 1st backup. This should write the messages only to the log file?

Anyway, I just did another test to reproduce my issue. But cannot reproduce. So closing this issue.