Matrix_secondary unable to access DB

The PostgreSQL DB setup guide provides an example of creating DB users matrix & matrix_secondary and creating the mysource_matrix DB owned by the matrix user. However I can't see any mention of giving the matrix_secondary user access, is this covered by the installation scripts?


The reason I ask is that during my installation of the matrix, towards the end of running script step_03.php a database error occurs (connect failed). This is due to a connection using matrix_secondary is attempted to be made (but as far as I can tell the matrix_secondary user does not have access to the DB).



I know I haven't shown full dumps of the output from the installation process to support my statement that up until step 3 all went fine (all can be provided). Is there any particular section of the earlier installation steps that I should post?



In advance, cheers

The installation process give access to the matrix_secondary user (in step_02). Can you verify that your DSN for your secondary user is correct ?

I'll post a copy of my main.inc to show what I am setting the DSNs to (I certainly hope I haven't made a typo… so much wasted time :frowning: ), thanks for the quick response.

Here's the DSN settings, however I've realised this is not the issue.

    define('SQ_CONF_DB_DSN', 'pgsql://matrix@unix()/mysource_matrix');
    define('SQ_CONF_DB2_DSN', 'pgsql://matrix@unix()/mysource_matrix');
    define('SQ_CONF_DB3_DSN', 'pgsql://matrix_secondary@unix()/mysource_matrix');
    define('SQ_CONF_DBCACHE_DSN', 'pgsql://matrix@unix()/mysource_matrix');


I've neglected to mention (the crucial point and I've previously wondered why it's never mentioned in the installation steps - Now I know why) that I need to log in / switch user to matrix or matrix_secondary so that I can then connect to the DB using psql. Having realised that this has nothing to do with the matrix installation, I'll move on to an appropriate forum.

If however anyone can help me out with allowing connections to postgres using a user name that you are not currently logged into Linux as, that'd help. eg.

Logged in as phillip enter the command
    psql -U matrix mysource_matrix

will end in the following error
    psql: FATAL:  Ident authentication failed for user "matrix"


I assume this is why step_03.php since if I change SQ_CONF_DB3_DSN to matrix and run step_03.php as matrix the installation goes fine. However it just means when attempting to connect via the web browser the error connect failed occurs as the Linux user account that the connect is made using is of course apache. So YAY, I figured out how to shift the error :) Could of course grant apache permission to access DB but that'd be forgetting about security and well not solving the problem.

Thanks

You need to modify your pg_hba.conf to switch the "ident sameuser" to "trust" – this will allow other Linux users to connect to PostgreSQL as the matrix and matrix_secondary accounts. If your webserver is on the same server as the database, you only need to do this for the line that starts "local".


You will need to restart PostgreSQL for this to take effect.

Thanks for that, I'll recheck it. I am pretty certain that is all correct (Here's me hoping now that I've posted this comment) and I've been restarting the machine reasonably regularly so I suppose all I can do is check, check again.


Just to give a bit more background I'm using Fedora Core 5 and have the firewall & SELinux disabled.

This error is indicative of "ident sameuser" – so I'm pretty positive this is the problem. You may have modified the wrong pg_hba.conf though, if you've perhaps installed multiple versions of PostgreSQL.

Ok, finally got it sussed. I was looking in the wrong spot. I had two database clusters created and of course was changing the config on the one that was not in use.


Thanks

[quote]Ok, finally got it sussed. I was looking in the wrong spot. I had two database clusters created and of course was changing the config on the one that was not in use.
[right][post=“13475”]<{POST_SNAPBACK}>[/post][/right][/quote]



Glad to help. :smiley: