[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Certbot fails with "unexpected error: 'NoneType' object has no attribute 'lower'" #6591

Open
el-barto opened this issue Dec 11, 2018 · 4 comments

Comments

@el-barto
Copy link

Hi!

I'm having problems trying to renew a domain's certificate and I think it might be a bug because it's similar (but not the same) to others previously reported.

OS: Ubuntu 14.04
Cerbot version: 0.29.1
Certbot installed with: certbot-auto

When I issue a renew, this is the output I get:

# ./certbot-auto renew 
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/<my-domain>.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cert is due for renewal, auto-renewing...
Attempting to renew cert (<my-domain>) from /etc/letsencrypt/renewal/<my-domain>.conf produced an unexpected error: 'NoneType' object has no attribute 'lower'. Skipping.

(I redacted the domain name, of course).

Here's the log:

2018-12-11 19:53:42,356:DEBUG:certbot.main:certbot version: 0.29.1
2018-12-11 19:53:42,357:DEBUG:certbot.main:Arguments: []
2018-12-11 19:53:42,357:DEBUG:certbot.main:Discovered plugins: PluginsRegistry(PluginEntryPoint#apache,PluginEntryPoint#manual,PluginEntryPoint#nginx,
PluginEntryPoint#null,PluginEntryPoint#standalone,PluginEntryPoint#webroot)
2018-12-11 19:53:42,371:DEBUG:certbot.log:Root logging level set at 20
2018-12-11 19:53:42,371:INFO:certbot.log:Saving debug log to /var/log/letsencrypt/letsencrypt.log
2018-12-11 19:53:42,421:DEBUG:certbot.plugins.selection:Requested authenticator <certbot.cli._Default object at 0xf76db62c> and installer <certbot.cli
._Default object at 0xf76db62c>
2018-12-11 19:53:42,422:DEBUG:certbot.cli:Var server=https://acme-v02.api.letsencrypt.org/directory (set by user).
2018-12-11 19:53:42,422:DEBUG:certbot.cli:Var server=https://acme-v02.api.letsencrypt.org/directory (set by user).
2018-12-11 19:53:42,422:DEBUG:certbot.cli:Var account=set(['server']) (set by user).
2018-12-11 19:53:42,463:DEBUG:certbot.storage:Should renew, less than 30 days before certificate expiry 2018-12-04 10:53:48 UTC.
2018-12-11 19:53:42,464:INFO:certbot.renewal:Cert is due for renewal, auto-renewing...
2018-12-11 19:53:42,464:DEBUG:certbot.plugins.selection:Requested authenticator apache and installer None
2018-12-11 19:53:42,597:DEBUG:certbot_apache.configurator:Apache version is 2.4.7
2018-12-11 19:53:44,096:WARNING:certbot.renewal:Attempting to renew cert (<my-domain>) from /etc/letsencrypt/renewal/<my-domain>.conf produced an unexpected error: 'NoneType' object has no attribute 'lower'. Skipping.
2018-12-11 19:53:44,100:DEBUG:certbot.renewal:Traceback was:
Traceback (most recent call last):
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/renewal.py", line 432, in handle_renewal_request
    main.renew_cert(lineage_config, plugins, renewal_candidate)
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/main.py", line 1164, in renew_cert
    installer, auth = plug_sel.choose_configurator_plugins(config, plugins, "certonly")
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/plugins/selection.py", line 230, in choose_configurator_plugins
    authenticator = pick_authenticator(config, req_auth, plugins)
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/plugins/selection.py", line 40, in pick_authenticator
    config, default, plugins, question, (interfaces.IAuthenticator,))
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/plugins/selection.py", line 106, in pick_plugin
    verified.prepare()
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/plugins/disco.py", line 251, in prepare
    return [plugin_ep.prepare() for plugin_ep in six.itervalues(self._plugins)]
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/plugins/disco.py", line 132, in prepare
    self._initialized.prepare()
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot_apache/configurator.py", line 258, in prepare
    self.vhosts = self.get_virtual_hosts()
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot_apache/configurator.py", line 847, in get_virtual_hosts
    new_vhost = self._create_vhost(path)
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot_apache/configurator.py", line 823, in _create_vhost
    self._add_servernames(vhost)
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot_apache/configurator.py", line 773, in _add_servernames
    servername, serveraliases = self._get_vhost_names(host.path)
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot_apache/configurator.py", line 751, in _get_vhost_names
    "ServerAlias", None, start=path, exclude=False)
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot_apache/parser.py", line 454, in find_dir
    exclude))
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot_apache/parser.py", line 449, in find_dir
    dir_ = self.aug.get(match).lower()
