Bug #34662
closed
Fatal error 't3lib_lock' does not exist if deprecationLog = 'file'
Added by Nico de Haen over 12 years ago.
Updated almost 7 years ago.
Description
It seems, that Commit f1fd1b69 introduced a problem in certain conditions:
if the deprecationLog is enabled and set to "file", each call of t3lib_div::deprecationLog will now result in a
t3lib_div::makeInstance('t3lib_lock', $destination, $GLOBALS['TYPO3_CONF_VARS']['SYS']['lockingMode']); (class.t3lib_div.php line:6032)
But it seems that the class is not yet available if the deprecationLog is called in t3lib/config_default.php
Here is the stack trace:
PHP Fatal error: Uncaught exception 'ReflectionException' with message 'Class t3lib_lock does not exist' in /var/www/typo3_src/typo3_src-4.5.stable/t3lib/class.t3lib_div.php:5359
Stack trace:
#0 /var/www/typo3_src/typo3_src-4.5.stable/t3lib/class.t3lib_div.php(5359): ReflectionClass->__construct('t3lib_lock')
#1 /var/www/typo3_src/typo3_src-4.5.stable/t3lib/class.t3lib_div.php(6032): t3lib_div::makeInstance('t3lib_lock', '/var/www/...', 'simple')
#2 /var/www/typo3_src/typo3_src-4.5.stable/t3lib/config_default.php(764): t3lib_div::deprecationLog('This TYPO3 inst...')
#3 /var/www/typo3_src/typo3_src-4.5.stable/typo3/sysext/cms/tslib/index_ts.php(128): require('/var/www/typo3_...')
#4 /var/www/typo3_src/typo3_src-4.5.stable/index.php(84): require('/var/www/typo3_...')
#5 {main}
thrown in /var/www/typo3_src/typo3_src-4.5.stable/t3lib/class.t3lib_div.php on line 5359
I didn't test it with higher versions, but probably the problem will also occur there.
I can confirm this error after I upgraded to Typo3 4.5.13.
(PHP 5.2)
Typo3 4.5.12 works fine.
The error didn't appear anymore in 4.5.13 after I put this lines to localconf.php:
$TYPO3_CONF_VARS['SYS']['displayErrors'] = '0';
$TYPO3_CONF_VARS['SYS']['errorHandlerErrors'] = '22519';
$TYPO3_CONF_VARS['SYS']['exceptionalErrors'] = '22527';
$TYPO3_CONF_VARS['SYS']['enableDeprecationLog'] = '0';
$TYPO3_CONF_VARS['SYS']['systemLog'] = '';
$TYPO3_CONF_VARS['SYS']['systemLogLevel'] = '';
$TYPO3_CONF_VARS['BE']['allowDonateWindow'] = '0';
Same here:
Typo3 4.5.12 works fine.
Typo3 4.5.13 produces the stated error message.
I can also confirm this problem with Typo3 v4.5.13 and PHP 5.2. Version 4.5.12 works fine.
confirm -> TYPO3 4.5.13 and PHP 5.2
Same for me, adding $TYPO3_CONF_VARS['SYS']['enableDeprecationLog'] = '0'; in localconf.php is enough for me to correct things.
The problem appears with Typo3 4.5.13.
I also have a site with Typo3 4.5.13, $TYPO3_CONF_VARS['SYS']['enableDeprecationLog'] = 'file' and everything working fine...
I guess this is a real problem, I have this too. Need to change back to 4.5.12.
- Status changed from New to Accepted
- Target version set to 4.6.7
- Target version changed from 4.6.7 to 4.5.14
What a pity... Thanks to all reporters for giving the details. We will investigate further and try to have this fixed and rolled-out again as soon as possible...
To sum it up, this happens only, if both of this (non-recommended) settings are set:
- $TYPO3_CONF_VARS['SYS']['enableDeprecationLog'] enabled
- non-UTF-8 database
Both are discouraged for production sites.
IMHO the deprecation log should not be enabled by default anyway, it should only be enabled for a short time for admins/developers to see if there is a problem.
Otherwise huge deprectionlog files can eat up your disk space.
Jochen, please stick to the topic (and this has been discussed thoroughly).
Right, the site I have that works with Typo3 4.5.13 and $TYPO3_CONF_VARS['SYS']['enableDeprecationLog'] = 'file' is in UTF-8.
Yet, I think many people don't use UTF-8 in prod.
I didn't know that the default is "'enableDeprecationLog' => 'file', just saw it in config_default.php. This makes absolutely no sense to me. The deprecation log is only useful for developers!
By the way, is there a difference between setting $TYPO3_CONF_VARS['SYS']['enableDeprecationLog'] directly in localconf.php and setting it by the install tool configuration manager ?
(as written in core mailing list)
The PHP fatal error occurs for the following settings
- $TYPO3_CONF_VARS['SYS']['enableDeprecationLog'] is enabled
- $TYPO3_CONF_VARS['BE']['forceCharset'] is not "utf-8" (or empty)
- $TYPO3_CONF_VARS['SYS']['enableDeprecationLog'] is set to "file"
The bug is, that t3lib_lock will then be called at a time when the
autoloader was not initialized yet.
Quick work-around
Disable $TYPO3_CONF_VARS['SYS']['enableDeprecationLog'] in Install Tool.
Since this behaviour might affect websites with TYPO3 4.5 LTS with old
non-UTF-8 character settings, we aim to have new releases soon (again).
Thanks for your patience!
joujou wrote:
By the way, is there a difference between setting $TYPO3_CONF_VARS['SYS']['enableDeprecationLog'] directly in localconf.php and setting it by the install tool configuration manager ?
The effect is the same since the same value will be written from Install Tool to typo3conf/localconf.php.
- Status changed from Accepted to Under Review
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF