Bug #34662

Fatal error 't3lib_lock' does not exist if deprecationLog = 'file'

Added by Nico de Haen over 3 years ago. Updated over 3 years ago.

Status:Resolved Start date:2012-03-08
Priority:Must have Due date:
Assigned To:- % Done:

100%

Category:- Spent time: -
Target version:4.5.14
TYPO3 Version:4.5 Is Regression:
PHP Version:5.3 Sprint Focus:
Complexity:

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.


Related issues

related to Core - Bug #31460: flock() in class.t3lib_div.php Resolved 2011-10-31
related to Core - Bug #38244: 't3lib_lock' does not exist if $TYPO3_CONF_VARS['SYS']['s... Rejected 2012-06-21

Associated revisions

Revision 2eeaa4b0
Added by Oliver Hader over 3 years ago

[BUGFIX] Fatal error 't3lib_lock' does not exist

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"

Change-Id: If95166c985499ded9764e6f7d6df224110580d95
Fixes: #34662
Releases: 4.5, 4.6, 4.7, 4.8
Reviewed-on: http://review.typo3.org/9643
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
Reviewed-by: Oliver Klee
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader

Revision 56ef45df
Added by Oliver Hader over 3 years ago

[BUGFIX] Fatal error 't3lib_lock' does not exist

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"

Change-Id: Ic4815ab40e60b8bb0d18b0f15261cb09c9d44280
Fixes: #34662
Releases: 4.5, 4.6, 4.7, 4.8
Reviewed-on: http://review.typo3.org/9639
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Oliver Klee
Reviewed-by: Sebastian Michaelsen
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader

Revision de9937b8
Added by Oliver Hader over 3 years ago

[BUGFIX] Fatal error 't3lib_lock' does not exist

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"

Change-Id: I28b736b093c372f6581e8d67f1de1f1d68790be1
Fixes: #34662
Releases: 4.5, 4.6, 4.7, 4.8
Reviewed-on: http://review.typo3.org/9688
Reviewed-by: Oliver Klee
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader

Revision 163cd00f
Added by Oliver Hader over 3 years ago

[BUGFIX] Fatal error 't3lib_lock' does not exist

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"

Change-Id: Ia31dd763f52cb0cae6ef3f97859da6513e1a7622
Fixes: #34662
Releases: 4.5, 4.6, 4.7, 4.8
Reviewed-on: http://review.typo3.org/9689
Reviewed-by: Oliver Klee
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader

History

#1 Updated by Sebastian Enders over 3 years ago

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';

#2 Updated by Uwe Trenkner over 3 years ago

Same here:
Typo3 4.5.12 works fine.
Typo3 4.5.13 produces the stated error message.

#3 Updated by Raphael Zschorsch over 3 years ago

Same here..

#4 Updated by Pascal Uhlmann over 3 years ago

I can also confirm this problem with Typo3 v4.5.13 and PHP 5.2. Version 4.5.12 works fine.

#5 Updated by Christian Nikoleit over 3 years ago

confirm -> TYPO3 4.5.13 and PHP 5.2

#6 Updated by joujou no-lastname-given over 3 years ago

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...

#7 Updated by Thomas Deinhamer over 3 years ago

I guess this is a real problem, I have this too. Need to change back to 4.5.12.

#8 Updated by Steffen Gebert over 3 years ago

  • Status changed from New to Accepted
  • Target version set to 4.6.7

#9 Updated by Steffen Gebert over 3 years ago

  • Target version changed from 4.6.7 to 4.5.14

#10 Updated by Oliver Hader over 3 years ago

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...

#11 Updated by Steffen Gebert over 3 years ago

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.

#12 Updated by Jochen Weiland over 3 years ago

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.

#13 Updated by Steffen Gebert over 3 years ago

Jochen, please stick to the topic (and this has been discussed thoroughly).

#14 Updated by joujou no-lastname-given over 3 years ago

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.

#15 Updated by Nico de Haen over 3 years ago

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!

#16 Updated by joujou no-lastname-given over 3 years ago

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 ?

#17 Updated by Oliver Hader over 3 years ago

(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!

#18 Updated by Oliver Hader over 3 years ago

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.

#19 Updated by Gerrit Code Review over 3 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/9639

#20 Updated by Gerrit Code Review over 3 years ago

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9643

#21 Updated by Gerrit Code Review over 3 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/9643

#22 Updated by Gerrit Code Review over 3 years ago

Patch set 2 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/9639

#23 Updated by Gerrit Code Review over 3 years ago

Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/9688

#24 Updated by Gerrit Code Review over 3 years ago

Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/9689

#25 Updated by Oliver Hader over 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF