letsencrypt in bitnami wordpress runs, but cert not renewed

I was trying to renew one of my customer’s letsencrypt cert tonight. I setup this auto renew script at the very beginning and it always work. And I actually quite surprised that the cert is going to expired in 20 days. Because I thought the auto renew script supposed to run everyday.

And I jumped on the host and started troubleshooting. I found the script and ran for a couple of times. it appeared that the challenge was not even show up.

After the investigation, I realised that it’s the lego issue. I have to update the lego version by doing the following:

cd /tmp
curl -Ls https://api.github.com/repos/xenolf/lego/releases/latest | grep browser_download_url | grep linux_amd64 | cut -d '"' -f 4 | wget -i -
tar xf lego_vX.Y.Z_linux_amd64.tar.gz
sudo mv lego /usr/local/bin/lego

Dont forgot to change the version to the right version. After I update lego version, everything back to work.