core

Ticket #30 (closed Bug: fixed)

Opened 6 months ago

Last modified 5 months ago

upgrade.php should check database connection

Reported by: slam Owned by: markwest
Priority: major Milestone: 1.0.1
Component: Version: 1.0.0
Keywords: upgrade Cc:

Description

In upgrade.php we should have check for database connection similar to the one we do in /install/functions.php:

            // we should be connected to the db at this stage
            $dbconn = pnDBGetConn(true);
            if (!$dbconn) {
                $action = 'dbinformation';
                $smarty->assign('dbconnectfailed', true);
                $smarty->assign(array('dbhost' => $dbhost, 'dbtype' => $dbtype, 'dbname' => $dbname, 'dbusername' => $dbusername,
                                'dbpassword' => $dbpassword, 'dbtableprefix' => $dbprefix));
            }
            break;

This will avoid not easy to debug errors like this one:

 Allowed memory size of 268435456 bytes exhausted (tried to allocate 21 bytes) in /media/disk1part15/www/includes/pnobjlib/debug.php on line 51

which is in this case not just misleading, but absurd in itself.
Greetings,
Chris

Change History

Changed 5 months ago by markwest

The problem here isn't the db connection itself - this is trapped ok. However when the error is trapped pn_exit is called. This relies on more of the core being available than is used in the upgrade. As a result pn_exit gets call recursively each time generating a backtrace. Hence the running out of memory fairly quickly.

-Mark

Changed 5 months ago by markwest

  • owner set to markwest
  • status changed from new to accepted

Changed 5 months ago by markwest

  • status changed from accepted to closed
  • resolution set to fixed

(In [24448]) Fixed #30 - upgrade.php should check database connection

Note: See TracTickets for help on using tickets.