MantisBT - CDash
View Issue Details
0015010CDashCMakepublic2014-07-08 14:242014-12-01 08:27
Sascha Kratky 
Julien Jomier 
normalmajoralways
resolvedfixed 
Apple MacOS X10.8.5
2.2 
2.4 
0015010: Schema upgrade fails with Postgres database
Attempting to upgrade the database schema from CDash 2.0.2 to 2.2 results in an error alert "Internal server errror".

On the server side the following error message is printed to the log:

[Tue Jul 08 20:12:08 2014] [error] [client 192.168.2.20] PHP Fatal error: Call to a member function fetch() on a non-object in /Library/CDash/cdash/cdash/pdocore.php on line 140
Postgres version is 9.1.9.
No tags attached.
patch 0001-BUG-15010-Check-if-argument-is-valid-when-fetching-d.patch (701) 2014-10-18 19:13
https://public.kitware.com/Bug/file/5279/0001-BUG-15010-Check-if-argument-is-valid-when-fetching-d.patch
Issue History
2014-07-08 14:24Sascha KratkyNew Issue
2014-07-14 09:15Julien JomierNote Added: 0036360
2014-07-14 09:22Sascha KratkyNote Added: 0036362
2014-07-15 04:40Julien JomierAssigned To => Julien Jomier
2014-07-15 04:40Julien JomierStatusnew => assigned
2014-07-15 04:42Julien JomierNote Added: 0036388
2014-10-18 19:07IgorNote Added: 0037047
2014-10-18 19:13IgorFile Added: 0001-BUG-15010-Check-if-argument-is-valid-when-fetching-d.patch
2014-10-18 19:20IgorNote Added: 0037048
2014-10-18 19:23IgorNote Added: 0037049
2014-12-01 08:27Julien JomierNote Added: 0037319
2014-12-01 08:27Julien JomierStatusassigned => resolved
2014-12-01 08:27Julien JomierFixed in Version => 2.4
2014-12-01 08:27Julien JomierResolutionopen => fixed

Notes
(0036360)
Julien Jomier   
2014-07-14 09:15   
Is this happening during the upgrade?
(0036362)
Sascha Kratky   
2014-07-14 09:22   
Yes, the upgrade is invoked with the "Upgrade CDash" button on the maintenance page.
(0036388)
Julien Jomier   
2014-07-15 04:42   
So it seems that this error comes when CDash cannot access the PGSQL database. Can you make sure that you copied your config.local.php from the previous CDash?
(0037047)
Igor   
2014-10-18 19:07   
Yeah, that's kind of a known issue. I used to work it around manually. By commenting failing lines out during upgrade or something like that :)
(0037048)
Igor   
2014-10-18 19:20   
It's common to not check result after pdo_query() calls and call pdo_fetch_array() right away in CDash. When pdo_query() fails, the above mentioned issue arises. With mysql functions such attitude is fine, but with postgresql it leads to a fatal php error because $result === false when the following line is invoked: $result->fetch($result_type).
(0037049)
Igor   
2014-10-18 19:23   
The patch may potentially fix some other similar issues.
(0037319)
Julien Jomier   
2014-12-01 08:27   
Thanks for the patch!