SDDC Manager upgrade fails during reboot stage due to Commonsvcs service not starting
search cancel

SDDC Manager upgrade fails during reboot stage due to Commonsvcs service not starting

book

Article ID: 416059

calendar_today

Updated On:

Products

VMware SDDC Manager

Issue/Introduction

During an upgrade of SDDC Manager, the upgrade process may fail when the Commonsvcs service fails to start after a reboot.

It is normal for the SDDC Manager to reboot during the upgrade process, as various management components are updated and restarted to apply changes and initialize new service versions. However, in this scenario, the Commonsvcs service remains down post-reboot, causing the upgrade to fail.

Environment

VMware Cloud Foundation 5.2.x

Cause

The following PostgreSQL connection error is observed in the /var/log/messages file:

YYYY-MM-DD HH:MM:SS 1348196-sddc01-#### bash[387062]: psql: error: connection to server at "localhost" (172.##.#.##), port 5432 failed: FATAL: no pg_hba.conf entry for host "172.##.#.##", user "postgres", database "postgres", no encryption


The issue occurs even though the Postgres user is already configured as a system user (as described in KB 381603), but the /etc/hosts file incorrectly resolves localhost to a local NAT IP address (e.g., 172.##.#.##) instead of the default loopback address (127.0.0.1).

This misconfiguration prevents PostgreSQL and dependent services, such as Commonsvcs, from connecting locally, resulting in startup failure.

Resolution

To resolve the issue, ensure that the /etc/hosts file correctly maps the localhost entry to the loopback address 127.0.0.1.
It is not recommended to modify the localhost entry to any other IP address.

Steps to resolve

  1. Take a snapshot of the SDDC Manager virtual machine before making any changes.

  2. Create a backup of the current hosts file:

    cp /etc/hosts /etc/hosts.backup

  3. Edit the /etc/hosts file and ensure that the localhost Entry is configured as follows:

    127.0.0.1 localhost

    e.g. hosts file

    # Begin /etc/hosts
    
    127.0.0.1   localhost.localdomain
    127.0.0.1   localhost <<<< ( Correct localhost entry )
    127.0.0.1   photon# End /etc/hosts
    127.0.0.1   sddc.xyz.local
    hosts (END)
    

     

  4. Save the changes and retry the upgrade.

After correcting the localhost entry, the SDDC Manager will reboot successfully, and all services, including Commonsvcs, will start as expected.

Additional Information

The IP address 127.0.0.1 (loopback address) ensures that local services and applications, such as databases, can communicate internally within the same system.
When localhost resolves correctly to 127.0.0.1, local connections (for example, PostgreSQL queries) function as intended without requiring external network access.