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.
VMware Cloud Foundation 5.2.x
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.
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.
Take a snapshot of the SDDC Manager virtual machine before making any changes.
Create a backup of the current hosts file:
cp /etc/hosts /etc/hosts.backupEdit the /etc/hosts file and ensure that the localhost Entry is configured as follows:
127.0.0.1 localhost# 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)
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.
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.