Problem installing Stash 3.7 to use PostgreSQL

I am following the instructions on https://confluence.atlassian.com/display/STASH/Connecting+Stash+to+PostgreSQL

But after running the two "CREATE" commands in psql, the user still does not seem to be valid.  During install the test connection to the database fails and I also can't connect from the command line like this:

-bash-4.2$ psql -h localhost -d stash -U stashuser -W
Password for user stashuser:
psql: FATAL: Ident authentication failed for user "stashuser"
-bash-4.2$

My CREATE commands were 

CREATE ROLE stashuser WITH LOGIN PASSWORD 'JELLYFISH' VALID UNTIL 'infinity';

CREATE DATABASE stash WITH ENCODING='UTF8' OWNER=stashuser CONNECTION LIMIT=-1;

I am new to PostgreSQL so could there be more I need to do there?  Like flush privileges or something?

This is a new server I am setting up, with hardware more like what we wish to deploy.

Thanks

Mark

5 answers

Also, I already added the following lines to /var/lib/pgsql/data/pg_hba.conf, restarted postgresql but get the same message trying to open the database local all all trust host all all 127.0.0.1/32 trust

0 vote

Hi Mark, 

 

Try to use 127.0.0.1 instead of localhost. Look my example:

[root@lab mysql]# psql -h 127.0.0.1  -d confluence57 -U atlassian -W

Password for user atlassian: 

psql (8.4.20, server 9.4.1)

WARNING: psql version 8.4, server version 9.4.

         Some psql features might not work.

Type "help" for help.

 

confluence57=> \q

[root@lab mysql]# psql -h localhost  -d confluence57 -U atlassian -W

Password for user atlassian: 

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

[root@lab mysql]# 

 

My pg_hba.conf is like this:

# "local" is for Unix domain socket connections only

local   all         all                               trust

# IPv4 local connections:

local all postgres trust

host    all         all         127.0.0.1/32          trust 

host all     all  192.168.213.129/32  md5

# IPv6 local connections:

host    all         all         ::1/128               ident

host all     all  192.168.0.0/24  md5

 

 

Regards, 

Renato Rudnicki

I updated the pg_hba.conf to what you have (left off IPv6 part) but still get the same message.  Is that postgresql user supposed to match some OS user/pass or is it confined to postgresql?

[root@gitpc data]# psql -h 127.0.0.1 -d stash -U stashuser -W
Password for user stashuser:
psql: FATAL: Ident authentication failed for user "stashuser"
[root@gitpc data]#

Is there any debugging facility for postgresql authentication?

 

I found there where other config lines in pg_hba.conf causing the problem.  I've eliminated them, restarted postgresql.  Now it works fine.  Sorry about that.

What were your remved config lines ?

 

Thanks

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Tuesday in Uncategorized

Friday fun: how many celebrates Midsummer holiday or is this a Swedish tradition only?

Any other country that celebrates Midsummer holiday (this friday 22 June)?  

44 views 3 1
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you