Bug 1576727 - certbot: AttributeError: 'module' object has no attribute 'add_metaclass'
Summary: certbot: AttributeError: 'module' object has no attribute 'add_metaclass'
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: certbot
Version: epel7
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: James Hogarth
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-10 09:14 UTC by Yuri Kanivetsky
Modified: 2018-05-22 18:10 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-05-22 06:08:36 UTC
Type: Bug


Attachments (Terms of Use)

Description Yuri Kanivetsky 2018-05-10 09:14:37 UTC
Description of problem:

certbot fails to run. It introduces itself on CentOS 7.4. Supposedly since python version is not compatible with python2-josepy, or possibly some other package.

How reproducible: always

Steps to Reproduce:

1. certbot certonly --standalone -d example.com

Actual results:

Traceback (most recent call last): 
  File "/usr/bin/certbot", line 9, in <module> 
    load_entry_point('certbot==0.23.0', 'console_scripts', 'certbot')()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 378, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2566, in load_entry_point
    return ep.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/main.py", line 10, in <module>
    import josepy as jose
  File "/usr/lib/python2.7/site-packages/josepy/__init__.py", line 44, in <module>
    from josepy.interfaces import JSONDeSerializable
  File "/usr/lib/python2.7/site-packages/josepy/interfaces.py", line 14, in <module>
    @six.add_metaclass(abc.ABCMeta)
AttributeError: 'module' object has no attribute 'add_metaclass'

Expected results:

doesn't trigger the error

Additional info:

Another way to reproduce:

$ python -c 'import josepy'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/josepy/__init__.py", line 44, in <module>
    from josepy.interfaces import JSONDeSerializable
  File "/usr/lib/python2.7/site-packages/josepy/interfaces.py", line 14, in <module>
    @six.add_metaclass(abc.ABCMeta)
AttributeError: 'module' object has no attribute 'add_metaclass'

$ yum list python python2-josepy
...
Installed Packages
python.x86_64                                    2.7.5-68.el7                             @base
python2-josepy.noarch                            1.1.0-1.el7                              @epel

I can't reproduce it on CentOS 7.2:

$ yum list python python2-josepy
...

Installed Packages
python.x86_64                                    2.7.5-34.el7                             @base
python2-josepy.noarch                            1.1.0-1.el7                              @epel
Available Packages
python.x86_64                                    2.7.5-58.el7                             base 

The workaround is to use https://dl.eff.org/certbot-auto

certbot-auto installs the following versions of packages:

$ /opt/eff.org/certbot/venv/bin/pip freeze
acme==0.24.0
asn1crypto==0.22.0
certbot==0.24.0
certbot-apache==0.24.0
certbot-nginx==0.24.0
cffi==1.10.0
ConfigArgParse==0.12.0
configobj==5.0.6
cryptography==2.0.2
enum34==1.1.2
funcsigs==1.0.2
idna==2.5
ipaddress==1.0.16
josepy==1.0.1
letsencrypt==0.7.0
linecache2==1.0.0
mock==1.3.0
ordereddict==1.1
packaging==16.8
parsedatetime==2.1
pbr==1.8.1
pycparser==2.14
pyOpenSSL==16.2.0
pyparsing==2.1.8
pyRFC3339==1.0
python-augeas==0.5.0
pytz==2015.7
requests==2.12.1
six==1.10.0
traceback2==1.4.0
unittest2==1.1.0
zope.component==4.2.2
zope.event==4.1.0
zope.interface==4.1.3

Comment 1 Yuri Kanivetsky 2018-05-10 09:17:38 UTC
Sorry, not introduces, but manifests:

> It manifests itself on CentOS 7.4

Comment 2 Eli Young 2018-05-12 03:21:20 UTC
What version of python2-six do you have installed?

Comment 3 Yuri Kanivetsky 2018-05-12 06:03:26 UTC
1.9.0-0.el7, installed from EPEL. And the same version on the server with CentOS 7.2, where it works.

Comment 4 Eli Young 2018-05-21 20:50:50 UTC
I am unable to reproduce this locally. Do you also have python-six installed? If so, what version? Could you run `rpm -Vv python-six` and post the results? It should look something like this:

$ rpm -Vv python-six
.........    /usr/lib/python2.7/site-packages/six-1.9.0-py2.7.egg-info
.........    /usr/lib/python2.7/site-packages/six-1.9.0-py2.7.egg-info/PKG-INFO
.........    /usr/lib/python2.7/site-packages/six-1.9.0-py2.7.egg-info/SOURCES.txt
.........    /usr/lib/python2.7/site-packages/six-1.9.0-py2.7.egg-info/dependency_links.txt
.........    /usr/lib/python2.7/site-packages/six-1.9.0-py2.7.egg-info/top_level.txt
.........    /usr/lib/python2.7/site-packages/six.py
.........    /usr/lib/python2.7/site-packages/six.pyc
.........    /usr/lib/python2.7/site-packages/six.pyo
.........    /usr/share/doc/python-six-1.9.0
.........  d /usr/share/doc/python-six-1.9.0/LICENSE
.........  d /usr/share/doc/python-six-1.9.0/README
.........  d /usr/share/doc/python-six-1.9.0/index.rst

Comment 5 Yuri Kanivetsky 2018-05-22 06:08:36 UTC
Indeed, that's the issue:

$ rpm -Vv python-six                  
.........    /usr/lib/python2.7/site-packages/six-1.9.0-py2.7.egg-info
S.5......    /usr/lib/python2.7/site-packages/six-1.9.0-py2.7.egg-info/PKG-INFO
S.5......    /usr/lib/python2.7/site-packages/six-1.9.0-py2.7.egg-info/SOURCES.txt
S.5......    /usr/lib/python2.7/site-packages/six-1.9.0-py2.7.egg-info/dependency_links.txt
S.5......    /usr/lib/python2.7/site-packages/six-1.9.0-py2.7.egg-info/top_level.txt
S.5......    /usr/lib/python2.7/site-packages/six.py
S.5....T.    /usr/lib/python2.7/site-packages/six.pyc
S.5......    /usr/lib/python2.7/site-packages/six.pyo
.........    /usr/share/doc/python-six-1.9.0
S.5......  d /usr/share/doc/python-six-1.9.0/LICENSE
S.5......  d /usr/share/doc/python-six-1.9.0/README
S.5......  d /usr/share/doc/python-six-1.9.0/index.rst

And it has an empty installed-from-repo for some reason:

$ yum list installed python-six
...
Installed Packages                                   
python-six.noarch                                1.9.0-2.el7                              @

Hosting company's image must be broken. I've run into similar issue with `rsync`, the file was empty. And now certbot. After `yum reinstall python-six`... Well, I have an issue with the other package. Sorry for bothering :(

Comment 6 Eli Young 2018-05-22 18:10:54 UTC
No worries. Thanks for following up!


Note You need to log in before you can comment on or make changes to this bug.