vPostgres service is failing to start due to errors in configuration files
search cancel

vPostgres service is failing to start due to errors in configuration files

book

Article ID: 308858

calendar_today

Updated On: 03-25-2025

Products

VMware vCenter Server

Issue/Introduction

When attempting to start vPostgres service, you see errors similar to:

#service-control --start vmware-vpostgres

Perform start operation. vmon_profile=None, svc_names=['vmware-vpostgres'], include_coreossvcs=False, include_leafossvcs=False
YYYY-MM-DD_THH:MM:SSZ   Service vmware-vpostgres state STOPPED
Error executing start on service vmware-vpostgres. Details {
    "resolution": null,
    "detail": [
        {
            "args": [
                "vmware-vpostgres"
            ],
            "id": "install.ciscommon.service.failstart",
            "localized": "An error occurred while starting service 'vmware-vpostgres'",
            "translatable": "An error occurred while starting service '%(0)s'"
        }
    ],
    "componentKey": null,
    "problemId": null
}
Service-control failed. Error {
    "resolution": null,
    "detail": [
        {
            "args": [
                "vmware-vpostgres"
            ],
            "id": "install.ciscommon.service.failstart",
            "localized": "An error occurred while starting service 'vmware-vpostgres'",
            "translatable": "An error occurred while starting service '%(0)s'"
        }
    ],
    "componentKey": null,
    "problemId": null
}

In /var/log/vmware/vpostgres/serverlog.stderr on the vCenter Server Appliance, you see errors similar to:

LOG:  syntax error in file "/storage/db/vpostgres/postgresql.conf.auto" line 1, near token ""
LOG:  syntax error in file "/storage/db/vpostgres/postgresql.conf.auto" line 2, near token ""
LOG:  syntax error in file "/storage/db/vpostgres/postgresql.conf.auto" line 3, near token ""
LOG:  syntax error in file "/storage/db/vpostgres/health_status_worker.conf" line 1, near token ""
LOG:  syntax error in file "/storage/db/vpostgres/health_status_worker.conf" line 2, near token ""
LOG:  syntax error in file "/storage/db/vpostgres/health_status_worker.conf" line 3, near token ""
LOG:  syntax error in file "/storage/db/vpostgres/health_status_worker.conf" line 4, near token ""
LOG:  skipping missing configuration file "/storage/db/vpostgres/postgresql.conf.repl"
FATAL:  configuration file "/storage/db/vpostgres/postgresql.conf" contains errors

 

Environment

VMware vCenter Server 6.7.x
VMware vCenter Server 7.x
VMware vCenter Server 8.x

Cause

This is due to corrupted postgresql.conf.auto, postgresql.conf and health_status_worker.conf files in /storage/db/vpostgres/ directory.

Resolution

To resolve the issue, follow the below steps:

  1. Check the errors in the /var/log/vmware/vpostgres/serverlog.stderr.

  2. Note the configuration files that contains errors.
    • LOG:  syntax error in file "/storage/db/vpostgres/postgresql.conf.auto" line 3, near token ""
    • LOG:  syntax error in file "/storage/db/vpostgres/health_status_worker.conf" line 1, near token ""

  3. Open files in vi and compare the content from other working vCenter Server running on the same build version.
    • A typical postgresql.conf.auto file example:
      # /storage/db/vpostgres/postgresql.conf.auto
      # File automatically generated at vPostgres firstboot
      # Do not update manually
      maintenance_work_mem = '201 MB'
      work_mem = '420 kB'
      temp_buffers = '840 kB'
      shared_buffers = '1008 MB'
      max_wal_size = '17512 MB'
      min_wal_size = '17512 MB'
      max_connections = 737
    • A typical health_status_worker.conf file example:
      health_status_worker.naptime = 30
      health_status_worker.expiration_time = 90
      health_status_worker.log = true
      health_status_worker.status_file_path = '/dev/shm/vmware-postgres-health-status.xml'
      health_status_worker.memory_allowed = '2018 MB'
      health_status_worker.disk_space_threshold = 0.05
      health_status_worker.disk_space_log_threshold = 0.05
      health_status_worker.disk_space_wal_threshold = 0.2
      health_status_worker.status_file_group = 'vpgmongrp'
      health_status_worker.memory_file_path = '/sys/fs/cgroup/memory/system.slice/vmware-vpostgres.service/memory.stat'
      health_status_worker.memory_flag = 'rss'
      health_status_worker.replication_slot_check = true
      health_status_worker.replication_slot_drop_threshold = 0.9
      health_status_worker.replication_slot_force_checkpoint = on
    • The postgresql.conf file is vcenter specific so should be referenced but not copied directly.

  4. Take a backups of these files.
    • #cp /storage/db/vpostgres/postgresql.conf.auto /storage/db/vpostgres/postgresql.conf.auto.bak
    • #cp /storage/db/vpostgres/health_status_worker.conf /storage/db/vpostgres/health_status_worker.conf.bak

  5. Correct the files manually to match a known working configuration.  Update permissions as needed.

  6. Start vPostgres service by running service-control --start vmware-vpostgres

Additional Information

Note:
The contents of the postgresql.conf.auto file will be auto updated with new values when vpostgres starts.