- Plesk for Linux
Note: This article has the reference to the issue with the fix available:
- #EXTLETSENC-676 "If the Let’s Encrypt extension fails to issue or renew certificates, Let’s Encrypt challenge tokens no longer pile up
and slow down the speed of backing up and restoration. The challenge tokens are now automatically deleted after a
defined period of time."
- Let’s Encrypt 2.8.0 28 May 2019
/usr/share/psa-horde/.well-known/acme-challenge/, as well as websites' document root folders (like
/var/www/vhosts/example.com/httpdocs/.well-known/acme-challenge) are becoming populated with an indefinite number of files.
Cleanup is not explicitly disabled in
/usr/local/psa/var/modules/letsencrypt/cli.iniLet's Encrypt configuration file; the following command returns empty output:
# cat /usr/local/psa/var/modules/letsencrypt/cli.ini | grep 'disable-cleanup'
Let's Encrypt extension bug with EXTLETSENC-676 that will be fixed in one of the future extension updates. Let's Encrypt challenge tokens are not removed in case certificate issue/renewal is failed.
These files can be safely removed manually:
Connect to the server via SSH.
Remove the files from the default website and webmail directories:
# rm -rf /var/www/vhosts/default/htdocs/.well-known/acme-challenge/*
# rm -rf /usr/share/psa-horde/.well-known/acme-challenge/*
Note: In case there are thousands of files, the following commands can be used to empty the folders faster:
# mkdir /empty_dir
# rsync -a --delete /empty_dir/ /var/www/vhosts/default/htdocs/.well-known/acme-challenge/
# rsync -a --delete /empty_dir/ /usr/share/psa-horde/.well-known/acme-challenge/
Get a list of the document root directories for all domains and put it into
domains_root_dir.listfile using the following command:
# plesk db -NBe "select www_root from hosting" > domains_root_dir.list
Remove files from these directories using the following command:
# cat domains_root_dir.list | while read i; do echo $i; rm -rf $i/.well-known/acme-challenge/*; done
Note: In case there command above fails due to the amount of files, the following command can be used instead:
# cat domains_root_dir.list | while read i; do echo $i; rsync -a --delete /empty_dir/ $i/.well-known/acme-challenge/; done
Additionally, these commands can be set up as daily Scheduled Tasks. See the following documentation for instructions on setting up tasks: Scheduling Tasks.