Massive Error log, ValueError: unable to insert label! An unexpected error occurred

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: sandimountains.applepi.nl

I ran this command: sudo certbot --apache

It produced this output:

2020-03-09 21:07:43,003:DEBUG:acme.client:Storing nonce: 0002Rw-7FMBICjQN4Z39h8sCW0gqu0ohvnlc1NybO9dAmz4
2020-03-09 21:07:43,003:INFO:certbot._internal.auth_handler:Performing the following challenges:
2020-03-09 21:07:43,003:INFO:certbot._internal.auth_handler:http-01 challenge for sandimountains.applepi.nl
2020-03-09 21:07:43,035:DEBUG:certbot_apache._internal.http_01:Adding a temporary challenge validation Include for name: None in: /etc/apache2/vhosts.d/webmin.1583783 $
2020-03-09 21:07:43,035:DEBUG:certbot._internal.error_handler:Encountered exception:
Traceback (most recent call last):
File “/usr/lib/python2.7/site-packages/certbot/_internal/auth_handler.py”, line 70, in handle_authorizations
resps = self.auth.perform(achalls)
File “/usr/lib/python2.7/site-packages/certbot_apache/_internal/configurator.py”, line 2301, in perform
http_response = http_doer.perform()
File “/usr/lib/python2.7/site-packages/certbot_apache/_internal/http_01.py”, line 76, in perform
self._mod_config()
File “/usr/lib/python2.7/site-packages/certbot_apache/_internal/http_01.py”, line 116, in _mod_config
self._set_up_include_directives(vh)
File “/usr/lib/python2.7/site-packages/certbot_apache/_internal/http_01.py”, line 201, in _set_up_include_directives
vhost.path, “Include”, self.challenge_conf_pre)
File “/usr/lib/python2.7/site-packages/certbot_apache/_internal/parser.py”, line 524, in add_dir_beginning
self.aug.insert(first_dir, “directive”, True)
File “/usr/lib/python2.7/site-packages/augeas.py”, line 369, in insert
raise ValueError(“Unable to insert label!”)
ValueError: Unable to insert label!

2020-03-09 21:07:43,036:DEBUG:certbot._internal.error_handler:Calling registered functions
2020-03-09 21:07:43,036:INFO:certbot._internal.auth_handler:Cleaning up challenges
2020-03-09 21:07:43,219:DEBUG:certbot._internal.log:Exiting abnormally:
Traceback (most recent call last):
File “/usr/bin/certbot”, line 11, in
load_entry_point(‘certbot==1.0.0’, ‘console_scripts’, ‘certbot’)()
File “/usr/lib/python2.7/site-packages/certbot/main.py”, line 14, in main
return internal_main.main(cli_args)
File “/usr/lib/python2.7/site-packages/certbot/_internal/main.py”, line 1350, in main
return config.func(config, plugins)
File “/usr/lib/python2.7/site-packages/certbot/_internal/main.py”, line 1105, in run
certname, lineage)
File “/usr/lib/python2.7/site-packages/certbot/_internal/main.py”, line 121, in _get_and_save_cert
lineage = le_client.obtain_and_enroll_certificate(domains, certname)
File “/usr/lib/python2.7/site-packages/certbot/_internal/client.py”, line 416, in obtain_and_enroll_certificate
cert, chain, key, _ = self.obtain_certificate(domains)
File “/usr/lib/python2.7/site-packages/certbot/_internal/client.py”, line 347, in obtain_certificate
orderr = self._get_order_and_authorizations(csr.data, self.config.allow_subset_of_names)
File “/usr/lib/python2.7/site-packages/certbot/_internal/client.py”, line 395, in _get_order_and_authorizations
authzr = self.auth_handler.handle_authorizations(orderr, best_effort)
File “/usr/lib/python2.7/site-packages/certbot/_internal/auth_handler.py”, line 70, in handle_authorizations
resps = self.auth.perform(achalls)
File “/usr/lib/python2.7/site-packages/certbot_apache/_internal/configurator.py”, line 2301, in perform
http_response = http_doer.perform()
File “/usr/lib/python2.7/site-packages/certbot_apache/_internal/http_01.py”, line 76, in perform
self._mod_config()
File “/usr/lib/python2.7/site-packages/certbot_apache/_internal/http_01.py”, line 116, in _mod_config
self._set_up_include_directives(vh)
File “/usr/lib/python2.7/site-packages/certbot_apache/_internal/http_01.py”, line 201, in _set_up_include_directives
vhost.path, “Include”, self.challenge_conf_pre)
File “/usr/lib/python2.7/site-packages/certbot_apache/_internal/parser.py”, line 524, in add_dir_beginning
self.aug.insert(first_dir, “directive”, True)
File “/usr/lib/python2.7/site-packages/augeas.py”, line 369, in insert
raise ValueError(“Unable to insert label!”)
ValueError: Unable to insert label!
2020-03-09 21:07:43,220:ERROR:certbot._internal.log:An unexpected error occurred:

My web server is (include version): Apache version 2.4.33

The operating system my web server runs on is (include version): Opensuse leap 15.1

My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don’t know): yes

I’m using a control panel to manage my site (no, or provide the name and version of the control panel):
webmin

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot): certbot 1.0.0

Hi @jzneter,

It looks like you have likely identified a bug in Certbot’s Apache integration—it appears that Certbot was unable to understand your Apache configuration, which is probably Certbot’s own fault. It would be helpful if you could share the file contents in /etc/apache2/vhosts.d so we could better understand how Certbot got confused about this.

Having said that, it looks like you might be using Webmin. Webmin has its own Let’s Encrypt support inside its interface and you’re probably better off using that rather than trying to combine Webmin with Certbot on the same web server (they can conflict with each other).

https://doxfer.webmin.com/Webmin/Let’s_Encrypt

1 Like

Hi, inside of it are three files

Last login: Mon Mar 9 20:41:04 2020 from
Have a lot of fun…
etc/apache2/vhosts.d # dir
total 16
-rw-r–r-- 1 root root 1665 Feb 25 12:06 vhost-ssl.template
-rw-r–r-- 1 root root 4815 Feb 25 12:06 vhost.template
-rw-r–r-- 1 root root 58 Mar 9 21:06 webmin.1583783574.conf

Could we see the contents of webmin.1583783574.conf? It seems like it might not be a complete Apache virtual host configuration file since it’s so small.

Yup, seems pretty empty

GNU nano 2.9.6 webmin.1583783574.conf

                             [ Read 2 lines ]

^G Get Help ^O Write Out ^W Where Is ^K Cut Text ^J Justify ^C Cur Pos
^X Exit ^R Read File ^\ Replace ^U Uncut Text^T To Spell ^_ Go To Line

The forum’s formatting is hiding

<VirtualHost sandimountains.applepi.nl:80>
</VirtualHost>

Thanks for sharing that. I think this is mostly a Webmin issue (because Webmin shouldn’t create a completely empty virtual host and then leave it in place), but could also be considered a Certbot issue (because Certbot shouldn’t crash when encountering this).

I created this issue

For your particular situation, the best course of action is probably to try using the existing Let’s Encrypt support inside of Webmin.