Corrupted postgresql.conf file prevents the vpostgres vCenter service from starting
search cancel

Corrupted postgresql.conf file prevents the vpostgres vCenter service from starting

book

Article ID: 372436

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

After previously running a file system check from KB article 326323 to repair a vCenter that would not start up, the vCenter now boots up successfully, but is listing the following error on the console:

"Write-error on swap-device"

Restarting the vCenter to run another file system check per the steps in KB article 326323 does not find any issues to repair.  Upon booting the vCenter, the vpostgres service is not starting, preventing dependent services from starting.

The serverlog.stderr log in the /var/log/vmware/vpostgres/ directory states the /storage/db/vpostgres/postgresql.conf file has errors.

When reviewing the latter, you get a message similar to this:

# less /storage/db/vpostgres/postgresql.conf 
"/storage/db/vpostgres/postgresql.conf" may be a binary file.  See it anyway?

Upon confirmation, all you see is a lot of "^@" as in the following screenshot:

 

 

Environment

  • VMware vCenter Server 7.0.x
  • VMware vCenter Server 8.0.x

Cause

This is due to the /storage/db/vpostgres/postgresql.conf, normally a text file containing configurations for the embedded vPostgres database, having been corrupted.

 

Resolution

To solve this issue, try replacing the /storage/db/vpostgres/postgresql.conf against the same file from a working VCSA that has the same version and build.

  • Take a snapshot of the vCenter
  • Rename the existing postgresql.conf file
  • Copy the postgresql.conf file from another vCenter of the same version and build and place it in the /storage/db/vpostgres/ directory of the affected vCenter.
  • Restart the vCenter Services
    service-control --stop --all && service-control --start --all
  • If the issue persists despite taking these steps, consider restoring the vCenter Server Appliance from its last known good backup

Additional Information

If replacing the postgresql.conf file allows the vpostres service to start and the rest of the vCenter services start up successfully, it is highly recommend to run a VAMI file based backup of the vCenter that can be used to perform a restoration of the vCenter if necessary. The following documentation details the VAMI backup and restore process: