ValueError during AWS AMI Linux certbot install

Hi There

I have an AWS EC2 AMI Linux machine. I installed certbot as per the installation instructions and then ran it to install certs for the domains on the machine. Certbot failed with the following error:
2017-07-12 21:51:19,601:DEBUG:certbot.error_handler:Encountered exception:
Traceback (most recent call last):
File “/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/certbot/client.py”, line 451, in deploy_certificate
fullchain_path=fullchain_path)
File “/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/certbot_apache/configurator.py”, line 245, in deploy_cert
vhost = self.choose_vhost(domain)
File “/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/certbot_apache/configurator.py”, line 339, in choose_vhost
self._add_servername_alias(target_name, vhost)
File “/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/certbot_apache/configurator.py”, line 1150, in _add_servername_alias
self.parser.add_dir(vh_path, “ServerAlias”, target_name)
File “/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/certbot_apache/parser.py”, line 245, in add_dir
self.aug.set(aug_conf_path + “/directive[last() + 1]”, directive)
File “/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/augeas.py”, line 187, in set
raise ValueError(“Unable to set value to path!”)
ValueError: Unable to set value to path!
I tried doing this with apache running and then stopped. No difference.
Any ideas? Thanks,
Howard

@SwartzCr, could you take a look at this?

Thanks for the quick response. I have the .log file if you need that. As a new user I can’t upload attachments. So you can find it here.
Howard

So unfortunately we don’t officially support amazon linux - so my recommendations will be a bit sparse.
It seems like the problem you’re having is with the Augeas package that we use with the apache plug-in. Augeas is what edits your apache configurations to add ssl directives, and what is happening here is that it’s trying to find the proper vhost for the domain mentioned in your certificate, and getting an error.
It’d be helpful if you could provide a list of all of the certificates you have, and all of the domain names included in them, as well as a list of all of the virtual hosts you have, and which domain names are in them. If you look at the choose_vhost function in configurator.py (https://github.com/certbot/certbot/blob/master/certbot-apache/certbot_apache/configurator.py#L308) you’ll see that we’re trying to add the domain name to the virtual host file, and then having trouble finding that virtual host.
I wouldn’t be able to tell you exactly why without placing debug statements into the code and investigating myself, but a list of domains or vhosts would help us find out if it’s something obvious.
Alternately maybe @joohoi might have seen this issue before and know what’s going on.

Hi There @SwartzCr
There is a reason they pay you the big bucks! I read your reply. The key parts:
"… edits your apache configurations to add ssl directives, and what is happening here is that it’s trying to find the proper vhost for the domain mentioned in your certificate, and getting an error.
It’d be helpful if you could provide a list of all of the certificates you have, and all of the domain names included in them, as well as a list of all of the virtual hosts you have, and which domain names are in them…"
So I discovered that my conf files were not correct - where I was specifying the vhosts. Oops.My fault.
Now working.
Thanks again for your help.Donation is on its way.
Humbly yours :slight_smile:
Howard

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