Safeguard against already existing _acme-challenge records#6
Conversation
|
I'm not a fan of cleaning up other potential sources of Also, cleaning up immediately after failure wouldn't be robust since a system reboot (or taking down a container, if it's in a container) would prevent a post-failure cleanup from running. I think a better way might be to save a temporary file remembering which |
|
I cannot accept the PR as is - code should use tabs as the rest, and it should cache the result of list_record_id into a variable rather than calling twice. |
I noticed that sometimes my renewal would fail, either because of a timeout or something else. In these cases, the
_acme-challengerecord wouldn't be cleaned up and then any future runs of the renewal would then fail because the record already exists (ERROR: Response: {"result":null,"success":false,"errors":[{"code":81057,"message":"Record already exists."}],"messages":[]})This adds a simple check to see if the record already exists, and deletes it if it does. I considered trying to clean up after failure instead, but this actually catches other potential sources of
_acme-challenge, such as if multiple tools are used.