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.

The PostgreSQL server is currently offline.

Discussion in 'General Discussion' started by t04st3d151, Jul 15, 2011.

  1. t04st3d151

    t04st3d151 Member

    Joined:
    Dec 31, 2007
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    cPanel currently thinks that PostgreSQL is offline. When logging into cPanel and going to "Postgresql databases".

    I get the following error "The PostgreSQL server is currently offline."

    However on the server:

    root@dedicated [/var/lib/pgsql/data/pg_log]# service postgresql status
    (pid 7201) is running...

    How do i fix this?

    Any help is muchly appreciated.
    Kindest Regards,
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Are there any errors in /usr/local/cpanel/logs/error_log file location when visiting that area of cPanel? If so, what error are you receiving there?
     
  3. t04st3d151

    t04st3d151 Member

    Joined:
    Dec 31, 2007
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for your reply.

    When going to "Postgresql databases" in cPanel and tailing the log, gives me the following error:

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

    I've reset the password via WHM, under "Postgres Config" but still get this error.
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Please look for .pgpass on the server and see if you have a file in /root/.pgpass as well as /var/lib/pgsql/.pgpass (or /var/lib/pgsql/data/.pgpass). If so, check that both passwords are matching the one you've set in WHM > SQL Services > Postgres Config area.

    Next, please try the following in root SSH:

    Code:
    su - postgres
    psql
    At the password prompt upon entering "psql" command, please enter the password set for postgres user in WHM.
     
  5. t04st3d151

    t04st3d151 Member

    Joined:
    Dec 31, 2007
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    The password is the same in /root/.pgpass and /var/lib/pgsql/.pgpass and matches the WHM password set for Postgres Config.

    Code:
    root@dedicated [~]# su - postgres
    -bash-3.2$ psql
    Password:
    psql: FATAL:  password authentication failed for user "postgres"
    I get the above error, when entering that same (correct) password after the psql command.
     
  6. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    At this point, please submit a ticket and post the ticket number here for us to investigate further. A ticket can be opened using the link in my signature or WHM > Support Center > Contact cPanel location.
     
  7. t04st3d151

    t04st3d151 Member

    Joined:
    Dec 31, 2007
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Hi Tristan,

    Thanks for your help, i have submitted a cPanel ticket.

    Support Request Id: 1756473
     
  8. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    I was off shift when your ticket was received so I've reviewed how it was handled today. It appears that a newer version of PostgreSQL was installed (8.4.4) than the currently installed copy of 8.1.23:

    Code:
    root@dedicated [~]# psql -U postgres 
    psql (8.4.4) 
    This is the output onto my machine for another way to grab the version:

    Code:
    root@host [/]# psql --version
    psql (PostgreSQL) 8.1.23
    contains support for command-line editing
    The additional repository for yum was likely grabbing the newer version of /etc/yum.repos.d/pgdg-84-centos.repo which was specifically designed to pull a newer copy of postgres over the one we provide.

    If you end up having any future issues with postgres, we would definitely need to ensure that the cPanel version is being used, since we only support the latest version provided by the default CentOS repositories.
     
  9. raguilar

    raguilar Registered

    Joined:
    Nov 13, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Ok, for the not so techie guys like me. If you keep getting this message, i got it fix with postgres 9.2. It wasnt so obvious to me, but i guess the answer is there after all:

    1 Check the password here:
    vim /root/.pgpass

    2 Console for postgres
    su - postgres
    psql

    IF you get wrong password error. Do the following:

    Edit:
    vim /var/lib/pgsql/9.2/data/pg_hba.conf

    local all all md5 <--- Set this to trust
    host all all 127.0.0.1 255.255.255.255 md5 <---- This one too to trust

    Reload the config:
    service postgresql-9.2 reload

    Now back to postgres again, this shouldnt ask for password now:

    su - postgres
    psql

    Alter your password to whatever you had in the /root/.pgpass.

    ALTER USER Postgres WITH PASSWORD '<newpassword>';

    Logout, and restore the security to postgres:

    vim /var/lib/pgsql/9.2/data/pg_hba.conf

    local all all trust <--- Set this back to MD5
    host all all 127.0.0.1 255.255.255.255 trust <---- This one too to MD5

    Reload the settings:

    service postgresql-9.2 reload

    And that should make it! No more server offline!.

    * Note that setting all to Trust is a security problem, im not a linux expert, so be careful with what you do when doing this! There might be easyear/better ways to fix this, but is the way i did it.
     
    #9 raguilar, Nov 13, 2012
    Last edited: Nov 13, 2012
  10. raguilar

    raguilar Registered

    Joined:
    Nov 13, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    If you have problem with phpPgAdmin here is a Quick Fix:
    (worked with my Version (5.0.4) / pg 9.2.1 )

    1) change to /classes/database
    2) copy "Postgres84.php" to "Postgres92.php" ** Make sure you rename the class inside to Postgress92. This is not on the original source!.
    3) open Connection.php
    4) add a line
    case '9.2': return 'Postgres92'; break;
    at // Detect version and choose appropriate database driver - switch
    5) open "Postgres.php" & copy functions "getTablespaces" + "getTablespace"
    6) open "Postgres92.php" paste functions into the class
    7) replace ", spclocation," with ", pg_tablespace_location(oid) as
    spclocation," in both functions


    Source: SourceForge.net: phpPgAdmin: Detail: 3570272 - pg_tablespace.spclocation column removed in 9.2

    Hope it helps somebody!
     
  11. 000

    000 Well-Known Member

    Joined:
    Jun 3, 2008
    Messages:
    150
    Likes Received:
    0
    Trophy Points:
    16
    You help is the BEST to me.
    I fixed 2 servers just with you recomendation!.

    THANKS
    THANKS
    THANKS

    And the best: he no require loguin into my server to resolved the problem... :)

    The staff of cPanel only say "givme you password root, we need investigate..."
    After of 3 days: "reinstall your system..."

    Exactly as in:
    http://forums.cpanel.net/f354/sorry-mysql-user-name-x-already-exists-171974.html

    I resolved ALL running
    /scripts/updateuserdatacache

    Excellent !!!
     
    #11 000, Jun 8, 2013
    Last edited: Jun 8, 2013
Loading...

Share This Page