dlapiduz / certbot-s3front

Certbot CLI plugin for S3/CloudFront validation and installation
MIT License
584 stars 70 forks source link

Not working with certbot python3 version #56

Closed elvisangelaccio closed 6 years ago

elvisangelaccio commented 7 years ago

It seems certbot is using python3 nowadays, while certbot-s3front still requires python2 (and installs its files in /usr/lib/python2.7/site-packages/). This is what causes #55

Is certbot-s3front supposed to work with python3?

elvisangelaccio commented 7 years ago

This is the backtrace I get if I try to use python3:

2017-06-28 17:42:58,315:DEBUG:certbot.log:Exiting abnormally:
Traceback (most recent call last):
  File "/usr/bin/certbot", line 11, in <module>
    load_entry_point('certbot==0.15.0', 'console_scripts', 'certbot')()
  File "/usr/lib/python3.6/site-packages/certbot/main.py", line 723, in main
    plugins = plugins_disco.PluginsRegistry.find_all()
  File "/usr/lib/python3.6/site-packages/certbot/plugins/disco.py", line 200, in find_all
    plugin_ep = PluginEntryPoint(entry_point)
  File "/usr/lib/python3.6/site-packages/certbot/plugins/disco.py", line 47, in __init__
    self.plugin_cls = entry_point.load()
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2303, in load
    return self.resolve()
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2309, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3.6/site-packages/certbot_s3front/authenticator.py", line 20, in <module>
    class Authenticator(common.Plugin):
  File "/usr/lib/python3.6/site-packages/certbot_s3front/authenticator.py", line 21, in Authenticator
    zope.interface.implements(interfaces.IAuthenticator)
  File "/usr/lib/python3.6/site-packages/zope/interface/declarations.py", line 483, in implements
    raise TypeError(_ADVICE_ERROR % 'implementer')
TypeError: Class advice impossible in Python3.  Use the @implementer class decorator instead.
agis commented 7 years ago

I'm also bitten by this. Any suggestions?

elvisangelaccio commented 7 years ago

@agis As workaround you can create a python2 virtualenv and install certbot/certbot-s3front there.

Ornithologist commented 6 years ago

I have created a python2 virtualenv and installed certbot and certbot-s3front in it.

~However when I run certbot I still get a python3 related problem:~

(venv) ➜  letsencrypt certbot --help
An unexpected error occurred:
TypeError: Class advice impossible in Python3.  Use the @implementer class decorator instead.
Please see the logfile '/var/folders/kx/w2r123xx46jbcq7mhkcs4m1r0000gn/T/tmpas0vjp57' for more details.

Self-solved. It was a weird issue that even if I ran the install using pip2, the certbot was still installed with Python3.6. Cleared my virtualenv and did it again. Sorry for false report

vshuraeff commented 6 years ago

same with python 3.6.3 also requirements pins exact versions of zope.*

ayox commented 6 years ago

I managed to find a solution for this without a virtual enviorment.

dlapiduz commented 6 years ago

This should be fixed now with the version 0.4.0. Please try it and let me know if it works!

elvisangelaccio commented 6 years ago

@dlapiduz Is 0.4.0 available on pip yet?

dlapiduz commented 6 years ago

@elvisangelaccio oops, there was an issue with pypi and the CI system didn't notify me. It is up now.