How To Resolve Postgres Ident Authentication for "tamr" User Issue?

Problem: While starting tamr, it gives the error FATAL: Ident authentication failed for user "tamr" as shown below:

Starting unify-all on port 9100 with pid 14149

Will ping unify-all with 50 retries (configurable with TAMR_SERVICES_START_UP_NUMBER_OF_RETRIES) and 6 seconds (configurable with TAMR_SERVICES_START_UP_RETRY_INTERVAL_SECONDS) between each retry.

Failed to start unify-all, printing logs & halting

==> /var/data/tamr/tamr/logs/unify-all.error.log <==

            ... 10 more

Caused by: org.postgresql.util.PSQLException: FATAL: Ident authentication failed for user "tamr"

            at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:438)

            at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:222)

            at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)

            at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:194)

            at org.postgresql.Driver.makeConnection(Driver.java:450)

            at org.postgresql.Driver.connect(Driver.java:252)

            at org.flywaydb.core.internal.util.jdbc.DriverDataSource.getConnectionFromDriver(DriverDataSource.java:416)

            ... 17 more




==> /var/data/tamr/tamr/logs/unify-all.out.log <==

Cause: This may happen when an incorrect authentication method is used in pg_hba.conf file (Postgres Configuration file).


Resolution: To resolve the issue, take the following steps:

Step 1: Update the pg_hba.conf for IPv4 and IPv6 with authentication method as shown below

# IPv4 local connections:

host    all             all             127.0.0.1/32            md5

# IPv6 local connections:

host    all             all             ::1/128                 md5

Step 2: Restart the database.

sudo systemctl restart postgresql-12.service