Ad Widget

Collapse

FATAL: password authentication failed for user "zabbix" using Postgres

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • boatcoder
    Junior Member
    • Jul 2022
    • 9

    #1

    FATAL: password authentication failed for user "zabbix" using Postgres

    This is the error:

    Code:
    55828:20220721:155041.425 [Z3001] connection to database 'zabbix' failed: [0] connection to server at "127.0.0.1", port 5432 failed: FATAL: password authentication failed for user "zabbix"
    connection to server at "127.0.0.1", port 5432 failed: FATAL: password authentication failed for user "zabbix"
    The Server Config:
    Code:
    DBHost=127.0.0.1
    DBName=zabbix
    DBPassword='redactedPassword'
    DBPort=5432
    DBSchema=public
    DBUser=zabbix
    Fping6Location=/usr/bin/fping6
    FpingLocation=/usr/bin/fping
    LogFileSize=0
    LogFile=/var/log/zabbix/zabbix_server.log
    LogSlowQueries=3000
    PidFile=/run/zabbix/zabbix_server.pid
    SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
    SocketDir=/run/zabbix
    StatsAllowedIP=127.0.0.1
    Timeout=4
    The restart comand I used after all the changes:
    Code:
    systemctl restart zabbix-server zabbix-agent nginx php8.1-fpm [email protected]
    pg_hba.conf contains:
    Code:
    host    zabbix        zabbix        127.0.0.1/32        trust
    Which I don't like but I'm a bit desperate at the moment and can resolve this once I get a connection working:

    And this is me connecting to the DB using the password that is actually in the server config
    Code:
    root@zabbix:~# psql --user zabbix zabbix --password --host 127.0.0.1
    Password:
    psql (14.4 (Ubuntu 14.4-0ubuntu0.22.04.1))
    SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
    Type "help" for help.
    
    zabbix=>
    What is the missing sauce to make this work? The website works but reports the server is down....
  • Answer selected by boatcoder at 22-07-2022, 01:42.
    Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1781

    DBPassword='redactedPassword'
    There should not be any quotes in the DBPassword configuration (unless the password contains them, of course).

    Markku

    Comment

    • Markku
      Senior Member
      Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
      • Sep 2018
      • 1781

      #2
      DBPassword='redactedPassword'
      There should not be any quotes in the DBPassword configuration (unless the password contains them, of course).

      Markku

      Comment

      • boatcoder
        Junior Member
        • Jul 2022
        • 9

        #3
        That appears to have fixed it. My initial password contained spaces and wasn't working, I changed it to have no spaces but left the quotes. Seems strange that the parser treats the quotes as part of the password, but at least I could remove the
        Code:
        trust
        from hba_conf file.

        Comment

        Working...