Cannot install Let's Encrypt certificate: DB query failed

Created:

2017-03-31 07:29:16 UTC

Modified:

2017-08-15 03:00:08 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Cannot install Let's Encrypt certificate: DB query failed

Applicable to:

  • Plesk for Linux

Symptoms

Upon clicking install in Plesk > Domains > example.com > Let's Encrypt > Install nothing seems to happen. In /var/log/plesk/panel.log following error can be seen:

# ERR [1] PleskMainDBException: DB query failed:
SELECT `c`.* FROM `certificates` AS `c`
INNER JOIN `Repository` AS `r` ON r.component_id = c.id WHERE (r.rep_id = ?)

Or the following error might be shown in Plesk UI:

PLESK_ERROR: SQLSTATE invalid parameter number: no parameters were bound. 

Cause

Database inconsistency. psa.domains table has cert_rep_id='NULL' for affected domains.

Resolution

1. Back up psa database:

# plesk db dump > /root/psa_db_backup_`date +%F.%s`.sql

2. Change cert_rep_id value to "0" for affected domains.

# plesk db "UPDATE domains SET cert_rep_id = 0 WHERE cert_rep_id IS NULL"

Have more questions? Submit a request
Please sign in to leave a comment.