Having database problems with tt-rss installation

Support requests, bug reports, etc. go here. Dedicated servers / VDS hosting only
Tehlanie
Bear Rating Trainee
Bear Rating Trainee
Posts: 18
Joined: 26 Jun 2013, 04:49

Having database problems with tt-rss installation

Postby Tehlanie » 22 Aug 2015, 05:06

Hello,

So due to some issues with my OS when upgrading, I decided to completely reinstall my OS, and am now reinstalling tt-rss. Using Ubuntu 15.04, with php5 and postgresql-9.4. After installing php5, php-pgsql, apache2 (and subsequent mods that I use), postgresql, I have run into a bit of a problem.

I am trying to connect to the database with postgres and given him 'ALL' access to the database.

psql \l

Code: Select all

postgres=# \l
                                  List of databases
   Name    |  Owner   | Encoding |   Collate   |    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
 ttrssdb   | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres         +
           |          |          |             |             | postgres=CTc/postgres+
           |          |          |             |             | ttrss=CTc/postgres


I have verified that the password and username I am using are correct, but that doesn't seem to have any

But when I test the configuration I get the following:
Checking configuration
Configuration check succeeded with minor problems:
[*]It is highly recommended to enable support for CURL in PHP.

Checking database
[*]Unable to connect to database using specified parameters.


I was wondering if anyone had some ideas on what I am doing wrong. I am logging in with the postgres user, and using the password I designated to them with \passwd while in psql.

Postgresql log file:
2015-08-21 21:09:57 CDT [6329-1] [email protected] LOG: provided user name (postgres) and authenticated user name (www-data) do not match
2015-08-21 21:09:57 CDT [6329-2] [email protected] FATAL: Peer authentication failed for user "postgres"
2015-08-21 21:09:57 CDT [6329-3] [email protected] DETAIL: Connection matched pg_hba.conf line 85: "local all postgres peer"


I assume it is the first line that is causing the problem.


Tehlanie
Bear Rating Trainee
Bear Rating Trainee
Posts: 18
Joined: 26 Jun 2013, 04:49

Re: Having database problems with tt-rss installation

Postby Tehlanie » 22 Aug 2015, 05:34

No,unfortunately, it doesn't. I had tried this method to using both local and hos like so:
local ttrssdb postgres md5
host ttrssdb postgres md5

I also tried all instead of ttrssdb.

After restarting postgresql, I still get the same checking configuration errors, in my original post. I also tried creating a ttrss user, and adding the same lines above with the user as ttrss instead of postgres. Still is not working. I still receive the following message:

Unable to connect to database using specified parameters.

JustAMacUser
Bear Rating Overlord
Bear Rating Overlord
Posts: 373
Joined: 20 Aug 2013, 23:13

Re: Having database problems with tt-rss installation

Postby JustAMacUser » 22 Aug 2015, 05:49

PostgreSQL is a little different with privileges than something like MySQL. I don't have a lot of experience with it (PostgreSQL) but the log you originally posted is basically telling you: You're trying to connect to ttrssdb as the user www-data but I'm only allowing user postgres to access it.

If you read through that link I sent you, and the following (Next) page, it explains how to gives users access or re-map usernames.

At the end of the day, the default setup for PostgreSQL is to give access to system users (e.g. root, postgres, www-data, etc.). So you create your database with its owner being www-data if you want the web server to have access to it. Or, you can map users (e.g. you could map the user www-data to postgres). Or, you can go with password-based authentication.

The key with the pg_hba.conf file is that the order the line items appear in is very important. Once a match is found, it stops looking. Make sure you're putting the password line items first.

AngryChris
Bear Rating Master
Bear Rating Master
Posts: 135
Joined: 08 Apr 2013, 02:42

Re: Having database problems with tt-rss installation

Postby AngryChris » 22 Aug 2015, 10:09

Also note that you must restart the database whenever you make changes to pg_hba.conf to make those changes effective.

Tehlanie
Bear Rating Trainee
Bear Rating Trainee
Posts: 18
Joined: 26 Jun 2013, 04:49

Re: Having database problems with tt-rss installation

Postby Tehlanie » 23 Aug 2015, 23:16

No, I still seem to have issues even after restarting the postgresql service, with a mapped username and edited files.


/etc/postgresql/9.3/main/pg_hba.conf
# TYPE DATABASE USER ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres peer
#host replication postgres 127.0.0.1/32 md5
#host replication postgres ::1/128 md5
host all ttrssl 127.0.0.1/32 md5


/etc/postgresql/9.3/main/pg_ident.conf
# Put your actual configuration here
# ----------------------------------

# MAPNAME SYSTEM-USERNAME PG-USERNAME
ttrss www-data ttrss


If I try other methods such as ident, peer (fails to start postresql) and others, nothing seems to work. I always get the same error message in the log file:
2015-08-23 15:15:20 CDT LOG: provided user name (ttrss) and authenticated user name (www-data) do not match
2015-08-23 15:15:20 CDT FATAL: Peer authentication failed for user "ttrss"


It doesn't seem to work.

User avatar
pahles
Bear Rating Disaster
Bear Rating Disaster
Posts: 50
Joined: 20 Mar 2013, 17:02

Re: Having database problems with tt-rss installation

Postby pahles » 24 Aug 2015, 00:26

I use Ubuntu 14.04 and Postgresql 9.3, using a dedicated user for the tt-rss database. I have local all all md5 in pg_hba.conf. I have not touched pg_ident.conf.

JustAMacUser
Bear Rating Overlord
Bear Rating Overlord
Posts: 373
Joined: 20 Aug 2013, 23:13

Re: Having database problems with tt-rss installation

Postby JustAMacUser » 24 Aug 2015, 01:00

It might be a copy/paste error, but there appears to be a typo in the pg_hba.conf file. The last line based on your post is:

Code: Select all

host    all             ttrssl             127.0.0.1/32            md5


The database name looks like it has a typo, unless your database really does end in l.

Though I'm not sure that matters since (entries are examined sequentially and) earlier in the file you have:

Code: Select all

 host all all 127.0.0.1/32 md5


You may need to add map=ttrss after the appropriate line as well. For example:

Code: Select all

host    all             ttrss             127.0.0.1/32            md5 map=ttrss

User avatar
sleeper_service
Bear Rating Overlord
Bear Rating Overlord
Posts: 884
Joined: 30 Mar 2013, 23:50
Location: Dallas, Texas

Re: Having database problems with tt-rss installation

Postby sleeper_service » 24 Aug 2015, 01:47

http://www.postgresql.org/message-id/20 ... anford.edu

http://www.postgresql.org/docs/devel/st ... -maps.html

the map=ttrss looks to be on target.

or use trust instead of peer
what's your DB_USER and DB_HOST and DB_NAME ?


Return to “Support”

Who is online

Users browsing this forum: No registered users and 12 guests