After upgrading one of our servers to Debian 10 ‘Buster’ the letsencrypt CRON job reported this error:

Error: couldn't get currently installed version for /opt/eff.org/certbot/venv/bin/letsencrypt:
Traceback (most recent call last):
File "/opt/eff.org/certbot/venv/bin/letsencrypt", line 7, in <module>
from certbot.main import main
File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/main.py", line 6, in <module>
import logging.handlers
File "/usr/lib/python2.7/logging/__init__.py", line 26, in <module>
import sys, os, time, cStringIO, traceback, warnings, weakref, collections
File "/usr/lib/python2.7/weakref.py", line 14, in <module>
from _weakref import (
ImportError: cannot import name _remove_dead_weakref

One of the upgrades in Debian 10 is a Python upgrade to v3.7.2. This caused my certbot renewal to break.

How to fix the error:

sudo apt update

Next, install the dependencies for the python3-certbot-nginx package, which include the python3-acme, python3-certbot, python3-mock, python3-openssl, python3-pkg-resources, python3-pyparsing, and python3-zope.interface packages

sudo apt install python3-acme python3-certbot python3-mock python3-openssl python3-pkg-resources python3-pyparsing python3-zope.interface

Finally, install the python3-certbot-nginx package:

sudo apt install python3-certbot-nginx

To verify that your certbot is working properly:

certbot renew --dry-run

Don’t forget to check your Cron jobs…

In my case – the old Cron job for Let’s Encrypt renewals remained broken, so I disabled it and created a new one.

Old Cron:
/opt/letsencrypt/letsencrypt-auto renew >> /var/log/le-renew.log
New Cron:
certbot renew >> /var/log/le-renew.log


Andrew Miller

Online since the "brrr-bleep" era. Proud father and husband. Internet geek.

You might also be interested in


Business

Total Online Start-up Kit for Business

Every online business requires these five fundamental components: Branding, Website, Email, Domain Name, and Hosting. Some businesses already have one or more of those components already in place. Brand new businesses require all five. Traditionally, each component would be separately estimated, developed and billed. We have a new plan, with much lower entry cost: All-in-one, Total Online Start-up Kit for Business. Let’s dig in. Read More

Hosting

How to rewrite @2x retina image URLs with NGINX

Recently I noticed that one of our client websites was creating many 404 “not found” errors in our NGINX server logs. The errors were for “@2x.jpg” static files. I believe that the active WordPress theme was coded to server @2x file URLs for retina and other HDPI screens, but the files are not automatically generated. Read More

Hosting

Managed Website Hosting

While there are many providers in the global and domestic managed hosting market, Brightwood Creative should still be your all-in-one solution for website Hosting. Read More

Let Us Help You.

At this point you should hopefully have a pretty good idea what we do. Sometimes people want to know more. Either way, the best way to get this ball rolling is to reach out. Seriously, just call us. We are very nice people.

phone

Give us a ring

General Sales & Enquiries
info@brightwood.ie
+353 (0) 851466889
Mon - Sun, 8:00-22:00

Help & Support

support@brightwood.ie
+353 85 1466889
Mon – Sun, 8:00-22:00

Feel Like Reaching Out?

We use cookies to give you the best online experience. By agreeing you accept the use of cookies in accordance with our cookie policy.

Privacy Settings saved!
Privacy Settings

When you visit any web site, it may store or retrieve information on your browser, mostly in the form of cookies. Control your personal Cookie Services here.

These cookies are necessary for the website to function and cannot be switched off in our systems.

In order to use this website we use the following technically required cookies
  • wordpress_test_cookie
  • wordpress_logged_in_
  • wordpress_sec

Decline all Services
Accept all Services