Namespace object has no attribute 'apache_vhost_root'

certbot is telling me there is no apache_vhost_root, but clearly there is… help!

# cat /etc/os-release 
NAME="Ubuntu"
VERSION="16.04.2 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.2 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial

# certbot --version
certbot 0.27.0

# certbot --dry-run -vvv --debug renew
Root logging level set at -10
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/****.***.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Requested authenticator <certbot.cli._Default object at 0x7ff0815e7f90> and installer <certbot.cli._Default object at 0x7ff0815e7f90>
Var dry_run=True (set by user).
Var server=set(['staging', 'dry_run']) (set by user).
Var account=set(['server']) (set by user).
Renewal configuration file /etc/letsencrypt/renewal/****.***.conf (cert: ****.***) produced an unexpected error: 'Namespace' object has no attribute 'apache_vhost_root'. Skipping.
Traceback was:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/certbot/renewal.py", line 406, in handle_renewal_request
    renewal_candidate = _reconstitute(lineage_config, renewal_file)
  File "/usr/lib/python2.7/dist-packages/certbot/renewal.py", line 83, in _reconstitute
    _restore_plugin_configs(config, renewalparams)
  File "/usr/lib/python2.7/dist-packages/certbot/renewal.py", line 151, in _restore_plugin_configs
    if config_item.startswith(plugin_prefix + "_") and not cli.set_by_cli(config_item):
  File "/usr/lib/python2.7/dist-packages/certbot/cli.py", line 217, in set_by_cli
    if not isinstance(getattr(detector, var), _Default):
AttributeError: 'Namespace' object has no attribute 'apache_vhost_root'


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
** DRY RUN: simulating 'certbot renew' close to cert expiry
**          (The test certificates below have not been saved.)

No renewals were attempted.

Additionally, the following renewal configurations were invalid: 
  /etc/letsencrypt/renewal/****.***.conf (parsefail)
** DRY RUN: simulating 'certbot renew' close to cert expiry
**          (The test certificates above have not been saved.)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Exiting abnormally:
Traceback (most recent call last):
  File "/usr/bin/certbot", line 9, in <module>
    load_entry_point('certbot==0.27.0', 'console_scripts', 'certbot')()
  File "/usr/lib/python2.7/dist-packages/certbot/main.py", line 1364, in main
    return config.func(config, plugins)
  File "/usr/lib/python2.7/dist-packages/certbot/main.py", line 1276, in renew
    renewal.handle_renewal_request(config)
  File "/usr/lib/python2.7/dist-packages/certbot/renewal.py", line 455, in handle_renewal_request
    len(renew_failures), len(parse_failures)))
Error: 0 renew failure(s), 1 parse failure(s)
Please see the logfiles in /var/log/letsencrypt for more details.


# cat /etc/letsencrypt/renewal/****.***.conf 
# renew_before_expiry = 30 days
cert = /etc/letsencrypt/live/****.***/cert.pem
privkey = /etc/letsencrypt/live/****.***/privkey.pem
chain = /etc/letsencrypt/live/****.***/chain.pem
fullchain = /etc/letsencrypt/live/****.***/fullchain.pem
version = 0.23.0
archive_dir = /etc/letsencrypt/archive/****.***

# Options and defaults used in the renewal process
[renewalparams]
installer = apache
authenticator = apache
account = ***
apache_vhost_root = /etc/apache2/sites-available

Something may have broken your python, or certbot, packages.
Try reinstalling certbot:

Ah.

Didn’t have the PPA added, so was on an older version.
Also hadn’t added python3-certbot-apache.
All better now. Successfully renewed. Thanks!

–Jon

2 Likes

Hi,

Thank you for the solution…Indeed the Namespace issue is due to the missing python3-certbot-apache…

Kr,

1 Like

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