Modifying "pg_hba.conf" file under /storage/db/vpostgres will prevent lookupsvc service from starting
search cancel

Modifying "pg_hba.conf" file under /storage/db/vpostgres will prevent lookupsvc service from starting

book

Article ID: 390944

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Modifying the "pg_hba.conf" file manually may affect the functionality of LookupService

Environment

vCenter Server 7.0.x

Cause

Even though postgres service is in running state, we will see the below entries.

lookupserver-default.log:


[YYYY-MM-DDT##-##-##-#### localhost-startStop-1 INFO  com.vmware.vim.lookup.impl.LdapStorage] Begin LdapStorage initialization...
[YYYY-MM-DDT##-##-##-#### localhost-startStop-1 INFO  com.vmware.vim.lookup.impl.LdapStorage]   Initialization parameters:
[YYYY-MM-DDT##-##-##-#### localhost-startStop-1 INFO  com.vmware.vim.lookup.impl.LdapStorage]     Host : <vcenter-fqdn>
[YYYY-MM-DDT##-##-##-#### localhost-startStop-1 INFO  com.vmware.vim.lookup.impl.LdapStorage]     LocalDomainId : YYYY-MM-DD###-##-##-####
[YYYY-MM-DDT##-##-##-#### localhost-startStop-1 INFO  com.vmware.vim.lookup.impl.LdapStorage]     Site : DR
[YYYY-MM-DDT##-##-##-#### localhost-startStop-1 INFO  com.vmware.vim.lookup.impl.LdapStorage] LdapStorage initialized successfully
[YYYY-MM-DDT##-##-##-#### localhost-startStop-1 INFO  com.vmware.vcenter.lookupsvc.sync.subscribable.SubscribableFactory] HybridVC_SyncaaS Enabled, creating SubscribableImpl
[YYYY-MM-DDT##-##-##-#### localhost-startStop-1 INFO  com.vmware.sync.subscribe.SusbscribeDbStore] Initializing Subscribe DB table
[YYYY-MM-DDT##-##-##-#### localhost-startStop-1 INFO  com.vmware.sync.subscribe.SusbscribeDbStore] Failed to connect to Database. Retry connection..
[YYYY-MM-DDT##-##-##-#### localhost-startStop-1 INFO  com.vmware.sync.subscribe.SusbscribeDbStore] Sleeping for 15 seconds before retry.
[YYYY-MM-DDT##-##-##-#### localhost-startStop-1 ERROR com.vmware.sync.subscribe.SusbscribeDbStore] Failed to create table lookupsvc_subscriptions
init method failed; nested exception is java.sql.SQLException: unable to connect to database: localhost:5432/VCDB
[YYYY-MM-DDT##-##-##-#### localhost-startStop-1 ERROR org.springframework.web.context.ContextLoader] Context initialization failed


vCert tool fails with below error :


LDAPS Identity Source certificates
Traceback (most recent call last):
  File "/usr/lib/vmware-wcp/decryptK8Pwd.py", line 94, in <module>
    main()
  File "/usr/lib/vmware-wcp/decryptK8Pwd.py", line 78, in main
    port=connectionInfo[1])
  File "/usr/lib/python3.7/site-packages/psycopg2/__init__.py", line 130, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: FATAL:  no pg_hba.conf entry for host "127.0.0.1", user "wcpuser", database "VCDB", SSL on
FATAL:  no pg_hba.conf entry for host "127.0.0.1", user "wcpuser", database "VCDB", SSL off

 

 

Resolution

1. Take snapshot of vCenter (offline snapshots if linked vCenters (or) online snapshot if stand alone vCenter)

2  Replace the manually entered IP address in the file /storage/db/vpostgres/pg_hba.conf with the loopback IP address 127.0.0.1, as shown below:

3. Once the changes are applied, restart the vCenter services to ensure that the lookupsvc service starts without issues.