62993[BUGFIX] Exclude E_USER_DEPRECATED in basic error reporting
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 2
Files 2
Review log 1619
-
Vito Alexander Nordloh uploaded patch set 1 01/19/20, 13:51
-
TYPO3com voted on patch set 1 V +1 01/19/20, 14:01 Completed build in 09m 25s on Sun, 19 Jan, 02:01 PM Test Summary: 70448 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-40086
-
Stephan Großberndt updated the commit message in patch set 2 01/19/20, 14:02
-
Stephan Großberndt commented on patch set 2 01/19/20, 14:03
Bugfixes to main branches only. Only security relevant fixes to latest 10.x and none to 9.x below 9.5 -
TYPO3com voted on patch set 2 V -1 01/19/20, 14:13 Completed build in 10m 57s on Sun, 19 Jan, 02:13 PM Test Summary: 70146 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-40087
-
Oliver Hader updated the commit message in patch set 3 01/19/20, 14:31
-
Oliver Hader commented on patch set 3 CR -1 01/19/20, 14:33
Where does this happen? Logging user deprecations (= deprecations of the TYPO3 core) does make sense. Please try to describe your use case or scenario better why it should be handled like this. Thanks in advance! -
TYPO3com voted on patch set 3 V -1 01/19/20, 14:42 Completed build in 10m 42s on Sun, 19 Jan, 02:42 PM Test Summary: 70447 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-40091
-
Stephan Großberndt commented on patch set 3 01/19/20, 14:45
-
Vito Alexander Nordloh commented on patch set 3 01/19/20, 20:37
> Patch Set 3: Code-Review-1 > > Where does this happen? Logging user deprecations (= deprecations of the TYPO3 core) does make sense. Please try to describe your use case or scenario better why it should be handled like this. Thanks in advance! Thanks for your response! The main problem is that the error reporting is hard coded in TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::initializeBasicErrorReporting and therefore can't be changed in the backend nor through a php.ini. The SystemEnvironmentBuilder::initializeBasicErrorReporting method is called at the very beginning, much longer before the custom error settings (made, e.g., via the backend) take effect. In between, before the custom settings take effect, the extensions are loaded and might lead to thrown E_USER_DEPRECATED errors. For example, as in our case, if the extension accesses $TSFE->sys_language_uid during the initialization period such an error is thrown (see https://github.com/TYPO3/TYPO3.CMS/blob/9.5/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php#L5104 where the trigger_error function is called). Logging deprecations is a matter of the environment in my opinion. I definitely agree that they should be logged in a development environment, but not in a production environment. In our case that led to gigabytes of log files per minute and was only avoidable by editing the TYPO3 source directly (respectively forking the repository, which we are trying to avoid as well). The best solution would be to make the default values of initializeBasicErrorReporting configurable, but that should be discussed elsewhere. Since these default values are only active during a short initialisation period, adding E_USER_DEPRECATED should not cause any damage and makes such extensions (which cause these errors) usable again in a productive environment. -
Vito Alexander Nordloh commented on patch set 3 01/20/20, 07:32
> Patch Set 3: > > > Patch Set 3: Code-Review-1 > > > > Where does this happen? Logging user deprecations (= deprecations of the TYPO3 core) does make sense. Please try to describe your use case or scenario better why it should be handled like this. Thanks in advance! > > Thanks for your response! > > The main problem is that the error reporting is hard coded in TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::initializeBasicErrorReporting and therefore can't be changed in the backend nor through a php.ini. > > The SystemEnvironmentBuilder::initializeBasicErrorReporting method is called at the very beginning, much longer before the custom error settings (made, e.g., via the backend) take effect. In between, before the custom settings take effect, the extensions are loaded and might lead to thrown E_USER_DEPRECATED errors. For example, as in our case, if the extension accesses $TSFE->sys_language_uid during the initialization period such an error is thrown (see https://github.com/TYPO3/TYPO3.CMS/blob/9.5/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php#L5104 where the trigger_error function is called). > > Logging deprecations is a matter of the environment in my opinion. I definitely agree that they should be logged in a development environment, but not in a production environment. In our case that led to gigabytes of log files per minute and was only avoidable by editing the TYPO3 source directly (respectively forking the repository, which we are trying to avoid as well). The best solution would be to make the default values of initializeBasicErrorReporting configurable, but that should be discussed elsewhere. Since these default values are only active during a short initialisation period, adding E_USER_DEPRECATED should not cause any damage and makes such extensions (which cause these errors) usable again in a productive environment. Me again - I am not quite sure whether its a third party extension which is responsible for the error or the core itself. However, that doesn't change the problem and if it is the core itself, then it is even worse. I can investigate that if you want! -
Benni Mack commented on patch set 3 01/20/20, 09:14
Hey Vito, doesn't this solve your issue? https://blog.reelworx.at/detail/deprecation-log-handling-in-typo3-9/ -
Vito Alexander Nordloh commented on patch set 3 01/20/20, 09:17
> Patch Set 3: > > Hey Vito, > > doesn't this solve your issue? https://blog.reelworx.at/detail/deprecation-log-handling-in-typo3-9/ Hi Benni! Thank you! I also found that blog entry, but unfortunately it does not solve the issue. The problem is that the error is thrown before those settings take effect. -
Benni Mack commented on patch set 3 01/20/20, 12:33
Interesting, this would mean you use Deprecated code within LocalConfiguration or AdditionalConfiguration - is that possible? -
Vito Alexander Nordloh commented on patch set 3 01/20/20, 17:22
> Patch Set 3: > > Interesting, > > this would mean you use Deprecated code within LocalConfiguration or AdditionalConfiguration - is that possible? Unfortunately not, I checked that multiple times. For example, I am getting the following deprecation message: PHP message: PHP Deprecated: Overriding object implementations via TypoScript settings config.tx_extbase.objects and plugin.tx_%plugin%.objects will be removed in TYPO3 v10.0. in ***/typo3_src-9.5.13/typo3/sysext/extbase/Classes/Core/Bootstrap.php on line 127 (https://github.com/TYPO3/TYPO3.CMS/blob/v9.5.13/typo3/sysext/extbase/Classes/Core/Bootstrap.php#L127) I also checked that: - the error_reporting is set to ignore E_USER_DEPRECATED in php.ini (and I checked the php_info() page within the backend of Typo3 that I changed the right version of php.ini) - the error settings in the install tool are configured to ignore E_USER_DEPRECATED messages -
Vito Alexander Nordloh commented on patch set 3 01/20/20, 17:43
> Patch Set 3: > > > Patch Set 3: > > > > Interesting, > > > > this would mean you use Deprecated code within LocalConfiguration or AdditionalConfiguration - is that possible? > > Unfortunately not, I checked that multiple times. For example, I am getting the following deprecation message: > > PHP message: PHP Deprecated: Overriding object implementations via TypoScript settings > config.tx_extbase.objects and plugin.tx_%plugin%.objects will be removed in TYPO3 v10.0. > in ***/typo3_src-9.5.13/typo3/sysext/extbase/Classes/Core/Bootstrap.php on line 127 > > (https://github.com/TYPO3/TYPO3.CMS/blob/v9.5.13/typo3/sysext/extbase/Classes/Core/Bootstrap.php#L127) > > I also checked that: > > - the error_reporting is set to ignore E_USER_DEPRECATED in php.ini (and I checked the php_info() page within the backend of Typo3 that I changed the right version of php.ini) > - the error settings in the install tool are configured to ignore E_USER_DEPRECATED messages Additionally: if the error would have been thrown AFTER initializing the error reporting based on the settings in the backend or extensions, my proposed change should not have made any difference and the error should have been thrown in any case (just a quick thought, I might be wrong). By the way, currently we use nginx to forward php error message to syslog (just in case this makes any difference). But I also would not expect php/Typo3 to log deprecation messages to stderr. -
Helmut Hummel commented on patch set 3 04/29/20, 20:21
> Unfortunately not, I checked that multiple times. For example, I am getting the following deprecation message: Unfortunately, the solution described in the article does not fix the issue when deprecation messages are triggered in other extensions that are loaded before the extension that has this setting. You MUST set the configuration in your AdditionalConfiguration.php Here is what you must put in your AdditionalConfiguration.php for your production environment: $GLOBALS['TYPO3_CONF_VARS']['LOG']['TYPO3']['CMS']['deprecations']['writerConfiguration'][\TYPO3\CMS\Core\Log\LogLevel::NOTICE] = []; If you do so, deprecation messages are gone. Make sure as well, that $GLOBALS['TYPO3_CONF_VARS']['SYS']['errorHandlerErros'] also INCLUDE E_USER_DEPRECATED errors -
Helmut Hummel commented on patch set 3 CR -2 04/29/20, 21:03
Please check whether https://review.typo3.org/c/Packages/TYPO3.CMS/+/56077 fixes your issues -
Benjamin Franzke abandoned the change 05/20/20, 23:33
Thank you for the patch, https://review.typo3.org/c/Packages/TYPO3.CMS/+/56077 has been merged in the meantime which. This patch es solves this issue without breaking deprecation log handling. It ensures that E_USER_DEPRECATED errors are *always* handled by the TYPO3 error handler. Abandoning this patch for that reason.