Certbot generating a josepy module version error

My domain is:

I ran this command:
certbot renew

It produced this output:

Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.4/certbot", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 3030, in <module>
  File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 3014, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 3043, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 654, in _build_master
  File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 968, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 854, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'josepy>=1.0.0' distribution was not found and is required by acme

My web server is (include version):

Apache v2.4.27

The operating system my web server runs on is (include version):

Gentoo Base System release 2.4.1

My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don’t know):

I’m using a control panel to manage my site (no, or provide the name and version of the control panel):

Note: I was able to run this successfully for about a year now (maybe longer), so something has changed (either I did something or the package changed) and now I cannot renew my certificate. I have tried completely uninstalling and reinstalling certbot from portage, but I keep getting the error regarding the josepy module version. I cannot seem to find the josepy module in portage, and I’d prefer not to install pip due to some issues it can create with the gentoo package manager.

Thanks in advance.

@CM73 - How did you install Certbot initially?

@bmw @schoen @SwartzCr - This looks related to the recent split of the josepy package from Certbot. Do you know what the correct advice is for a Gentoo user?

From portage via emerge:

emerge --ask app-crypt/certbot

At one point, I was experimenting with the tiny-acme in the np-hardass-overlay overlay, but ended up uninstalling that a while ago. After this broke, I reinstalled tiny-acme and the overlay, and again to uninstall/reinstall everything, but no luck.

NOTE: I’ve also requested help on the Gentoo forums, but it’s been a few days and no response.

Thanks for trying to help.

1 Like

I had the same problem but now seem to have solved it.
Which version of certbot and certbot-apache are you running?
When I installed it I used the howto found here https://wiki.gentoo.org/wiki/Let's_Encrypt . This installed the 9999 version for both packages for me.

I removed the 9999 permissions from /etc/portage/package.accept_keywords and reinstalled (downgraded) both packages. This also pulled in a downgrade for acme.

After this all seems to work as it should be.

So I went back and looked and I set this up back in Nov 2016. I also followed the guide, and I remember running into a couple of issues, but I honestly don’t remember all of the details.

Right now, I’m also pulling from certbot-9999 and acme-9999. So maybe it is an issue with the latest package after all (nothing against the fine folks at Let’s Encrypt - this is an awesome service and stuff happens).

Thanks for the help (both here and in the Gentoo forums)!

Please go to /etc/portage/package.accept_keywords and remove the lines mentioning certbot, certbot-apache and acme. If you then re-install the packages they should downgrade to the “stable” versions. After this everything works as before. (9999 versions are test versions)

1 Like

That did it. The cert renewed without an issue.

Thank you, THANK YOU! I really appreciate it.

1 Like

I’m glad you got this resolved.

In our unreleased version in master, Certbot has split some functionality out of our acme module into a new package. The new package is josepy and our acme module now depends on it. Josepy has been packaged on PyPI since October, but since we only recently made this change (and haven’t made an official Certbot release including it yet), I suspect josepy hasn’t been packaged in Gentoo yet.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.