Error installing SSL Ubuntu - Apache

Hello, I’m trying to create a new SSL in my new server but when the process is finishing I got an error with this message:

An unexpected error occurred:
StopIteration
Please see the logfiles in /var/log/letsencrypt for more details.

And in the Log file, I have this, but I don’t understand

2020-06-16 11:45:32,236:DEBUG:certbot.error_handler:Calling registered functions
2020-06-16 11:45:32,237:DEBUG:certbot.reporter:Reporting to user: Unable to install the certificate
2020-06-16 11:45:32,237:DEBUG:certbot.log:Exiting abnormally:
Traceback (most recent call last):
  File "/usr/bin/certbot", line 11, in <module>
    load_entry_point('certbot==0.31.0', 'console_scripts', 'certbot')()
  File "/usr/lib/python3/dist-packages/certbot/main.py", line 1365, in main
    return config.func(config, plugins)
  File "/usr/lib/python3/dist-packages/certbot/main.py", line 1126, in run
    _install_cert(config, le_client, domains, new_lineage)
  File "/usr/lib/python3/dist-packages/certbot/main.py", line 760, in _install_cert
    path_provider.cert_path, path_provider.chain_path, path_provider.fullchain_path)
  File "/usr/lib/python3/dist-packages/certbot/client.py", line 516, in deploy_certificate
    fullchain_path=fullchain_path)
  File "/usr/lib/python3/dist-packages/certbot_apache/configurator.py", line 334, in deploy_cert
    vhosts = self.choose_vhosts(domain)
  File "/usr/lib/python3/dist-packages/certbot_apache/configurator.py", line 358, in choose_vhosts
    return [self.choose_vhost(domain, create_if_no_ssl)]
  File "/usr/lib/python3/dist-packages/certbot_apache/configurator.py", line 540, in choose_vhost
    vhost = self.make_vhost_ssl(vhost)
  File "/usr/lib/python3/dist-packages/certbot_apache/configurator.py", line 1116, in make_vhost_ssl
    self._copy_create_ssl_vhost_skeleton(nonssl_vhost, ssl_fp)
  File "/usr/lib/python3/dist-packages/certbot_apache/configurator.py", line 1260, in _copy_create_ssl_vhost_skeleton
    ssl_vh_contents, sift = self._sift_rewrite_rules(orig_contents)
  File "/usr/lib/python3/dist-packages/certbot_apache/configurator.py", line 1332, in _sift_rewrite_rules
    line = next(contents)
StopIteration
2020-06-16 11:45:32,238:ERROR:certbot.log:An unexpected error occurred:

It’s an Instance on AWS with Ubuntu System and Apache, My websites are vHost’s.

1 Like

Apache is notorious for running at all costs.
Even when the configuration is not exactly correct.

I’m thinking certbot is having trouble with the configuration because it may not make sense to it.
I think we should review your configs to ensure that everything is working as expected.
Let’s start with:
apachectl -S

1 Like

Ok I run the command and got this
VirtualHost configuration:
*:443 is a NameVirtualHost
default server LIST OF VHOST
*:80 is a NameVirtualHost
default server LIST OF VHOST
ServerRoot: “/etc/apache2”
Main DocumentRoot: “/var/www/html”
Main ErrorLog: “/var/log/apache2/error.log”
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex ssl-stapling: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default
Mutex mpm-accept: using_defaults
PidFile: “/var/run/apache2/apache2.pid”
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name=“www-data” id=33 not_used
Group: name=“www-data” id=33 not_used

Sorry from that output I can’t help you.
[I think you may be cutting out too much]

If you don’t have a specific vhost for the name you are trying to secure, you should do that first.
http://your.domain/ must work before https://your.domain/ will work.

1 Like

Ok. But when I try to access to port 80 I can access to the website but when and I try to access https its impossible. I have others vHost with SSL running perfectly. I don’t know why I got this error with theses new vHost.

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