Ident authentication failed for user "zammad"

Infos:

  • Used Zammad version: 5.0.x
  • Used Zammad installation type: package
  • Operating system: CentOS 8.5.2111
  • Browser + version: Microsoft Edge 98.0.1108.62

Expected behavior:

  • Execute “/opt/zammad/contrib/backup/zammad_backup.sh” and create a Back-Up

Actual behavior:

  • connection to database “zammad” failed: FATAL: Ident authentication failed for user “zammad”

Steps to reproduce the behavior:

  • These are my pg_hba.conf-Settings:

“local” is for Unix domain socket connections only
local all all trust

IPv4 local connections:
host all all 127.0.0.1/32 ident

IPv6 local connections:
host all all ::1/128 ident

Allow replication connections from localhost, by a user with the
replication privilege.
local replication all peer
host replication all 127.0.0.1/32 ident
host replication all ::1/128 ident
host all zammad all trust

I already did a reload with “SELECT pg_reload_conf();” in the psql console and a restart with “service porstgresql restart/reload”

I also tried to run the backup-script with “su - zammad” but then I get the error to “double check permissions”

Have you solved the problem? And how?

No, I’m still having this problem. I’ve found a lot about this topic, but nothing worked for me.

The following has helped me

I fixed the problem for my installation:
"Ident authentication failed for user “zammad”

Centos 7.0
Zammad 5.2.x
PostgresSQL 13.7

  1. Edit /var/lib/pgsql/13/data/pg_hba.conf - Change ident to trust for 127.0.0.1
    host all all 127.0.0.1/32 trust

  2. Restart PostgresSQL
    service postgresql restart

  3. Edit /opt/zammad/contrib/backup/functions - Change localhost to 127.0.0.1

 if [ "${DB_ADAPTER}" == "postgresql" ]; then
    *# Ensure that HOST and PORT are not empty, provide defaults if needed*.
    if [ "${DB_HOST}x" == "x" ]; then
      DB_HOST="127.0.0.1"

It works perfect!

Just why?
How about you configure the possible options in config/database.yml instead of fiddling around in files that are not update save…? :slight_smile:

sorry yes: correct:
entry host: 127.0.0.1 in config/database.yml is better.