Opened 10 years ago

Closed 9 years ago

#8158 closed defect (fixed)

MythWeb error pages fails to work with an empty DB or missing DB

Reported by: sphery Owned by: Rob Smith
Priority: minor Milestone: 0.24
Component: Plugin - MythWeb Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

When attempting to access MythWeb when there's an empty database (i.e. as after a DROP DATABASE followed by running database/mc.sql), the user gets a blank page in the browser and the Apache error logs show:

[Tue Mar 09 15:20:07 2010] [error] [client 192.168.3.2] PHP Fatal error:  require() [<a href='function.require'>function.require</a>]: Failed opening required 'modules/_shared/tmpl/tmpl/header.php' (include_path='.:/usr/lib/php') in /srv/www/htdocs/myth/modules/_shared/tmpl/_errors/fatal.php on line 23

The tmpl define is undefined at this point, resulting in an attempt to acces a file in "tmpl/tmpl". Once defined (i.e as with "define('tmpl', 'default');" at the top of modules/_shared/tmpl/_errors/fatal.php), the error log shows the following error repeating 7 times:

[Tue Mar 09 15:24:46 2010] [error] [client 192.168.3.2] PHP Fatal error:  SQL Error: Table 'mythconverg.settings' doesn't exist [#1146] in /srv/www/htdocs/myth/classes/Database/Query/mysql.php on line 83

If, on the other hand, the database does not exist at all (as after a DROP DATABASE) or the user specifies invalid database connection information in the Apache configuration for MythWeb (DB host, DB name, username, or password), the browser shows the message:

Warning at /srv/www/htdocs/myth/modules/_shared/tmpl/_errors/site_down.php, line 23:
require(modules/_shared/tmpl/tmpl/header.php) [function.require]: failed to open stream: No such file or directory

Once tmpl is defined in modules/_shared/tmpl/_errors/site_down.php (as above), the browser shows the MythTV logo twice and the Apache error logs show the following errors repeated about 12 times:

[Tue Mar 09 15:33:41 2010] [error] [client 192.168.3.2] PHP Warning:  Cannot modify header information - headers already sent by (output started at /srv/www/htdocs/myth/modules/_shared/tmpl/default/header.php:49) in /srv/www/htdocs/myth/modules/_shared/tmpl/default/header.php on line 16
[Tue Mar 09 15:33:41 2010] [error] [client 192.168.3.2] PHP Fatal error:  Call to undefined function t() in /srv/www/htdocs/myth/modules/database/init.php on line 14

Change History (1)

comment:1 Changed 9 years ago by sphery

Milestone: unknown0.24
Resolution: fixed
Status: newclosed

Fixed in [24922] (and [24912]).

Note: See TracTickets for help on using tickets.