AttributeError: 'NoneType' object has no attribute 'lower'
2018-12-11 19:53:44,103:DEBUG:certbot.cli:Var server=https://acme-v02.api.letsencrypt.org/directory (set by user).
2018-12-11 19:53:44,103:DEBUG:certbot.cli:Var server=https://acme-v02.api.letsencrypt.org/directory (set by user).
2018-12-11 19:53:44,103:DEBUG:certbot.cli:Var account=set(['server']) (set by user).
2018-12-11 19:53:44,150:INFO:certbot.renewal:Cert not yet due for renewal
2018-12-11 19:53:44,152:DEBUG:certbot.plugins.selection:Requested authenticator apache and installer None
2018-12-11 19:53:44,153:DEBUG:certbot.cli:Var server=https://acme-v02.api.letsencrypt.org/directory (set by user).
2018-12-11 19:53:44,153:DEBUG:certbot.cli:Var server=https://acme-v02.api.letsencrypt.org/directory (set by user).
2018-12-11 19:53:44,153:DEBUG:certbot.cli:Var account=set(['server']) (set by user).
2018-12-11 19:53:44,197:INFO:certbot.renewal:Cert not yet due for renewal
2018-12-11 19:53:44,199:DEBUG:certbot.plugins.selection:Requested authenticator apache and installer None
2018-12-11 19:53:44,201:DEBUG:certbot.cli:Var server=https://acme-v02.api.letsencrypt.org/directory (set by user).
2018-12-11 19:53:44,201:DEBUG:certbot.cli:Var server=https://acme-v02.api.letsencrypt.org/directory (set by user).
2018-12-11 19:53:44,201:DEBUG:certbot.cli:Var account=set(['server']) (set by user).
2018-12-11 19:53:44,241:INFO:certbot.renewal:Cert not yet due for renewal
2018-12-11 19:53:44,242:DEBUG:certbot.plugins.selection:Requested authenticator apache and installer None
2018-12-11 19:53:44,242:ERROR:certbot.renewal:All renewal attempts failed. The following certs could not be renewed:
2018-12-11 19:53:44,242:ERROR:certbot.renewal:  /etc/letsencrypt/live/<my-domain>/fullchain.pem (failure)
2018-12-11 19:53:44,243: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/site-packages/certbot/main.py", line 1352, in main
    return config.func(config, plugins)
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/main.py", line 1259, in renew
    renewal.handle_renewal_request(config)
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/site-packages/certbot/renewal.py", line 457, in handle_renewal_request
    len(renew_failures), len(parse_failures)))
Error: 1 renew failure(s), 0 parse failure(s)

Note that, while this is similar to other issues like #1738, #2247 and #4245, it fails on a different line.

@ohemorange
Copy link
Contributor

@bmw @joohoi any idea what's going on here?

@schoen
Copy link
Contributor
schoen commented Jan 15, 2019

@el-barto, could you please post the associated Apache configuration so we could see if there's something unusual about it that the parser is having trouble with?

@el-barto
Copy link
Author

Thanks for the reply. Here's the document root setup:

<IfModule mod_ssl.c>
<VirtualHost X.X.X.X:443>
        ServerAdmin myemail@gmail.com
        ServerName <my-domain> 
        ServerAlias www.<my-domain>
        ServerAlias en.<my-domain> 
        ServerAlias www.en.<my-domain>

        DocumentRoot /srv/www/<my-domain>/public_html/
        ErrorLog /srv/www/<my-domain>/logs/error.log
        CustomLog /srv/www/<my-domain>/logs/access.log combined

        Include /etc/apache2/serveralias_400.conf

        SSLEngine on
        SSLCertificateFile   /etc/letsencrypt/live/<my-domain>/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/<my-domain>/privkey.pem
        #SSLCertificateChainFile /etc/letsencrypt/live/<my-domain>/fullchain.pem

        #   SSL Engine Options:
        #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
        <FilesMatch "\.(cgi|shtml|phtml|php)$">
                SSLOptions +StdEnvVars
        </FilesMatch>
        <Directory /usr/lib/cgi-bin>
                SSLOptions +StdEnvVars
        </Directory>

        #   SSL Protocol Adjustments:
        BrowserMatch "MSIE [2-6]" \
                nokeepalive ssl-unclean-shutdown \
                downgrade-1.0 force-response-1.0
        # MSIE 7 and newer should be able to use keepalive
        BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown


        <Directory /srv/www/<my-domain>/public_html>
                AllowOverride All
        </Directory>


</VirtualHost>
</IfModule>

The file /etc/apache2/serveralias_400.conf contains this:

<Directory /srv/www/<my-domain>/public_html/_serveralias>
        Order deny,allow
        Deny from all
</Directory>

I was able to manually renew one certificate which was about to expire by deleting it with ./certbot-auto delete and then issuing a new one with ./certbot-auto --manual certonly -d '<my-domain>'. But I'm still having problems to renew other certificates on the same server.

@bmw
Copy link
Member
bmw commented Jan 18, 2019

@joohoi told me a while ago he'd take a look at this so I'm assigning him to this issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants