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

Double brackets in webroot_map prevent from updating letsencrypt #1151

Open
raratiru opened this issue Oct 23, 2019 · 8 comments
Open

Double brackets in webroot_map prevent from updating letsencrypt #1151

raratiru opened this issue Oct 23, 2019 · 8 comments
Labels
bug Something isn't working

Comments

@raratiru
Copy link

Describe the bug

Letsencrypt fails renewal due to webroot not beeing set.

# journalctl -n 100 -u snap.nextcloud.renew-certs
-- Logs begin at Wed 2019-10-23 00:44:10 EEST, end at Wed 2019-10-23 19:11:09 EEST. --
[673]: Saving debug log to /var/snap/nextcloud/current/certs/certbot/logs/letsencrypt.log
[673]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[673]: Processing
[673]: /var/snap/nextcloud/current/certs/certbot/config/renewal/example.com.conf
[673]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[673]: Cert is due for renewal, auto-renewing...
[673]: Non-interactive renewal: random delay of 67 seconds
[673]: Plugins selected: Authenticator webroot, Installer None
[673]: Renewing an existing certificate
[673]: Performing the following challenges:
[673]: http-01 challenge for example.com
[673]: http-01 challenge for www.example.com
[673]: Cleaning up challenges
[673]: Attempting to renew cert (example.com) from /var/snap/nextcloud/current/certs/certbot/config/renewal/example.com.conf produced an unexpected error:
[673]: Select the webroot for example.com:
[673]: Choices: ['Enter a new webroot', '/var/snap/nextcloud/current/certs/certbot']
[673]: (You can set this with the --webroot-path flag). Skipping.
[673]: All renewal attempts failed. The following certs could not be renewed:
[673]:   /var/snap/nextcloud/current/certs/certbot/config/live/example.com/fullchain.pem (failure)
[673]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[673]: All renewal attempts failed. The following certs could not be renewed:
[673]:   /var/snap/nextcloud/current/certs/certbot/config/live/example.com/fullchain.pem (failure)
[673]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[673]: Running post-hook command: restart-apache
[673]: Output from post-hook command restart-apache:
[673]: Restarting apache... done
[673]: 1 renew failure(s), 0 parse failure(s)

In letsencrypt.log among the error lines the message is:

MissingCommandlineFlag: Missing command line flag or config entry for this setting:
Select the webroot for example.com:
Choices: ['Enter a new webroot', '/var/snap/nextcloud/current/certs/certbot']

Although:

# cat /var/snap/nextcloud/current/certs/certbot/config/renewal/example.com.conf
# renew_before_expiry = 30 days
version = 0.33.1
archive_dir = /var/snap/nextcloud/current/certs/certbot/config/archive/example.com
cert = /var/snap/nextcloud/current/certs/certbot/config/live/example.com/cert.pem
privkey = /var/snap/nextcloud/current/certs/certbot/config/live/example.com/privkey.pem
chain = /var/snap/nextcloud/current/certs/certbot/config/live/example.com/chain.pem
fullchain = /var/snap/nextcloud/current/certs/certbot/config/live/example.com/fullchain.pem

# Options used in the renewal process
[renewalparams]
account = 3edbd5ec965cb7b71e6bf05e0ff5d908
work_dir = /var/snap/nextcloud/current/certs/certbot/work
config_dir = /var/snap/nextcloud/current/certs/certbot/config
server = https://acme-v02.api.letsencrypt.org/directory
authenticator = webroot
logs_dir = /var/snap/nextcloud/current/certs/certbot/logs
rsa_key_size = 4096
webroot_path = /var/snap/nextcloud/current/certs/certbot,
[[webroot_map]]
www.example.com = /var/snap/nextcloud/current/certs/certbot

I am running on Debian GNU/Linux 10 (buster)

# snap list nextcloud
Name       Version      Rev    Tracking  Publisher   Notes
nextcloud  16.0.5snap2  16402  stable    nextcloud✓  -

# snap version
snap    2.42
snapd   2.42
series  16
debian  10
kernel  4.19.0-6-amd64
@raratiru raratiru changed the title Cannot renew certificate: Missing config for webroot Double brackets in webroot_map prevent from updating letsencrypt Oct 25, 2019
@raratiru
Copy link
Author

The error was in /var/snap/nextcloud/current/certs/certbot/config/renewal/example.com.conf.
[[webroot_map]] should have been [webroot_map].

@mateuszkwiatkowski
Copy link

I'm seeing the same issue with 16.0.5snap3. Removing extra brackets in domain_name.conf resolved the issue.

# snap version
snap    2.42
snapd   2.42
series  16
ubuntu  18.04
kernel  4.15.0-66-generic

@luixxiul luixxiul added the bug Something isn't working label Jan 18, 2020
@avilleret
Copy link

This issue is still present in 21.0.1snap2. Removing extra brackets in domain_name.conf resolved the issue.

$ snap version
snap    2.51.1
snapd   2.51.1
series  16
ubuntu  20.04
kernel  5.4.0-74-generic

@github-actions
Copy link

This issue is stale because it has been without activity for 60 days. It will be closed after 7 more days of inactivity.

@github-actions github-actions bot added the Stale label Oct 14, 2021
@r4co0n
Copy link
Contributor

r4co0n commented Oct 14, 2021

This error is still present:

root@test-nextcloud:~# grep webroot_map /var/snap/nextcloud/current/certs/certbot/config/renewal/*.conf
[[webroot_map]]
root@test-nextcloud:~# uname -ar
Linux test-nextcloud 5.4.0-88-generic #99-Ubuntu SMP Thu Sep 23 17:29:00 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
root@test-nextcloud:~# grep webroot_map /var/snap/nextcloud/current/certs/certbot/config/renewal/*.conf
[[webroot_map]]

Fresh focal VM, upgraded all packages, rebooted and installed the snap.
This hopefully gets fixed with #1902.

@github-actions github-actions bot removed the Stale label Oct 15, 2021
@github-actions
Copy link

This issue is stale because it has been without activity for 60 days. It will be closed after 7 more days of inactivity.

@github-actions github-actions bot added the Stale label Dec 14, 2021
@avilleret
Copy link

I don't think this issue has been solve yet, so Dear Bot, please let it open. Thanks

@github-actions github-actions bot removed the Stale label Dec 15, 2021
@xandark
Copy link

xandark commented Oct 8, 2023

This issue is still present, I am so grateful that I found a patch solution here. This needs to be fixed, it just seems to be a matter of not having double brackets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants