certbot bug and fix (NoInstallationError)

I’ve got a Let’s Encrypt SSL certificate on http://www.somebits.com. They expire every three months, so I set up certbot to renew the certificate. It wasn’t working though, the cron job got the error


I think this bug is now fixed in certbot. But if you follow common instructions, the cron job runs certbot with “–no-self-upgrade” so you won’t get the update. Running certbot by hand will have it upgrade itself with the fix.

The underlying bug was that certbot couldn’t find the apache2 command in the PATH, because it’s in /usr/sbin and that’s not in root’s path. (:facepalm:). The committed fix has certbot checking a couple of extra directories in addition to PATH.