No way Jose? The dreaded "ImportError: No module named jose"

My domain is:
Not relevant, as this applies in command line in Crontab to all domains

I ran this command:
certbot renew --dry-run

It produced this output:

An unexpected error occurred:
ImportError: No module named jose
Please see the logfile '/tmp/tmp2eo7fb' for more details.

The contents of that tmp file:

Traceback (most recent call last):
File "/usr/bin/certbot", line 9, in <module>
load_entry_point('certbot==0.29.1', 'console_scripts', 'certbot')()
File "/usr/lib/python2.7/site-packages/certbot/main.py", line 1322, in main
plugins = plugins_disco.PluginsRegistry.find_all()
File "/usr/lib/python2.7/site-packages/certbot/plugins/disco.py", line 206, in find_all
plugin_ep = PluginEntryPoint(entry_point)
File "/usr/lib/python2.7/site-packages/certbot/plugins/disco.py", line 52, in __init__
self.plugin_cls = entry_point.load()
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2322, in load
return self.resolve()
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2328, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/python2.7/site-packages/certbot_external_auth/plugin.py", line 27, in <module>
from acme.jose import b64
ImportError: No module named jose
2019-01-16 10:17:33,103:ERROR:certbot.log:An unexpected error occurred:

My web server is (include version):
Nginx 1.14.2

The operating system my web server runs on is (include version):
CentOS 7.6 (I did a yum update recently, which upgraded this to CentOS)

My hosting provider, if applicable, is:
NA, but it's Digital Ocean

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

I'm using a control panel to manage my site (no, or provide the name and version of the control panel):
No, from the shell as SUDO user

What should I do? The "Jose" error is not very helpful. Many thanks!

If it helps, these are the certbot related modules installed:

# yum list installed | grep "certbot"

certbot.noarch 0.29.1-1.el7 @epel
python2-certbot.noarch 0.29.1-1.el7 @epel
python2-certbot-nginx.noarch 0.29.1-1.el7 @epel

Try reinstalling python2-acme.

If that doesn’t fix it, you might try to (re)install python2-josepy

1 Like

I did

Yum reinstall python2-acme
Yum reinstall python2-josepy

Both were reinstalled. Still the same issue. Latest trace below from the tmp file—

# cat /tmp/tmptSq4gv 2019-01-16 15:35:43,572:DEBUG:certbot.log:Exiting abnormally: Traceback (most recent call last): File "/usr/bin/certbot", line 9, in <module> load_entry_point('certbot==0.29.1', 'console_scripts', 'certbot')() File "/usr/lib/python2.7/site-packages/certbot/main.py", line 1322, in main plugins = plugins_disco.PluginsRegistry.find_all() File "/usr/lib/python2.7/site-packages/certbot/plugins/disco.py", line 206, in find_all plugin_ep = PluginEntryPoint(entry_point) File "/usr/lib/python2.7/site-packages/certbot/plugins/disco.py", line 52, in __init__ self.plugin_cls = entry_point.load() File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2322, in load return self.resolve() File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2328, in resolve module = __import__(self.module_name, fromlist=['__name__'], level=0) File "/usr/lib/python2.7/site-packages/certbot_external_auth/plugin.py", line 27, in <module> from acme.jose import b64 ImportError: No module named jose 2019-01-16 15:35:43,572:ERROR:certbot.log:An unexpected error occurred:

Certbot restored backwards compatibility in 0.30.0.

I don't know if certbot_external_auth has been updated to use the new name anyway.

Can you update either of them?

2 Likes

Sorry I’m not sure what I should do. Update certbot_external something? What command do I need to execute?

Yum reinstall certbot
?

Will this remove all my certificates that're live for the domains? Just being cautious.

Are you using the certbot_external_auth plugin?

Edit: By the way, it was also fixed upstream:

I am not sure. I installed certbot with the usual instructions found on the LE website:

THis has worked thus far, until now. The certbot renew command is in the crontab and updates the certificates.

What should I do now, yum reinstall certbot? I am worried that may delete or goof up all my existing certificates for domains?

Those instructions don’t say to use the certbot-external-auth plugin…

Could you post the output of:

egrep 'authenticator|installer|manual_auth_hook|manual_cleanup_hook' /etc/letsencrypt/renewal/*.conf

It should NOT delete any of your certs...
But if you are worried anything "critical" may be deleted, you can backup the entire /etc/letsencrypt folder.
Before removing/reinstalling certbot.

1 Like

Here you go. This includes all domains names, so I'm a bit shy to put them here. Have replaced domain names with domainA, domainB, etc. Hope that's ok as the info about external_auth is not contained in the domain name.

Much appreciate any help--

# egrep 'authenticator|installer|manual_auth_hook|manual_cleanup_hook' /etc/letsencrypt/renewal/*.conf

/etc/letsencrypt/renewal/DOMAINA.com.conf:authenticator = webroot
/etc/letsencrypt/renewal/DOMAINA.com.conf:installer = None
/etc/letsencrypt/renewal/DOMAINB.com.conf:authenticator = webroot
/etc/letsencrypt/renewal/DOMAINB.com.conf:installer = None
/etc/letsencrypt/renewal/DOMAINC.com.conf:authenticator = webroot
/etc/letsencrypt/renewal/DOMAINC.com.conf:installer = None
/etc/letsencrypt/renewal/DOMAIND.com.conf:authenticator = webroot
/etc/letsencrypt/renewal/DOMAIND.com.conf:installer = None
/etc/letsencrypt/renewal/DOMAIND.io.conf:authenticator = webroot
/etc/letsencrypt/renewal/DOMAIND.io.conf:installer = None
/etc/letsencrypt/renewal/DOMAINE.com.conf:authenticator = webroot
/etc/letsencrypt/renewal/DOMAINE.com.conf:installer = None

It looks like you’re not currently using that plugin.

(Unless you’re doing something very complicated like managing a second Certbot configuration directory somewhere.)

It might solve all your problems to just use yum to uninstall the plugin.

1 Like

Thank you. So, something like this:

yum uninstall certbot_external_auth

Yes? Note that this isn't installed at all.

How would reinstalling certbot help? The epel repo has 0.29.x…

yum list *certbot*

Loaded plugins: fastestmirror, replace
Loading mirror speeds from cached hostfile
 * base: mirror.atlanticmetro.net
 * epel: epel.mirror.constant.com
 * extras: mirror.atlanticmetro.net
 * updates: centos.mirror.constant.com

Installed Packages
certbot.noarch                                                    0.29.1-1.el7                            @epel
python2-certbot.noarch                                            0.29.1-1.el7                            @epel
python2-certbot-nginx.noarch                                      0.29.1-1.el7                            @epel

Available Packages
python2-certbot-apache.noarch                                     0.29.1-1.el7                            epel 
python2-certbot-dns-cloudflare.noarch                             0.29.1-1.el7                            epel 
python2-certbot-dns-cloudxns.noarch                               0.29.1-1.el7                            epel 
python2-certbot-dns-digitalocean.noarch                           0.29.1-1.el7                            epel 
python2-certbot-dns-dnsimple.noarch                               0.29.1-1.el7                            epel 
python2-certbot-dns-dnsmadeeasy.noarch                            0.29.1-1.el7                            epel 
python2-certbot-dns-gehirn.noarch                                 0.29.1-1.el7                            epel 
python2-certbot-dns-google.noarch                                 0.29.1-1.el7                            epel 
python2-certbot-dns-linode.noarch                                 0.29.1-1.el7                            epel 
python2-certbot-dns-luadns.noarch                                 0.29.1-1.el7                            epel 
python2-certbot-dns-nsone.noarch                                  0.29.1-1.el7                            epel 
python2-certbot-dns-ovh.noarch                                    0.29.1-1.el7                            epel 
python2-certbot-dns-rfc2136.noarch                                0.29.1-1.el7                            epel 
python2-certbot-dns-route53.noarch                                0.27.1-1.el7                            epel 
python2-certbot-dns-sakuracloud.noarch                            0.29.1-1.el7                            epel

Can I just force-remove the folders:

/usr/lib/python2.7/site-packages/certbot_external_auth/
/usr/lib/python2.7/site-packages/certbot_external_auth-0.0.8-py2.7.egg-info/

(UPDATE: I did this. Just deleted these folders, and now certbot works again. Many thanks!)

Maybe.

If you installed it with "sudo pip", yes. And it might also be referenced in some of the .pth files in the same directory. (Which you should edit, if they refer to multiple packages, not delete.)

If you installed it with yum or something, you should uninstall it the same way.

There's a newer version out. It probably fixes this issue. If you used pip, you can upgrade it. If you installed it some other way, the newer version may not be available.

Edit: When I said "the same directory", I meant /usr/lib/python2.7/site-packages/.

1 Like

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