Skip to content
This repository has been archived by the owner on Aug 12, 2020. It is now read-only.

Error "Unable to set certificate name :"

Eugene Kazakov edited this page Jun 6, 2016 · 1 revision

The root cause of your failure seems database inconsistency in Plesk: the previous certificate with the same name had not been removed. I guess you created a subdomain, installed a certificate, and then removed it, did not you? Check the certificate is present in Plesk database: plesk db "select id, name from certificates where name = 'Lets Encrypt s0.example.com'"

Check if there is any inconsistency in the database:

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"
+----+-----------------------------------------+--------+-----------------------+
| id | name                                    | rep_id | name                  |
+----+-----------------------------------------+--------+-----------------------+
|  3 | ekazakov-2014                           |      2 | ekazakov.ru           |
|  5 | ekazakov-2015                           |      2 | ekazakov.ru           |
| 27 | Lets Encrypt ekazakov.ru                |      2 | ekazakov.ru           |
| 26 | Lets Encrypt le.testme.ekazakov.ru      |      3 | le.testme.ekazakov.ru |
| 15 | Lets Encrypt new-sub.testme.ekazakov.ru |      4 | NULL                  |
| 28 | Lets Encrypt drupal.ekazakov.ru         |      5 | drupal.ekazakov.ru    |
+----+-----------------------------------------+--------+-----------------------+

Here is a record with NULL - it is orphaned. We should clean it, because Plesk is not able to install a new certificate with the same name and also not able to remove it without link to any domain.

plesk db "delete r.* from Repository r inner join certificates c on (r.component_id = c.id) where c.name = 'Lets Encrypt new-sub.testme.ekazakov.ru'"
plesk db "delete from certificates where name = 'Lets Encrypt new-sub.testme.ekazakov.ru'"

Sum up: there is an issue in Plesk caused inconsistency after subdomain removal. I hope it will be fixed in one of the nearest updates. The inconsistency blocks an installation of new certificates for the same domain name. Fix the inconsistency manually.

The referenced issue was fixed in Plesk 12.5 update 25: http://docs.plesk.com/release-notes/12.5/change-log/#12530-mu25

If a domain with a Let’s Encrypt certificate was removed, another Let’s Encrypt certificate could not be installed on the domain if it was re-created. (PPPM-4166)

Clone this wiki locally