Creris
Creris

Reputation: 1128

letsencrypt-auto fails to create certificates properly

I am following this guide: https://www.digitalocean.com/community/tutorials/how-to-set-up-let-s-encrypt-certificates-for-multiple-apache-virtual-hosts-on-ubuntu-14-04.

I did pull the git repo as shown in the tutorial, and when I ran the command ./letsencrypt-auto --apache -d example.com -d www.example.com, where example.com is my actual site, it did ask me for email address for the contact, but then instead of popping the remaining actions, it poped this error message:

An unexpected error occurred: NameError: free variable 'addrs' referenced before assignment in enclosing scope

but it created the certs. I tried the website ssllabs but it said the server was listening on port 443 but did not provide safe transfer and neither did https://example.com actually work(did not load).

I tried running it again multiple times, even re-pulling the git repo, but with always the same error message.

Full contents of the log file(last 38 lines which represent the error, replaced logged user with $USER):

2016-02-11 16:59:24,530:DEBUG:letsencrypt.error_handler:Encountered exception:
Traceback (most recent call last):
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/client.py", line 355, in deploy_certificate
    fullchain_path=fullchain_path)
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt_apache/configurator.py", line 214, in deploy_cert
    vhost = self.choose_vhost(domain)
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt_apache/configurator.py", line 308, in choose_vhost
    vhost = self.make_vhost_ssl(vhost)
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt_apache/configurator.py", line 733, in make_vhost_ssl
    self._add_name_vhost_if_necessary(ssl_vhost)
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt_apache/configurator.py", line 905, in _add_name_vhost_if_necessary
    test_addr in test_vh.addrs) and
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt_apache/configurator.py", line 905, in <genexpr>
    test_addr in test_vh.addrs) and
NameError: free variable 'addrs' referenced before assignment in enclosing scope

2016-02-11 16:59:24,530:DEBUG:letsencrypt.error_handler:Calling registered functions
2016-02-11 16:59:24,534:DEBUG:letsencrypt.cli:Exiting abnormally:
Traceback (most recent call last):
  File "/home/$USER/.local/share/letsencrypt/bin/letsencrypt", line 11, in <module>
    sys.exit(main())
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/cli.py", line 1987, in main
    return config.func(config, plugins)
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/cli.py", line 667, in run
    lineage.chain, lineage.fullchain)
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/client.py", line 355, in deploy_certificate
    fullchain_path=fullchain_path)
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt_apache/configurator.py", line 214, in deploy_cert
    vhost = self.choose_vhost(domain)
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt_apache/configurator.py", line 308, in choose_vhost
    vhost = self.make_vhost_ssl(vhost)
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt_apache/configurator.py", line 733, in make_vhost_ssl
    self._add_name_vhost_if_necessary(ssl_vhost)
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt_apache/configurator.py", line 905, in _add_name_vhost_if_necessary
    test_addr in test_vh.addrs) and
  File "/home/$USER/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt_apache/configurator.py", line 905, in <genexpr>
    test_addr in test_vh.addrs) and
NameError: free variable 'addrs' referenced before assignment in enclosing scope

What is this problem and how could I go about fixing it?

Thank you for reading.

Upvotes: 0

Views: 211

Answers (1)

Funkatron
Funkatron

Reputation: 892

There is a closed issue on this error here, and a fix has been made:

https://github.com/letsencrypt/letsencrypt/issues/2470

I had to apply the patch manually. Hopefully when 0.4.1 comes out this won't be an issue.

Upvotes: 1

Related Questions