The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

postgres error after update to 11.28.64

Discussion in 'Database Discussions' started by manokiss, Jan 11, 2011.

  1. manokiss

    manokiss Well-Known Member

    Joined:
    Mar 31, 2002
    Messages:
    571
    Likes Received:
    0
    Trophy Points:
    16
    got by email after the cron ran

    /usr/bin/test -x /scripts/update_db_cache && /scripts/update_db_cache


    psql: FATAL: Ident authentication failed for user "postgres"


    just wondering if is a bug or something you forgot to update in pgsql?
     
  2. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    What version of PostgreSQL is installed?

    What steps were used to install PostgreSQL?

    Ident authentication should not be used in the PostgreSQL configuration. If PgSQL is configured to use ident authentication this leads me to believe that initial setup was not yet completed. Please review the following documentation: Installing or Updating PostgreSQL on Your cPanel & WHM Server
     
  3. manokiss

    manokiss Well-Known Member

    Joined:
    Mar 31, 2002
    Messages:
    571
    Likes Received:
    0
    Trophy Points:
    16
    Thanx for the reply Don.

    I have installed in almost a year before running /scripts/installpostgres

    current version is 8.1.22

    To run again the initial setup through whm, should i take care of dbases? i mean running again the initial setup can effect somehow to the existing dbases?

    Thanx!
     
  4. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    As a precautionary measure, I recommend ensuring there is an up-to-date backup of PostgreSQL data; however, I would not foresee any severe difficulty from just installing the initial PostgreSQL authentication configuration and password via WebHost Manager: WHM: Main >> SQL Services >> Postgres Config

    The Postgres Config Install in WHM will setup the following configuration file:
    Code:
    /var/lib/pgsql/data/pg_hba.conf
    Here is an example of the authentication configuration that would be installed from WHM:
    Code:
    local all all        md5
    host all all  127.0.0.1   255.255.255.255   md5
    Here is an equivalent example from the stock-default "pg_hba.conf" file after ident is changed to md5:
    Code:
    # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
    
    # "local" is for Unix domain socket connections only
    local   all         all                               md5
    # IPv4 local connections:
    host    all         all         127.0.0.1/32          md5
    # IPv6 local connections:
    host    all         all         ::1/128               md5
    After the PostgreSQL configuration is setup to use MD5 authentication, please ensure to set a Postgres Password via the same area in WebHost Manager.

    After setting the Postgres Password via WHM, please access SSH to test the command that previously exhibited an authentication error from PostgreSQL:
    Code:
    # /scripts/update_db_cache
     
    #4 cPanelDon, Jan 11, 2011
    Last edited: Jan 11, 2011
  5. manokiss

    manokiss Well-Known Member

    Joined:
    Mar 31, 2002
    Messages:
    571
    Likes Received:
    0
    Trophy Points:
    16
    Thanx!

    The problem is i have no way to login to pgsql as it keeps rejecting the root password....i did reset many times from whm but when i go through command line to make a dump is asking for the root password and keeps rejecting it, so im not sure how should i proceed to make a dump before proceed to run the initial PostgreSQL authentication configuration and password via WebHost Manager.

    Thanx!
     
  6. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,557
    Likes Received:
    7
    Trophy Points:
    38
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    The 'postgres' password is stored in the following file, which should be used for authentication:
    Code:
    /root/.pgpass
    Does the "~/.pgpass" file exist, as seen above?
    Code:
    # stat /root/.pgpass
    It may be necessary to explicitly specify the username that pg_dumpall should use.

    Please try the following command to include a few more CLI switches, including "-v" for verbose output, "-U postgres" to specify the PgSQL username, "-w" to not prompt for a password, and "-f" to specify the output file; in the following example, "/backup/" may be replaced with the desired backup destination directory path:
    Code:
    # pg_dumpall -v -U postgres -w -f /backup/pgsql_db.out
    As a secondary means of backup, the following may be used to create a bzip2-compressed tar archive of the PostgreSQL directory contents within /var/lib/pgsql/:
    Code:
    # tar -cjvf /backup/_var_lib_pgsql.tar.bz2 /var/lib/pgsql
     
  7. dkg

    dkg Member

    Joined:
    Aug 2, 2004
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Just so everyone knows, this also happened to me when upgrading to 11.28.64. The config file had been changed to have the following lines:

    PHP:
    # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD

    # "local" is for Unix domain socket connections only
    local   all         all                               ident sameuser
    # IPv4 local connections:
    host    all         all         127.0.0.1/32          ident sameuser
    # IPv6 local connections:
    host    all         all         ::1/128               ident sameuser
    Changing those lines from 'ident sameuser' to 'md5' fixed the problem.

    Dave G.
     
Loading...

Share This Page