Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
seqizz opened this issue Dec 16, 2020 · 0 comments · Fixed by #3207
Closed

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

seqizz opened this issue Dec 16, 2020 · 0 comments · Fixed by #3207

Comments

@seqizz
Copy link

seqizz commented Dec 16, 2020

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 👑

aawsome added a commit to aawsome/restic that referenced this issue Jan 31, 2021
MichaelEischer added a commit that referenced this issue Jan 31, 2021
mfrischknecht pushed a commit to mfrischknecht/restic that referenced this issue Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@seqizz @MichaelEischer and others