Commit 20cde0e5 authored by ale's avatar ale
Browse files

Ignore restic exit status code 3

Restic returns 3 when some of the files it found disappeared while
taking the backup. This is normal since we're not actually taking
static filesystem snapshots, and the restic backup is still properly
created, so we can just ignore it.
parent 295214b9
Pipeline #29176 passed with stages
in 3 minutes and 34 seconds
......@@ -449,7 +449,7 @@ type resticMessage struct {
// backup/dataset objects.
func (r *resticRepository) runBackupCmd(ctx context.Context, shell *Shell, backup *Backup, ds *Dataset, cmd string) error {
return active.WithResticStatus(jobs.GetID(ctx), backup, ds, func(progressCh chan *resticStatusMessage) error {
return shell.RunWithStdoutCallback(ctx, cmd, func(line []byte) {
err := shell.RunWithStdoutCallback(ctx, cmd, func(line []byte) {
var msg resticMessage
if err := json.Unmarshal(line, &msg); err != nil {
GetLogger(ctx).Printf("error parsing restic JSON message: %v (%s)", err, line)
......@@ -467,6 +467,12 @@ func (r *resticRepository) runBackupCmd(ctx context.Context, shell *Shell, backu
ds.Duration = int(msg.TotalDuration)
}
})
var exitErr *exec.ExitError
if errors.As(err, &exitErr) && exitErr.ExitCode() == 3 {
// We can safely ignore exit status 3 from restic.
err = nil
}
return err
})
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment