Skip to content

Restic exits with 0 even if it can't restore correctly #3166

@seqizz

Description

@seqizz

Hi there,

When we have some missing data blobs on the repository, restic seems to warn about those (printing lots of Load(<data/2486c65d8a>, 4491108, 0) returned error, retrying after 26.852531934s: The specified key does not exist. on the process) but still returns with exitcode 0. Which makes it way harder to use in a scripting environment, since it makes output parsing a requirement.

I am aware this is related to #956 , but reporting since this doesn't even honor the "exit code 0 is OK" rule which Linux has (not sure if restic adopts this too, but I hope we do).

Output of restic version

Built from latest master:
restic 0.11.0 (2020-11-06-161-g1cdd38d9) compiled with go1.15.5 on linux/amd64

How did you run restic exactly?

restic restore --cache-dir /opt/restic_local_cache -t /opt/backup -i "/backup/*" 13c825ec

What backend/server/service did you use to store the repository?

Minio

Expected behavior

Exit with non-0 status

Actual behavior

...
Load(<data/24645f36f4>, 5259517, 0) returned error, retrying after 19.899856888s: The specified key does not exist.
ignoring error for /backup/postgres_dir/my_database/7040.dat.gz: UtimesNano: no such file or directory
There were 1 errors
~> echo $?
0

Steps to reproduce the behavior

  • Backup
  • Remove some data blobs on storage
  • Try to restore that snapshot

Did restic help you today? Did it make you happy in any way?

Don't even ask. You're 👑

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions