Certbot command An unexpected error occurred: AttributeError: 'module' object has no attribute 'TLSSNI01'

Hi there , In CentOS Linux release 7.4.1708 (Core)
i update certbot , with command :
yum update certbot
and then i try to update_account
command : certbot update_account

It produced this output:
An unexpected error occurred:
AttributeError: ‘module’ object has no attribute ‘TLSSNI01’
Please see the logfile ‘/tmp/tmpFH0D5E/log’ for more details.

and indide the logfile i get this

2020-01-21 16:15:55,488:DEBUG:certbot._internal.log:Exiting abnormally:
Traceback (most recent call last):
File “/usr/bin/certbot”, line 9, in
load_entry_point(‘certbot==1.0.0’, ‘console_scripts’, ‘certbot’)()
File “/usr/lib/python2.7/site-packages/certbot/main.py”, line 14, in main
return internal_main.main(cli_args)
File “/usr/lib/python2.7/site-packages/certbot/_internal/main.py”, line 1320, in main
plugins = plugins_disco.PluginsRegistry.find_all()
File “/usr/lib/python2.7/site-packages/certbot/_internal/plugins/disco.py”, line 208, in find_all
plugin_ep = PluginEntryPoint(entry_point)
File “/usr/lib/python2.7/site-packages/certbot/_internal/plugins/disco.py”, line 50, in init
self.plugin_cls = entry_point.load()
File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 2260, in load
entry = import(self.module_name, globals(),globals(), [‘name’])
File “/usr/lib/python2.7/site-packages/certbot_apache/entrypoint.py”, line 4, in
from certbot_apache import configurator
File “/usr/lib/python2.7/site-packages/certbot_apache/configurator.py”, line 28, in
from certbot_apache import http_01
File “/usr/lib/python2.7/site-packages/certbot_apache/http_01.py”, line 11, in
class ApacheHttp01(common.TLSSNI01):
File “/usr/lib/python2.7/site-packages/certbot/plugins/common.py”, line 445, in getattr
return getattr(self._module, attr)
AttributeError: ‘module’ object has no attribute ‘TLSSNI01’
2020-01-21 16:15:55,488:ERROR:certbot._internal.log:An unexpected error occurred:

I can login to a root shell on my machine , yes

I’m using a control panel to manage my site no

The version of my client is unfortunal i dont remember the previous , now is certbot==1.0.0’
(certbot --version put the same error , i see it from /usr/bin/certbot-2 (usr/bin/certbot link there ))

Thanks

I also put the output of the update ( i dont know if it is useful)

Loaded plugins: fastestmirror
base | 3.6 kB 00:00
epel/x86_64/metalink | 29 kB 00:00
epel | 5.4 kB 00:00
extras | 2.9 kB 00:00
jenkins | 2.9 kB 00:00
updates | 2.9 kB 00:00
(1/5): epel/x86_64/updateinfo | 1.0 MB 00:00
(2/5): epel/x86_64/primary_db | 6.9 MB 00:00
(3/5): extras/7/x86_64/primary_db | 153 kB 00:00
(4/5): updates/7/x86_64/primary_db | 5.9 MB 00:00
(5/5): jenkins/primary_db | 30 kB 00:00
Determining fastest mirrors

  • base: mirror.ratiokontakt.de
  • epel: mirror.de.leaseweb.net
  • extras: linux.darkpenguin.net
  • updates: mirror.plustech.de
    Resolving Dependencies
    –> Running transaction check
    —> Package certbot.noarch 0:0.23.0-1.el7 will be updated
    —> Package certbot.noarch 0:1.0.0-1.el7 will be an update
    –> Processing Dependency: python2-certbot = 1.0.0-1.el7 for package: certbot-1.0.0-1.el7.noarch
    –> Running transaction check
    —> Package python2-certbot.noarch 0:0.23.0-1.el7 will be updated
    —> Package python2-certbot.noarch 0:1.0.0-1.el7 will be an update
    –> Processing Dependency: python2-acme >= 0.40.0 for package: python2-certbot-1.0.0-1.el7.noarch
    –> Processing Dependency: python2-distro for package: python2-certbot-1.0.0-1.el7.noarch
    –> Running transaction check
    —> Package python2-acme.noarch 0:0.23.0-1.el7 will be updated
    —> Package python2-acme.noarch 0:1.0.0-1.el7 will be an update
    –> Processing Dependency: python-requests-toolbelt for package: python2-acme-1.0.0-1.el7.noarch
    —> Package python2-distro.noarch 0:1.2.0-3.el7 will be installed
    –> Running transaction check
    —> Package python-requests-toolbelt.noarch 0:0.8.0-1.el7 will be installed
    –> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size

Updating:
certbot noarch 1.0.0-1.el7 epel 41 k
Installing for dependencies:
python-requests-toolbelt noarch 0.8.0-1.el7 epel 77 k
python2-distro noarch 1.2.0-3.el7 epel 29 k
Updating for dependencies:
python2-acme noarch 1.0.0-1.el7 epel 74 k
python2-certbot noarch 1.0.0-1.el7 epel 358 k

Transaction Summary

Install ( 2 Dependent packages)
Upgrade 1 Package (+2 Dependent packages)

Total download size: 580 k
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/5): certbot-1.0.0-1.el7.noarch.rpm | 41 kB 00:00
(2/5): python-requests-toolbelt-0.8.0-1.el7.noarch.rpm | 77 kB 00:00
(3/5): python2-acme-1.0.0-1.el7.noarch.rpm | 74 kB 00:00
(4/5): python2-certbot-1.0.0-1.el7.noarch.rpm | 358 kB 00:00
(5/5): python2-distro-1.2.0-3.el7.noarch.rpm | 29 kB 00:00

Total 1.5 MB/s | 580 kB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : python2-distro-1.2.0-3.el7.noarch 1/8
Installing : python-requests-toolbelt-0.8.0-1.el7.noarch 2/8
Updating : python2-acme-1.0.0-1.el7.noarch 3/8
Updating : python2-certbot-1.0.0-1.el7.noarch 4/8
Updating : certbot-1.0.0-1.el7.noarch 5/8
SELinux: Could not downgrade policy file /etc/selinux/targeted/policy/policy.30, searching for an older version.
SELinux: Could not open policy file <= /etc/selinux/targeted/policy/policy.30: No such file or directory
/sbin/load_policy: Can’t load policy: No such file or directory
libsemanage.semanage_reload_policy: load_policy returned error code 2. (No such file or directory).
SELinux: Could not downgrade policy file /etc/selinux/targeted/policy/policy.30, searching for an older version.
SELinux: Could not open policy file <= /etc/selinux/targeted/policy/policy.30: No such file or directory
/sbin/load_policy: Can’t load policy: No such file or directory
libsemanage.semanage_reload_policy: load_policy returned error code 2. (No such file or directory).
OSError: No such file or directory
Cleanup : certbot-0.23.0-1.el7.noarch 6/8
Cleanup : python2-certbot-0.23.0-1.el7.noarch 7/8
Cleanup : python2-acme-0.23.0-1.el7.noarch 8/8
Verifying : certbot-1.0.0-1.el7.noarch 1/8
Verifying : python-requests-toolbelt-0.8.0-1.el7.noarch 2/8
Verifying : python2-acme-1.0.0-1.el7.noarch 3/8
Verifying : python2-distro-1.2.0-3.el7.noarch 4/8
Verifying : python2-certbot-1.0.0-1.el7.noarch 5/8
Verifying : python2-acme-0.23.0-1.el7.noarch 6/8
Verifying : certbot-0.23.0-1.el7.noarch 7/8
Verifying : python2-certbot-0.23.0-1.el7.noarch 8/8

Dependency Installed:
python-requests-toolbelt.noarch 0:0.8.0-1.el7
python2-distro.noarch 0:1.2.0-3.el7

Updated:
certbot.noarch 0:1.0.0-1.el7

Dependency Updated:
python2-acme.noarch 0:1.0.0-1.el7 python2-certbot.noarch 0:1.0.0-1.el7

Complete!

I’m not saying that certbot is impossible with CentOS - don’t get me wrong.
I’m only giving my personal experience here:
I’ve had better luck with ACME.SH than with CERTBOT [on CentOS].
[and as an added benefit - I can now do ALPN renewals]

Also, I notice a lot of Python2 and no Python3 … makes me wonder …

2 Likes

You have a newer version of Certbot and an older version of Certbot’s apache plugin installed.

Can you upgrade all installed packages?

2 Likes

Thanks for replyes

rg305
i am more familiar with cerbot, and i dont want to chage this . to be honest i didint even know about acme.sh , it is a opportunity to learn about it . i will check it to know what it is .
I am 80% sure that , certbot dosent have problem with python 2.7 and more …
Thank

mnordhoff
i would prefer not upgrade all installed package, it is ok if i upgrade only certbots apache plugin ? , also i cant find the way to see the version of this plugin do you know ?
i put bellow my apache --version
/opt/SW/apache/apache_STAGING/bin/apachectl -V
Server version: Apache/2.2.34 (Unix)
Server built: Jul 30 2018 11:38:13

Thanks

Solution :

mnordhoff

You have a newer version of Certbot and an older version of Certbot’s apache plugin installed.
Solution in my case was simple (root)

then i just update the plugin

yum update python2-certbot-apache

and it runs prefect

1 Like

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