Problems with step 2

I am getting the following error message at Step 2, i think i may have gotten mixed up somewhere down the line as i am using a number of step by step guides to installing

    Fatal error: Uncaught exception 'Exception' with message 'Could not create database connection: DBError!:SQLSTATE[08006] [7] FATAL:  password authentication failed for user "matrix"' in /var/www/mysource_matrix/core/include/mysource.inc:2288
    Stack trace:
    #0 /var/www/mysource_matrix/core/include/mysource.inc(211): MySource->changeDatabaseConnection('db')
    #1 /var/www/mysource_matrix/core/include/init.inc(231): MySource->init()
    #2 /var/www/mysource_matrix/install/step_02.php(57): require_once('/var/www/mysour...')
    #3 {main}
      thrown in /var/www/mysource_matrix/core/include/mysource.inc on line 2288
    Segmentation fault


my db.inc file looks like this....

    <?php
    $db_conf = array (
    		'db' => array (
    				'DSN' => 'pgsql:dbname=mysource_matrix;host=127.0.0.1',
    				'user' => 'matrix',
    				'password' => '',
    				'type' => 'pgsql',
    			   ),
    		'db2' => array (
    				'DSN' => 'pgsql:dbname=mysource_matrix;host=127.0.0.1',
    				'user' => 'matrix',
    				'password' => '',
    				'type' => 'pgsql',
    			   ),
    		'db3' => array (
    				'DSN' => 'pgsql:dbname=mysource_matrix;host=127.0.0.1',
    				'user' => 'matrix_secondary',
    				'password' => '',
    				'type' => 'pgsql',
    			   ),
    		'dbcache' => array (
    		'DSN' => 'pgsql:dbname=mysource_matrixb',
    				'user' => 'matrix',
    				'password' => '',
    				'type' => 'pgsql',
    		),
    );
    return $db_conf;
    ?>


and my pg_hba file looks like this...

    # Database administrative login by UNIX sockets
    local   all		 postgres						  trust
# TYPE  DATABASE	USER		CIDR-ADDRESS		  METHOD

# "local" is for Unix domain socket connections only
local   all		 all							   trust
# IPv4 local connections:
host	all		 all		 127.0.0.1/32		  trust
# IPv6 local connections:
host	all		 all		 ::1/128			   trust

host	all		 all		 192.168.0.3		   255.255.255.0	trust</pre><br />

I am sure the problem is with one of these files as i have been fiddling with them alot while trying to get step 2 working!

also am i right in saying that if i am using the newest version of Matrix, whatever is in main.inc is irrelevant?

Please help me?! I am pulling my hair out with this one!

Hi EvlHomer :slight_smile:


I can't see a problem with your configuration above. But note that the order of the entries is important, and you need to reload PostgreSQL for changes in the pg_hba.conf file to take effect.



From your db.conf file, it appears as though you are connecting with a TCP socket to localhost. I would recommend connecting through the unix socket locally. Try this configuration:



pg_hba.conf

    # Database administrative login by UNIX sockets
    
    # If you want to allow access to all databases from all local users, uncomment this next line and comment out all the Matrix-specific ones
    #local   all		 all							   trust
    local   mysource_matrix		 matrix							   trust
    local   mysource_matrix		 matrix_secondary							   trust
    local   mysource_matrixb		 matrix							   trust
    local   mysource_matrixb		 matrix_secondary							   trust
    local   all		 postgres						  ident sameuser
    
    # TYPE  DATABASE	USER		CIDR-ADDRESS		  METHOD
    
    # "local" is for Unix domain socket connections only
    local   all		 all							   ident sameuser
    # IPv4 local connections:
    host	all		 all		 127.0.0.1/32		  md5
    # IPv6 local connections:
    host	all		 all		 ::1/128			   md5


db.inc
    <?php
    $db_conf = array (
    		'db' => array (
    				'DSN' => 'pgsql:dbname=mysource_matrix',
    				'user' => 'matrix',
    				'password' => '',
    				'type' => 'pgsql',
    			   ),
    		'db2' => array (
    				'DSN' => 'pgsql:dbname=mysource_matrix',
    				'user' => 'matrix',
    				'password' => '',
    				'type' => 'pgsql',
    			   ),
    		'db3' => array (
    				'DSN' => 'pgsql:dbname=mysource_matrix',
    				'user' => 'matrix_secondary',
    				'password' => '',
    				'type' => 'pgsql',
    			   ),
    		'dbcache' => array (
    		'DSN' => 'pgsql:dbname=mysource_matrixb',
    				'user' => 'matrix',
    				'password' => '',
    				'type' => 'pgsql',
    		),
    );
    return $db_conf;
    ?>


Hope this helps. Let us know how you go.

Cheers,
Dan.

Hi,thanks for the quick reply,i made the changes you suggested above and ran my step 2, now i get this error…


I seam to have gotten a bit further?!


    ------------------------------------
    PGSQL SECONDARY AND TERTIARY USER PERMISSIONS FIXED
    ------------------------------------
    
    Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42883]: Undefined function: 7 ERROR:  function sq_grant_access(unknown) does not exist
    LINE 1: SELECT sq_grant_access($1)
    			   ^
    HINT:  No function matches the given name and argument types. You might need to add explicit type casts.' in /var/www/mysource_matrix/core/lib/DAL/DAL.inc:601
    Stack trace:
    #0 /var/www/mysource_matrix/core/lib/DAL/DAL.inc(601): PDOStatement->execute()
    #1 /var/www/mysource_matrix/core/lib/db_install/db_install.inc(724): DAL::execPdoQuery(Object(PDOStatement))
    #2 /var/www/mysource_matrix/install/step_02.php(121): grant_secondary_user_perms()
    #3 {main}
      thrown in /var/www/mysource_matrix/core/lib/DAL/DAL.inc on line 601

Just stopped and started posgres again and i now have this error…

    Fatal error: Uncaught exception 'DALException' with message 'SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation "sq_ast_typ" does not exist' in /var/www/mysource_matrix/core/lib/DAL/DAL.inc:632
    Stack trace:
    #0 /var/www/mysource_matrix/core/lib/DAL/DAL.inc(908): DAL::executePdoAssoc(Object(PDOStatement), NULL)
    #1 /var/www/mysource_matrix/core/include/asset_manager.inc(152): DAL::executeSqlAssoc('SELECT type_cod...')
    #2 /var/www/mysource_matrix/core/include/asset_manager.inc(121): Asset_Manager->getAssetTypes()
    #3 /var/www/mysource_matrix/core/include/asset_manager.inc(87): Asset_Manager->_loadAssetTypes()
    #4 /var/www/mysource_matrix/core/include/mysource.inc(214): Asset_Manager->Asset_Manager()
    #5 /var/www/mysource_matrix/core/include/init.inc(231): MySource->init()
    #6 /var/www/mysource_matrix/install/step_02.php(57): require_once('/var/www/mysour...')
    #7 {main}
      thrown in /var/www/mysource_matrix/core/lib/DAL/DAL.inc on line 632


I amstarting to getthe feeling that i am not supposed to get MySourceworking!

The reason you get your new errors is because your initial install attempt failed. You need to drop the DB, delete your Matrix install and start again.

Hello,


I deleted the install,i am starting from a fresh vitual machine using all the details form above,but when i run step 2 i get this error


    Fatal error: Uncaught exception 'Exception' with message 'Could not create database connection: DBError!:SQLSTATE[08006] [7] FATAL:  Ident authentication failed for user "matrix"' in /var/www/mysource_matrix/core/include/mysource.inc:2288
    Stack trace:
    #0 /var/www/mysource_matrix/core/lib/db_install/db_install.inc(468): MySource->changeDatabaseConnection('dbcache')
    #1 /var/www/mysource_matrix/install/step_02.php(98): db_install('/var/www/mysour...')
    #2 {main}
      thrown in /var/www/mysource_matrix/core/include/mysource.inc on line 2288

[quote]Hello,


I deleted the install,i am starting from a fresh vitual machine using all the details form above,but when i run step 2 i get this error


    Fatal error: Uncaught exception 'Exception' with message 'Could not create database connection: DBError!:SQLSTATE[08006] [7] FATAL:  Ident authentication failed for user "matrix"' in /var/www/mysource_matrix/core/include/mysource.inc:2288
    Stack trace:
    #0 /var/www/mysource_matrix/core/lib/db_install/db_install.inc(468): MySource->changeDatabaseConnection('dbcache')
    #1 /var/www/mysource_matrix/install/step_02.php(98): db_install('/var/www/mysour...')
    #2 {main}
      thrown in /var/www/mysource_matrix/core/include/mysource.inc on line 2288
[/quote]

It might work if you try setting the dbcache entry to => NULL instead of the array.

Hello, yer solved the last problem, i had a typo in the db.inc file that was pointing to a diffrent database! Fixed that and i seam to be getting a bit further, in fact i actually thought i was finally gonna get past step 2.


But alas, no!



I now get this error…


    Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42883]: Undefined function: 7 ERROR:  function sq_grant_access(unknown) does not exist
    LINE 1: SELECT sq_grant_access($1)
    			   ^
    HINT:  No function matches the given name and argument types. You might need to add explicit type casts.' in /var/www/mysource_matrix/core/lib/DAL/DAL.inc:601
    Stack trace:
    #0 /var/www/mysource_matrix/core/lib/DAL/DAL.inc(601): PDOStatement->execute()
    #1 /var/www/mysource_matrix/core/lib/db_install/db_install.inc(724): DAL::execPdoQuery(Object(PDOStatement))
    #2 /var/www/mysource_matrix/install/step_02.php(121): grant_secondary_user_perms()
    #3 {main}
      thrown in /var/www/mysource_matrix/core/lib/DAL/DAL.inc on line 601


Help!

Ignore me, i resolved the problem, i set dbcache to Null, seams to be installing fine now.

Yeah, only once you've finished the installation can you assign / move the sq_cache table amongst other databases / servers.


It's actually a good idea to do this anyway as it allows you do things to speed up cache performance, like run the db itself out of shm, etc, (the usual caveats apply, of course).