KeyError: 'No metadata except PKG-INFO is available'

Hi,

I’m encountering below error when installing using certbot-auto on Amazon Linux for Nginx. Previously I was able to install on another instance without this error. Anyone has an idea on this?

#./certbot-auto --nginx
Error: couldn't get currently installed version for /opt/eff.org/certbot/venv/bin/letsencrypt: 
An unexpected error occurred:
KeyError: 'No metadata except PKG-INFO is available'
Please see the logfile '/tmp/tmpJEWQLs' for more details.

# more /tmp/tmpJEWQLs
2018-07-31 08:46:19,613:DEBUG:certbot.log:Exiting abnormally:
Traceback (most recent call last):
  File "/opt/eff.org/certbot/venv/bin/letsencrypt", line 11, in <module>
    sys.exit(main())
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/certbot/main.py", line 1338, in main
    plugins = plugins_disco.PluginsRegistry.find_all()
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/certbot/plugins/disco.py", line 206, in find_all
    plugin_ep = PluginEntryPoint(entry_point)
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/certbot/plugins/disco.py", line 52, in __init__
    self.plugin_cls = entry_point.load()
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2320, in load
    self.require(*args, **kwargs)
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2343, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 785, in resolve
    new_requirements = dist.requires(req.extras)[::-1]
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2610, in requires
    dm = self._dep_map
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2874, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2883, in _compute_dependencies
    for req in self._parsed_pkg_info.get_all('Requires-Dist') or []:
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2865, in _parsed_pkg_info
    metadata = self.get_metadata(self.PKG_INFO)
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1791, in get_metadata
    raise KeyError("No metadata except PKG-INFO is available")
KeyError: 'No metadata except PKG-INFO is available'
2018-07-31 08:46:19,613:ERROR:certbot.log:An unexpected error occurred:

I was getting the same issues with an Amazon Linux instance that was orginaly setup with cert-bot and worked fine. I tried to fix some other issues by follwing another post and this is the result I came too

In the end I had to do the following

rm -rf /opt/eff.org/*

It will probably fail on this one but setups a clean virtual enviroment
./certbot-auto --debug

cd /opt/eff.org/certbot/venv/lib64/python2.7

mv site-packages site-packages.sav

ln -s dist-packages/ site-packages

Your now ready to run certbot-auto again

./certbot-auto --debug

Wow this works well. Thanks a lot!

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