diff --git a/acme/db/nosql/account.go b/acme/db/nosql/account.go index a0a43ffd..864ab119 100644 --- a/acme/db/nosql/account.go +++ b/acme/db/nosql/account.go @@ -222,9 +222,13 @@ func (db *DB) GetExternalAccountKey(ctx context.Context, provisionerName string, } func (db *DB) DeleteExternalAccountKey(ctx context.Context, keyID string) error { - err := db.db.Del(externalAccountKeyTable, []byte(keyID)) + _, err := db.db.Get(externalAccountKeyTable, []byte(keyID)) if err != nil { - return errors.Wrapf(err, "error deleting ACME EAB Key with Key ID: %s", keyID) + return errors.Wrapf(err, "error loading ACME EAB Key with Key ID %s", keyID) + } + err = db.db.Del(externalAccountKeyTable, []byte(keyID)) + if err != nil { + return errors.Wrapf(err, "error deleting ACME EAB Key with Key ID %s", keyID) } return nil }