@Everyone,
In the recent days or weeks, a Let´s Encrypt related issue was re-occurring on the Plesk Forum.
SYMPTOM: error notification of the kind and/or with the text "Unable to set certificate name".
The solution is quite simple and can be found on:
Error "Unable to set certificate name :" · plesk/letsencrypt-plesk Wiki · GitHub
In short, thanks to @EugeneKazakov !!
However, for the sake of convenience, I will provide the steps to be followed in chronological order
1) login to SSH
2) verify the existence of the certificate by running the command:
plesk db "select id, name from certificates where name = 'Lets Encrypt <sub>.<domain>.<tld>'"
3) check for inconsistencies by running the command:
plesk db "select c.id, c.name, r.rep_id, d.name from certificates c left join Repository r on (c.id = r.component_id) left join domains d on (r.rep_id = d.cert_rep_id) where r.rep_id not in (select val from misc where param = 'cert_rep_id') or r.rep_id is null"
and note that the first column "name" is the Let´s Encrypt certificate name, whereas the second column "name" is the domain in which the Let´s Encrypt certificate has been applied, implying that
a - if you have a NULL in the second "name" column, then it is safe to remove the certificate
b - if you do not have a NULL in the second "name" column, then it is also safe to remove the certificate, but this is also indicating a root cause of another problem,
and note that the before mentioned root cause of the problem is not often related to the Plesk Let´s Encrypt extension, but to some external issues, being mostly database corruption due to (amongst others)
- faulty migration
- backup/restore sequences
- manually running the Let´s Encrypt commands from the command line
and so on.
4) clean up the database by running the commands (in the order mentioned below):
plesk db "delete r.* from Repository r inner join certificates c on (r.component_id = c.id) where c.name = 'Lets Encrypt <sub>.<domain>.<tld>'"
plesk db "delete from certificates where name = 'Lets Encrypt <sub>.<domain>.<tld>'"
5) in order to be sure, update the Plesk Let´s Encrypt extension:
- go to "Extensions > Extension Catalog (click) > Let´s Encrypt (click upgrade)"
6) install a new certificate on <sub>.<domain>.<tld> by:
- using the Plesk Let´s Encrypt Extension: go to "Extensions > Let´s Encrypt (click)", OR
- using the Plesk Panel: go to "Domains > [ <sub>.<domain>.<tld> ] (select) > Let´s Encrypt (click)"
and that would suffice to install a proper certificate without error notifications.
If it does not work, just post in this thread.
Hope the above helps!
Regards........
In the recent days or weeks, a Let´s Encrypt related issue was re-occurring on the Plesk Forum.
SYMPTOM: error notification of the kind and/or with the text "Unable to set certificate name".
The solution is quite simple and can be found on:
Error "Unable to set certificate name :" · plesk/letsencrypt-plesk Wiki · GitHub
In short, thanks to @EugeneKazakov !!
However, for the sake of convenience, I will provide the steps to be followed in chronological order
1) login to SSH
2) verify the existence of the certificate by running the command:
plesk db "select id, name from certificates where name = 'Lets Encrypt <sub>.<domain>.<tld>'"
3) check for inconsistencies by running the command:
plesk db "select c.id, c.name, r.rep_id, d.name from certificates c left join Repository r on (c.id = r.component_id) left join domains d on (r.rep_id = d.cert_rep_id) where r.rep_id not in (select val from misc where param = 'cert_rep_id') or r.rep_id is null"
and note that the first column "name" is the Let´s Encrypt certificate name, whereas the second column "name" is the domain in which the Let´s Encrypt certificate has been applied, implying that
a - if you have a NULL in the second "name" column, then it is safe to remove the certificate
b - if you do not have a NULL in the second "name" column, then it is also safe to remove the certificate, but this is also indicating a root cause of another problem,
and note that the before mentioned root cause of the problem is not often related to the Plesk Let´s Encrypt extension, but to some external issues, being mostly database corruption due to (amongst others)
- faulty migration
- backup/restore sequences
- manually running the Let´s Encrypt commands from the command line
and so on.
4) clean up the database by running the commands (in the order mentioned below):
plesk db "delete r.* from Repository r inner join certificates c on (r.component_id = c.id) where c.name = 'Lets Encrypt <sub>.<domain>.<tld>'"
plesk db "delete from certificates where name = 'Lets Encrypt <sub>.<domain>.<tld>'"
5) in order to be sure, update the Plesk Let´s Encrypt extension:
- go to "Extensions > Extension Catalog (click) > Let´s Encrypt (click upgrade)"
6) install a new certificate on <sub>.<domain>.<tld> by:
- using the Plesk Let´s Encrypt Extension: go to "Extensions > Let´s Encrypt (click)", OR
- using the Plesk Panel: go to "Domains > [ <sub>.<domain>.<tld> ] (select) > Let´s Encrypt (click)"
and that would suffice to install a proper certificate without error notifications.
If it does not work, just post in this thread.
Hope the above helps!
Regards........