Error: "Unable to restore the VMware Cloud Director server configuration" and "Invalid database configuration: Error decrypting data" when restoring a Cloud Director database to a new Primary Cell
search cancel

Error: "Unable to restore the VMware Cloud Director server configuration" and "Invalid database configuration: Error decrypting data" when restoring a Cloud Director database to a new Primary Cell

book

Article ID: 371245

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

Customers attempting to restore their production VMware Cloud Director (VCD) encountered an error:
"Invalid database configuration: Error decrypting data."
 
During the restore process, the UI displayed the error message:
"Unable to restore the VMware Cloud Director server configuration."

 

Logs Details

The /opt/vmware/vcloud-director/logs/cell-management-tool.log shows errors of the form:

YYYY-MM-DD HH:MM:SS | ERROR    | main                      | ReconfigureDatabaseCommand     | Invalid database configuration: Error decrypting data. |
com.vmware.vcloud.common.crypto.CryptoException: Error decrypting data.
        at com.vmware.vcloud.common.crypto.AesEncryption.Decrypt(AesEncryption.java:134)
        ...
Caused by: javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
        ...

YYYY-MM-DD HH:MM:SS | ERROR    | main                      | ReconfigureDatabaseCommand     | Invalid database configuration provided. Aborting configuration of local cell. |
YYYY-MM-DD HH:MM:SS | DEBUG    | main                      | CellManagementTool             | Exiting with completion code: OTHER |

Environment

VMware Cloud Director 10.4.x

VMware Cloud Director 10.5.x

Cause

The error was observed during the restore process using a Cloud Director Backup ZIP file.

The error was caused by an issue with decrypting data due to incorrect or missing configuration values in the global.properties file.

Resolution

Steps to Implement the Solution:

  1. Extract the backup ZIP file.
  2. Move the following values from responses.properties to global.properties:
    • database.password
    • user.key.path
    • user.key.password
    • user.certificate.path
    • vcloud.ssl.key.password
  3. Recompress the files into a ZIP archive using the following commands:
    • chmod 0750 <backup name>.zip
    • chown vcloud.vcloud <backup name>.zip
  4. Attempt the restore using the updated ZIP file on the NFS.

    After these steps, the Cloud Director UI should be restored successfully.


 

Additional Information

Check logs

tail -f /opt/vmware/var/log/vcd/restore.log