Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Certbot failing due to Python Module [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
CM73
n00b
n00b


Joined: 30 Jan 2013
Posts: 10

PostPosted: Mon Dec 18, 2017 5:58 pm    Post subject: Certbot failing due to Python Module [SOLVED] Reply with quote

I had certbot running without issue for about a year now, but I seemed to have screwed something up:

Code:
$certbot renew

Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.4/certbot", line 11, in <module>
    load_entry_point('certbot==0.21.0.dev0', 'console_scripts', 'certbot')()
  File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 560, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2642, in load_entry_point
    return ep.load()
  File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2296, in load
    return self.resolve()
  File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2302, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python3.4/site-packages/certbot/main.py", line 9, in <module>
    import josepy as jose
ImportError: No module named 'josepy'


certbot throws the same error regardless of the argument - so the 'renew' isn't the issue.

I'm not entirely sure what I did to break it. I recently uninstalled the np-hardass-overlay as well as tiny-acme, and I *think* the "josephy" module was related to that. I've also tried re-emerging certbot and certbot-apache - and it emerges without error, but still throws the same ImportError when I try to run it. I don't have issues with portage (emerge works fine and I can update the system), so I don't think it's python related.

Any ideas would be appreciated.

[UPDATE]

So I completely uninstalled both app-crypt/acme and app-crypt/certbot and re-emerged them. Now I'm getting a similar but slightly different error:

Code:
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>
    @_call_aside
  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
    ws.require(__requires__)
  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


Perhaps there is something up with the certbot package itself? Unless I'm wrong, I think it should be pulling in this dependency.


Last edited by CM73 on Thu Dec 21, 2017 2:28 pm; edited 1 time in total
Back to top
View user's profile Send private message
Fooligan
n00b
n00b


Joined: 12 Jan 2008
Posts: 12

PostPosted: Thu Dec 21, 2017 10:13 am    Post subject: Reply with quote

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%27s_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.
Back to top
View user's profile Send private message
CM73
n00b
n00b


Joined: 30 Jan 2013
Posts: 10

PostPosted: Thu Dec 21, 2017 2:08 pm    Post subject: Reply with quote

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.

Thanks for the help (both here and in the Let's Encrypt forums)!
Back to top
View user's profile Send private message
Fooligan
n00b
n00b


Joined: 12 Jan 2008
Posts: 12

PostPosted: Thu Dec 21, 2017 2:19 pm    Post subject: Reply with quote

Hi CM73,

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)
Back to top
View user's profile Send private message
CM73
n00b
n00b


Joined: 30 Jan 2013
Posts: 10

PostPosted: Thu Dec 21, 2017 2:26 pm    Post subject: Reply with quote

That did it. The cert renewed without an issue.

Thank you, THANK YOU! I really appreciate it.
Back to top
View user's profile Send private message
Fooligan
n00b
n00b


Joined: 12 Jan 2008
Posts: 12

PostPosted: Thu Dec 21, 2017 2:27 pm    Post subject: Reply with quote

My pleasure!
Back to top
View user's profile Send private message
duus
n00b
n00b


Joined: 16 Jan 2016
Posts: 2

PostPosted: Thu Jan 25, 2018 3:50 am    Post subject: Patch to make josepy merge cleanly Reply with quote

I got it to upgrade cleanly by patching the ebuild of josepy

Code:

diff --git a/usr/portage/dev-python/josepy/josepy-1.0.1.ebuild b/dev-python/josepy/josepy-1.0.1.ebuild
index 115d502..6250583 100644
--- a/usr/portage/dev-python/josepy/josepy-1.0.1.ebuild
+++ b/dev-python/josepy/josepy-1.0.1.ebuild
@@ -16,6 +16,7 @@ KEYWORDS="~amd64 ~arm ~ppc64 ~x86"
 IUSE=""

 DEPEND="
+       !<=app-crypt/acme-0.20.0[${PYTHON_USEDEP}]
        >=dev-python/setuptools-1.0[${PYTHON_USEDEP}]
        >=dev-python/cryptography-0.8[${PYTHON_USEDEP}]
        >=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}]
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum