Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Installing SilverStripe /

Getting SilverStripe up and running on your computer and on your web server.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Postgres 9.1 and SS 2.4.6 install fails during DB build


Reply


2 Posts   823 Views

Avatar
ScottT

Community Member, 9 Posts

6 March 2012 at 2:56am

Hi,
I am a newbie to SS and Postgres. I have installed a few times successfully with MySQL and have done some of the tutorials. However, for a large project I am just beginning, I need Postgres.

When I try to install with Postgres, the install seems to hang. If I hit the main URL, it looks like SS tries to do a dev/build and fails with the following output:

Environment Builder
http://itmanager/silverstripe/
dev→ build

Setting up the database; you will be returned to your site shortly....
[Warning] pg_query(): Query failed: ERROR: must be owner of relation PageComment
GET /silverstripe/dev/build?returnURL=%2Fsilverstripe%2F

Line 187 in /var/www/silverstripe/postgresql/code/PostgreSQLDatabase.php
Source

178       if(isset($_REQUEST['previewwrite']) && in_array(strtolower(substr($sql,0,strpos($sql,' '))), array('insert','update','delete','replace'))) {
179          Debug::message("Will execute: $sql");
180          return;
181       }
182
183       if(isset($_REQUEST['showqueries'])) {
184          $starttime = microtime(true);
185       }
186
187       $handle = pg_query($this->dbConn, $sql);
188       
189       if(isset($_REQUEST['showqueries'])) {
190          $endtime = round(microtime(true) - $starttime,4);
191          Debug::message("\n$sql\n{$endtime}ms\n", false);
192       }
193       

Trace

pg_query(Resource id #1051,REINDEX TABLE "PageComment")
Line 187 of PostgreSQLDatabase.php
PostgreSQLDatabase->query(REINDEX TABLE "PageComment")
Line 609 of PostgreSQLDatabase.php
PostgreSQLDatabase->runTableCheckCommand(REINDEX TABLE "PageComment")
Line 599 of PostgreSQLDatabase.php
PostgreSQLDatabase->checkAndRepairTable(PageComment,Array)
Line 278 of Database.php
SS_Database->requireTable(PageComment,Array,Array,1,Array,)
Line 246 of DB.php
DB::requireTable(PageComment,Array,Array,1,Array,)
Line 2983 of DataObject.php
DataObject->requireTable()
Line 213 of DatabaseAdmin.php
DatabaseAdmin->doBuild(1)
Line 99 of DatabaseAdmin.php
DatabaseAdmin->build(SS_HTTPRequest)
Line 193 of Controller.php
Controller->handleAction(SS_HTTPRequest)
Line 143 of RequestHandler.php
RequestHandler->handleRequest(SS_HTTPRequest)
Line 147 of Controller.php
Controller->handleRequest(SS_HTTPRequest)
Line 134 of DevelopmentAdmin.php
DevelopmentAdmin->build(SS_HTTPRequest)
Line 143 of RequestHandler.php
RequestHandler->handleRequest(SS_HTTPRequest)
Line 147 of Controller.php
Controller->handleRequest(SS_HTTPRequest)
Line 282 of Director.php
Director::handleRequest(SS_HTTPRequest,Session)
Line 125 of Director.php
Director::direct(/dev/build)
Line 127 of main.php

The user name and password were adequate to create the DB tables initially (there are 70 tables in the DB), so I'm not sure what the problem is. Admittedly, I am new to Postgres and am learning the permission model. However, I am pretty certain permissions in the DB are OK, since the user SilverStripe is connecting as is the same user who created the DB in the first place.

Scott

Avatar
ScottT

Community Member, 9 Posts

6 March 2012 at 3:30am

Never mind. I think I the installer was trying to use the wrong credentials - credentials left over from a previous install. I am able to successfully install now.