Error: [wrapped: SQLSTATE[08006] [7] FATAL: Ident authentication failed for user "airtime"]
  • What does it mean? I did check airtime user at system exists, I checked that airtime user has been created in DB.
    I was looked at /var/lib/pgsql/data/pg_hba.conf - there are all used ident method of authentication that mean the system user credentials will be used connect to DB.
    If anybody know what to look?
    www.actionsch.com - Bringing talents in life!
    + Action Radio School +
  • 16 Comments sorted by
  • Hey developers, are you sure you do not know this catch? or my post is in wrong group?
    www.actionsch.com - Bringing talents in life!
    + Action Radio School +
  • Vote Up0Vote Down Cliff WangCliff Wang
    Posts: 339Member, Sourcefabric Team
    What's output of "psql -U airtime -h localhost -d airtime" in shell?
    Cloud Radio -> http://airtime.pro
  • the same:
    [root@actionsch Airtime-airtime-2.5.1-ga]# su postgres
    bash-4.1$ psql -U airtime -h localhost -d airtime
    psql: FATAL:  Ident authentication failed for user "airtime"

    but system user airtime is login-able:

    bash-4.1$ su airtime
    Password:
    bash-4.1$ id
    uid=392(airtime) gid=387(airtime) groups=387(airtime)
    bash-4.1$

    and config:

    [root@actionsch Airtime-airtime-2.5.1-ga]# tail /var/lib/pgsql/data/pg_hba.conf


    # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD

    # "local" is for Unix domain socket connections only
    local   all         all                               ident
    # IPv4 local connections:
    host    all         all         127.0.0.1/32          ident
    # IPv6 local connections:
    host    all         all         ::1/128               ident
    [root@actionsch Airtime-airtime-2.5.1-ga]#

    www.actionsch.com - Bringing talents in life!
    + Action Radio School +
  • Vote Up0Vote Down NaomiNaomi
    Posts: 228Member
    The only time I've seen this when installing Airtime is when I had both postgresql 8.4 and postgresql 9.1 installed and it was trying to connect to the wrong one.
  • it just one version installed:
    [root@actionsch Airtime-airtime-2.5.1-ga]# rpm -qa | grep -i postgre
    postgresql-8.4.18-1.el6_4.i686
    libobasis4.0-postgresql-sdbc-4.0.1.2-2.i586
    postgresql-server-8.4.18-1.el6_4.i686
    postgresql-libs-8.4.18-1.el6_4.i686
    [root@actionsch Airtime-airtime-2.5.1-ga]#

    Anything else to verify?
    www.actionsch.com - Bringing talents in life!
    + Action Radio School +
  • Vote Up0Vote Down Cliff WangCliff Wang
    Posts: 339Member, Sourcefabric Team
    System user "airtime" is not necessary for Airtime. It only cares db user "airtime".

    First if you user postgres, just exec "sudo -u postgres psql airtime".

    Second if db user "airtime" cant access db "airtime", you can simply recreate it and grant database owner to it in postgres. 
    Cloud Radio -> http://airtime.pro
  • I am able to connect to postgres as airtime user in command line, see below:
    [root@actionsch Airtime-airtime-2.5.1-ga]# sudo -u postgres psql airtime
    psql (8.4.18)
    Type "help" for help.

    airtime=# \du
                List of roles
     Role name | Attributes  | Member of
    -----------+-------------+-----------
     airtime   | Create DB   | {}
     postgres  | Superuser   | {}
               : Create role
               : Create DB

    airtime=# \q
    [root@actionsch Airtime-airtime-2.5.1-ga]#

    But why same attempt via propel is failed?

    www.actionsch.com - Bringing talents in life!
    + Action Radio School +
  • Vote Up0Vote Down Cliff WangCliff Wang
    Posts: 339Member, Sourcefabric Team
    That's why I suggest "psql -U airtime -h localhost -d airtime". It will connect db "airtime" by db user "airtime". By default the password should be "airtime".

    If you've updated password in postgresql, you should update airtime's config files under /etc/airtime/, too.
    Cloud Radio -> http://airtime.pro
  • I did not updated anything beside the install does. Now just looked at /etc/airtime/ and noticed that only airtime.conf has no pypo:pypo ownership. changed it and ran:
    php install_minimal/include/airtime-db-install.php y

    * Database Installation
     * Creating Airtime database user
    ERROR:  role "airtime" already exists
      * Database user 'airtime' already exists.
     * Creating Airtime database
    Unable to open PDO connection [wrapped: SQLSTATE[08006] [7] FATAL:  Ident authentication failed for user "airtime"]
    Database connection problem.
    Check if database 'airtime' exists with corresponding permissions.

    Still the same error... what to dig further?
    I know that error is from Propel.php line: 630
    public static function initConnection($conparams, $name, $defaultClass = Propel::CLASS_PROPEL_PDO)
    Post edited by Alex Gainulin at 2014-04-11 23:38:26
    www.actionsch.com - Bringing talents in life!
    + Action Radio School +
  • Vote Up0Vote Down Cliff WangCliff Wang
    Posts: 339Member, Sourcefabric Team
    Backup db airtime.
    Drop it.
    Execute db installation.

    Or

    alter db user airtime's password to 'airtime'.
    Cloud Radio -> http://airtime.pro
  • Dear Cliff, I did all options you're suggested. Non of them actually fixed my issue...
    Please check if I missed anything:

    a) alter db user:
    [root@actionsch Airtime-airtime-2.5.1-ga]# sudo -u postgres psql
    psql (8.4.18)
    Type "help" for help.

    postgres=# ALTER USER airtime WITH PASSWORD 'airtime';
    ALTER ROLE
    postgres=# \q
    [root@actionsch Airtime-airtime-2.5.1-ga]# php install_minimal/include/airtime-db-install.php y

    * Database Installation
     * Creating Airtime database user
    ERROR:  role "airtime" already exists
      * Database user 'airtime' already exists.
     * Creating Airtime database
    Unable to open PDO connection [wrapped: SQLSTATE[08006] [7] FATAL:  Ident authentication failed for user "airtime"]
    Database connection problem.
    Check if database 'airtime' exists with corresponding permissions.
    [root@actionsch Airtime-airtime-2.5.1-ga]#

    b) drop DB airtime and re-install it:
    [root@actionsch Airtime-airtime-2.5.1-ga]# sudo -u postgres dropdb airtime
    [root@actionsch Airtime-airtime-2.5.1-ga]# sudo -u postgres dropuser airtime
    Checking:
    [root@actionsch Airtime-airtime-2.5.1-ga]# sudo -u postgres psql
    psql (8.4.18)
    Type "help" for help.

    postgres-# \du
                List of roles
     Role name | Attributes  | Member of
    -----------+-------------+-----------
     postgres  | Superuser   | {}
               : Create role
               : Create DB

    postgres-# \l
                                      List of databases
       Name    |  Owner   | Encoding |  Collation  |    Ctype    |   Access privileges
    -----------+----------+----------+-------------+-------------+-----------------------
     postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
     template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
                                                                 : postgres=CTc/postgres
     template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
                                                                 : postgres=CTc/postgres
    (3 rows)

    postgres=# \q
    [root@actionsch Airtime-airtime-2.5.1-ga]#
    [root@actionsch Airtime-airtime-2.5.1-ga]# php install_minimal/include/airtime-db-install.php y

    * Database Installation
     * Creating Airtime database user
      * Database user 'airtime' created.
     * Creating Airtime database
      * Database 'airtime' created.
    Unable to open PDO connection [wrapped: SQLSTATE[08006] [7] FATAL:  Ident authentication failed for user "airtime"]
    Database connection problem.
    Check if database 'airtime' exists with corresponding permissions.
    [root@actionsch Airtime-airtime-2.5.1-ga]#

    Can we talk somehow online? Maybe we can look some specific stuff? Please let me know. 
    Thank you in advance,
    Alex
    www.actionsch.com - Bringing talents in life!
    + Action Radio School +
  • What is preventing  you  from upgrade your database.

    If you are not  using it for any other purpose purge it and reinstall

    as @Noami suggest the database connection might be the problem

    Good Luck
    VOISSES
    Anyone reading this a find it funny about my grammar , I make no apology ,Go get a translator.
    "The Problem with education today is that it takes a university degree to switch on a light bulb"
    "You learn from your mistakes but wise people learn from others mistakes avoid Making mistakes there is not sufficient rooms to make them"
    "Innuendo","If's","Assumptions" and "Fear" are for politician.Who,What,where,When and How are for those seeking knowledge and care about Humanity.
    "I might be in Mud but that does not Make me a Wild Hog(pig)"
    “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage to move in the opposite direction.”
    "The only thing that remains constant is change itself"
    May the force be with you,until our path or destiny bring us in tandem.
  • I am sorry to bothering you guys with my issue... 
    Nothing prevented me from upgrade (are you sure it really helps?), just was wondering why such silly error is not recognizable...
    I found the workaround to fix (just replace ident with md5 in /var/lib/pgsql/data/pg_hba.conf), but surprised why it is so complicated to find the problem...
    Sure, I will try to upgrade - there is nothing used it. Will see then will it get work with ident or...


    www.actionsch.com - Bringing talents in life!
    + Action Radio School +
  • UPDATES:

    I was able to fix the error with DB access but only by MD5 method in /var/lib/pgsql/data/pg_hba.conf.
    For me it's OK (I am porting Airtime to CentOS (2.6.32-279.14.1.el6.i686)  for our NP Organization.
    I still have few next stops, but will use new topic. 

    Thanks Voisses and Cliff for your help!

    Note: I am using CentOS 6.3
    www.actionsch.com - Bringing talents in life!
    + Action Radio School +
  • Hi Alex,
    check your /etc/hosts:

    Using CentOS you might see two lines:


    127.0.0.1   localhost 
    ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

    I commented out the second line and was able to login. Simply removing 'localhost' from that line might do it as well. Do not forget to restart the 'network' service.

    Hope that works for you as well.
    Klaus
     



    Post edited by Klaus Hofeditz at 2014-05-31 15:07:39
  • Thanks. I do not have that, but the post above was my solution.
    www.actionsch.com - Bringing talents in life!
    + Action Radio School +