Skip to content

Commit

Permalink
fix: catch store error
Browse files Browse the repository at this point in the history
  • Loading branch information
fritterhoff committed Dec 9, 2024
1 parent 7658697 commit d1a1022
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions acme/challenge.go
Original file line number Diff line number Diff line change
Expand Up @@ -1615,8 +1615,17 @@ func storeError(ctx context.Context, db DB, ch *Challenge, markInvalid bool, err
logrus.Warnf("marking challenge %s as invalid: %v", ch.ID, err)
ch.Status = StatusInvalid
}
if err := db.UpdateChallenge(ctx, ch); err != nil {
return WrapErrorISE(err, "failure saving error to acme challenge")
for {
if err := db.UpdateChallenge(ctx, ch); err != nil {
if strings.Contains(err.Error(), "changed since last read") {
// If the challenge has changed since we read it, then we
// don't want to overwrite the error.
logrus.Warn("challenge changed since last read -> retry saving")
continue
}
return WrapErrorISE(err, "failure saving error to acme challenge")
}
break
}
return nil
}

0 comments on commit d1a1022

Please sign in to comment.