Opened 13 years ago

Closed 11 years ago

#9399 closed Bug Report - General (Unverified)

Missing db_server environment setting gives strange errors

Reported by: mythweb@… Owned by: Rob Smith
Priority: minor Milestone: unknown
Component: Plugin - MythWeb Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Found this while experimenting with lighttpd and php-fpm. If no setting is found for the database (db_server for example) an error message will be constructed before some translation-variables have been initalized. This gives errors similar to ticket #9255:

Fatal error: Failed to open translation file: modules_path/_shared/lang/English.lang in /var/www/mythweb.blizz.internal/htdocs/classes/Translate.php on line 172

I added a debug_print_backtrace() in Translate.php on line 167 and got this trace which should be helpful:

#0 Translate->load_translation() called at [/var/www/mythweb.internal/htdocs/classes/Translate.php:58] 
#1 Translate->__construct() 
#2 ReflectionClass->newInstanceArgs(Array ()) called at [/var/www/mythweb.internal/htdocs/classes/MythBase.php:34] 
#3 MythBase::find() called at [/var/www/mythweb.internal/htdocs/includes/errors.php:111] 
#4 error_handler(8, Use of undefined constant tmpl - assumed 'tmpl', /var/www/mythweb.internal/htdocs/modules/_shared/tmpl/_errors/db_vars_error.php, 23, Array ([error] => db_vars_error,[page_title] => MythWeb - Error - Database Setup Error,[headers] => Array ([0] => ))) called at [/var/www/mythweb.internal/htdocs/modules/_shared/tmpl/_errors/db_vars_error.php:23] 
#5 require_once(/var/www/mythweb.internal/htdocs/modules/_shared/tmpl/_errors/db_vars_error.php) called at [/var/www/mythweb.internal/htdocs/includes/errordisplay.php:186] 
#6 tailored_error(db_vars_error) called at [/var/www/mythweb.internal/htdocs/includes/database.php:24] 
#7 require_once(/var/www/mythweb.internal/htdocs/includes/database.php) called at [/var/www/mythweb.internal/htdocs/includes/init.php:41] 
#8 require_once(/var/www/mythweb.internal/htdocs/includes/init.php) called at [/var/www/mythweb.internal/htdocs/mythweb.php:20]

Tested on latest 0.24

Change History (4)

comment:1 Changed 12 years ago by stuartm

Milestone: unknown0.25
Type: Bug ReportBug Report - General
Version: UnspecifiedMaster Head

Simple bug, either we intend to fail gracefully in this scenario or it can be closed as Won't Fix.

comment:2 Changed 12 years ago by anonymous@…

From what I have seen with this, for some reason modules_path is not actually populating with anything useful. I manually added the path to English.lang instead of: $path = modules_path.'/'.module.'/lang/English.lang';

I added: $path = '/usr/share/mythtv/mythweb/modules/_shared/lang/English.lang';

It solved that problem, though it is a silly bug.

comment:3 Changed 12 years ago by beirdo

Milestone: 0.25unknown

comment:4 Changed 11 years ago by Nicolas Riendeau

Resolution: Unverified
Status: newclosed

CLosing this ticket as it was most likely resolved by fixes applied recently.

Note: See TracTickets for help on using tickets.