Let’s Encrypt stopped working in my Home Assistant with traceback

I’ve been running the Let’s Encrypt add-on for a while. I noticed that I was getting a cert error and found that the cert wasn’t renewed automatically even though it is configured to do so. I started the let=s encrypt add on manually and there are traceback errors. My settings haven’t changed:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/file-structure.sh
cont-init: info: /etc/cont-init.d/file-structure.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun lets-encrypt (no readiness notification)
s6-rc: info: service legacy-services successfully started
[08:55:59] INFO: Selected DNS Provider: dns-cloudflare
[08:55:59] INFO: Use propagation seconds: 60
[08:55:59] INFO: Use CloudFlare token
Traceback (most recent call last):
File “/usr/local/bin/certbot”, line 5, in
from certbot.main import main
File “/usr/local/lib/python3.9/site-packages/certbot/main.py”, line 6, in
from certbot._internal import main as internal_main
File “/usr/local/lib/python3.9/site-packages/certbot/_internal/main.py”, line 27, in
from certbot import configuration
File “/usr/local/lib/python3.9/site-packages/certbot/configuration.py”, line 10, in
from certbot import util
File “/usr/local/lib/python3.9/site-packages/certbot/util.py”, line 27, in
from certbot._internal import constants
File “/usr/local/lib/python3.9/site-packages/certbot/_internal/constants.py”, line 6, in
import pkg_resources
File “/usr/local/lib/python3.9/site-packages/pkg_resources/init.py”, line 32, in
import plistlib
File “/usr/local/lib/python3.9/plistlib.py”, line 61, in
ValueError: source code string cannot contain null bytes
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

My config for the add-on:

domains:
  - redacted
  - redacted
email: redacted
keyfile: privkey.pem
certfile: fullchain.pem
challenge: dns
dns:
  provider: dns-cloudflare
  cloudflare_email: redacted
  cloudflare_api_token: redacted

I’m running version 4.12.8 of the add-on and:

Home Assistant 2023.3.6
Supervisor 2023.03.3
Operating System 9.5
Frontend 20230309.1 - latest

I coped the config I had, I unintalled the add-on, installed the add-on again, pasted the config back in and the add-on was working again.