Bug #91114

InstallTool: Symfony Container is used to clear its own caches

Added by Benjamin Franzke 3 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Install Tool
Target version:
Start date:
2020-04-18
Due date:
% Done:

100%

TYPO3 Version:
10
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Original report by Josef Glatz:

Pressing the Clear caches button were also only green after pressing the button twice. (error log of first press)

Steps to reproduce:

Error in log:

Sat, 18 Apr 2020 07:17:32 +0200 [CRITICAL] request="5b7f01c997491" component="TYPO3.CMS.Core.Error.DebugExceptionHandler": Core: Exception handler (WEB): Uncaught TYPO3 Exception: Too few arguments to function TYPO3\CMS\Core\Localization\LanguageService::__construct(), 0 passed in /app/web/typo3/sysext/core/Classes/Utility/GeneralUtility.php on line 3425 and exactly 2 expected | ArgumentCountError thrown in file /app/web/typo3/sysext/core/Classes/Localization/LanguageService.php in line 120. Requested URL: http://10.master.t3.docker/typo3/install.php?install[controller]=maintenance&install[action]=cacheClearAll - {"TYPO3_MODE":"BE","exception":{"xdebug_message":"<tr><th align='left' bgcolor='#f57900' colspan=\"5\"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> ArgumentCountError: Too few arguments to function TYPO3\\CMS\\Core\\Localization\\LanguageService::__construct(), 0 passed in /app/web/typo3/sysext/core/Classes/Utility/GeneralUtility.php on line 3425 and exactly 2 expected in /app/web/typo3/sysext/core/Classes/Localization/LanguageService.php on line <i>120</i></th></tr>\n<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>\n<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>\n<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0007</td><td bgcolor='#eeeeec' align='right'>409464</td><td bgcolor='#eeeeec'>{main}(  )</td><td title='/app/web/typo3/install.php' bgcolor='#eeeeec'>.../install.php<b>:</b>0</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>0.0007</td><td bgcolor='#eeeeec' align='right'>409784</td><td bgcolor='#eeeeec'>{closure:/app/web/typo3/install.php:101-105}(  )</td><td title='/app/web/typo3/install.php' bgcolor='#eeeeec'>.../install.php<b>:</b>105</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>3</td><td bgcolor='#eeeeec' align='center'>0.1395</td><td bgcolor='#eeeeec' align='right'>1642592</td><td bgcolor='#eeeeec'>TYPO3\\CMS\\Install\\Http\\Application->run(  )</td><td title='/app/web/typo3/install.php' bgcolor='#eeeeec'>.../install.php<b>:</b>104</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>4</td><td bgcolor='#eeeeec' align='center'>0.1522</td><td bgcolor='#eeeeec' align='right'>1670704</td><td bgcolor='#eeeeec'>TYPO3\\CMS\\Install\\Http\\Application->handle(  )</td><td title='/app/web/typo3/sysext/core/Classes/Http/AbstractApplication.php' bgcolor='#eeeeec'>.../AbstractApplication.php<b>:</b>97</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>5</td><td bgcolor='#eeeeec' align='center'>0.1545</td><td bgcolor='#eeeeec' align='right'>1676592</td><td bgcolor='#eeeeec'>TYPO3\\CMS\\Install\\Http\\Application->handle(  )</td><td title='/app/web/typo3/sysext/install/Classes/Http/Application.php' bgcolor='#eeeeec'>.../Application.php<b>:</b>50</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>6</td><td bgcolor='#eeeeec' align='center'>0.1545</td><td bgcolor='#eeeeec' align='right'>1676592</td><td bgcolor='#eeeeec'>TYPO3\\CMS\\Core\\Http\\MiddlewareDispatcher->handle(  )</td><td title='/app/web/typo3/sysext/core/Classes/Http/AbstractApplication.php' bgcolor='#eeeeec'>.../AbstractApplication.php<b>:</b>85</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>7</td><td bgcolor='#eeeeec' align='center'>0.1545</td><td bgcolor='#eeeeec' align='right'>1676592</td><td bgcolor='#eeeeec'>{anonymous-class:/app/web/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:138-174}->handle(  )</td><td title='/app/web/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php' bgcolor='#eeeeec'>.../MiddlewareDispatcher.php<b>:</b>78</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>8</td><td bgcolor='#eeeeec' align='center'>0.1551</td><td bgcolor='#eeeeec' align='right'>1742816</td><td bgcolor='#eeeeec'>TYPO3\\CMS\\Core\\Middleware\\NormalizedParamsAttribute->process(  )</td><td title='/app/web/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php' bgcolor='#eeeeec'>.../MiddlewareDispatcher.php<b>:</b>172</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>9</td><td bgcolor='#eeeeec' align='center'>0.1557</td><td bgcolor='#eeeeec' align='right'>1749152</td><td bgcolor='#eeeeec'>{anonymous-class:/app/web/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php:103-123}->handle(  )</td><td title='/app/web/typo3/sysext/core/Classes/Middleware/NormalizedParamsAttribute.php' bgcolor='#eeeeec'>.../NormalizedParamsAttribute.php<b>:</b>45</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>10</td><td bgcolor='#eeeeec' align='center'>0.1557</td><td bgcolor='#eeeeec' align='right'>1749152</td><td bgcolor='#eeeeec'>TYPO3\\CMS\\Install\\Middleware\\Maintenance->process(  )</td><td title='/app/web/typo3/sysext/core/Classes/Http/MiddlewareDispatcher.php' bgcolor='#eeeeec'>.../MiddlewareDispatcher.php<b>:</b>121</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>11</td><td bgcolor='#eeeeec' align='center'>0.1841</td><td bgcolor='#eeeeec' align='right'>1777120</td><td bgcolor='#eeeeec'>TYPO3\\CMS\\Install\\Controller\\MaintenanceController->cacheClearAllAction(  )</td><td title='/app/web/typo3/sysext/install/Classes/Middleware/Maintenance.php' bgcolor='#eeeeec'>.../Maintenance.php<b>:</b>231</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>12</td><td bgcolor='#eeeeec' align='center'>0.1841</td><td bgcolor='#eeeeec' align='right'>1777120</td><td bgcolor='#eeeeec'>TYPO3\\CMS\\Install\\Service\\ClearCacheService->clearAll(  )</td><td title='/app/web/typo3/sysext/install/Classes/Controller/MaintenanceController.php' bgcolor='#eeeeec'>.../MaintenanceController.php<b>:</b>125</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>13</td><td bgcolor='#eeeeec' align='center'>0.5370</td><td bgcolor='#eeeeec' align='right'>2566840</td><td bgcolor='#eeeeec'>TYPO3\\CMS\\Install\\Service\\LateBootService->loadExtLocalconfDatabaseAndExtTables(  )</td><td title='/app/web/typo3/sysext/install/Classes/Service/ClearCacheService.php' bgcolor='#eeeeec'>.../ClearCacheService.php<b>:</b>74</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>14</td><td bgcolor='#eeeeec' align='center'>0.8065</td><td bgcolor='#eeeeec' align='right'>3736672</td><td bgcolor='#eeeeec'>TYPO3\\CMS\\Core\\Core\\Bootstrap::loadBaseTca(  )</td><td title='/app/web/typo3/sysext/install/Classes/Service/LateBootService.php' bgcolor='#eeeeec'>.../LateBootService.php<b>:</b>141</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>15</td><td bgcolor='#eeeeec' align='center'>0.8066</td><td bgcolor='#eeeeec' align='right'>3736672</td><td bgcolor='#eeeeec'>TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility::loadBaseTca(  )</td><td title='/app/web/typo3/sysext/core/Classes/Core/Bootstrap.php' bgcolor='#eeeeec'>.../Bootstrap.php<b>:</b>517</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>16</td><td bgcolor='#eeeeec' align='center'>0.8066</td><td bgcolor='#eeeeec' align='right'>3736672</td><td bgcolor='#eeeeec'>TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility::buildBaseTcaFromSingleFiles(  )</td><td title='/app/web/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php' bgcolor='#eeeeec'>.../ExtensionManagementUtility.php<b>:</b>1660</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>17</td><td bgcolor='#eeeeec' align='center'>1.1033</td><td bgcolor='#eeeeec' align='right'>4371344</td><td bgcolor='#eeeeec'>require( <font color='#00bb00'>'/app/web/typo3conf/ext/cropvariantsbuilder/Configuration/TCA/Overrides/sys_file_reference.php'</font> )</td><td title='/app/web/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php' bgcolor='#eeeeec'>.../ExtensionManagementUtility.php<b>:</b>1706</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>18</td><td bgcolor='#eeeeec' align='center'>1.1033</td><td bgcolor='#eeeeec' align='right'>4371664</td><td bgcolor='#eeeeec'>TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility::{closure:/app/web/typo3conf/ext/cropvariantsbuilder/Configuration/TCA/Overrides/sys_file_reference.php:11-38}(  )</td><td title='/app/web/typo3conf/ext/cropvariantsbuilder/Configuration/TCA/Overrides/sys_file_reference.php' bgcolor='#eeeeec'>.../sys_file_reference.php<b>:</b>40</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>19</td><td bgcolor='#eeeeec' align='center'>1.1409</td><td bgcolor='#eeeeec' align='right'>4396880</td><td bgcolor='#eeeeec'>JosefGlatz\\CropVariantsBuilder\\CropVariant::create(  )</td><td title='/app/web/typo3conf/ext/cropvariantsbuilder/Configuration/TCA/Overrides/sys_file_reference.php' bgcolor='#eeeeec'>.../sys_file_reference.php<b>:</b>30</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>20</td><td bgcolor='#eeeeec' align='center'>1.1409</td><td bgcolor='#eeeeec' align='right'>4396880</td><td bgcolor='#eeeeec'>TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(  )</td><td title='/app/web/typo3conf/ext/cropvariantsbuilder/Classes/CropVariant.php' bgcolor='#eeeeec'>.../CropVariant.php<b>:</b>91</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>21</td><td bgcolor='#eeeeec' align='center'>1.1410</td><td bgcolor='#eeeeec' align='right'>4397416</td><td bgcolor='#eeeeec'>JosefGlatz\\CropVariantsBuilder\\CropVariant->__construct(  )</td><td title='/app/web/typo3/sysext/core/Classes/Utility/GeneralUtility.php' bgcolor='#eeeeec'>.../GeneralUtility.php<b>:</b>3425</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>22</td><td bgcolor='#eeeeec' align='center'>1.1410</td><td bgcolor='#eeeeec' align='right'>4397416</td><td bgcolor='#eeeeec'>JosefGlatz\\CropVariantsBuilder\\CropVariant->setDefaultTitle(  )</td><td title='/app/web/typo3conf/ext/cropvariantsbuilder/Classes/CropVariant.php' bgcolor='#eeeeec'>.../CropVariant.php<b>:</b>78</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>23</td><td bgcolor='#eeeeec' align='center'>1.1410</td><td bgcolor='#eeeeec' align='right'>4397416</td><td bgcolor='#eeeeec'>JosefGlatz\\CropVariantsBuilder\\CropVariant->defaultLocalizationAttempt(  )</td><td title='/app/web/typo3conf/ext/cropvariantsbuilder/Classes/CropVariant.php' bgcolor='#eeeeec'>.../CropVariant.php<b>:</b>307</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>24</td><td bgcolor='#eeeeec' align='center'>1.1410</td><td bgcolor='#eeeeec' align='right'>4397656</td><td bgcolor='#eeeeec'>JosefGlatz\\CropVariantsBuilder\\CropVariant->getLanguageService(  )</td><td title='/app/web/typo3conf/ext/cropvariantsbuilder/Classes/CropVariant.php' bgcolor='#eeeeec'>.../CropVariant.php<b>:</b>338</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>25</td><td bgcolor='#eeeeec' align='center'>1.1410</td><td bgcolor='#eeeeec' align='right'>4397656</td><td bgcolor='#eeeeec'>TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(  )</td><td title='/app/web/typo3conf/ext/cropvariantsbuilder/Classes/CropVariant.php' bgcolor='#eeeeec'>.../CropVariant.php<b>:</b>359</td></tr>\n<tr><td bgcolor='#eeeeec' align='center'>26</td><td bgcolor='#eeeeec' align='center'>1.1453</td><td bgcolor='#eeeeec' align='right'>4401664</td><td bgcolor='#eeeeec'>TYPO3\\CMS\\Core\\Localization\\LanguageService->__construct(  )</td><td title='/app/web/typo3/sysext/core/Classes/Utility/GeneralUtility.php' bgcolor='#eeeeec'>.../GeneralUtility.php<b>:</b>3425</td></tr>\n"}}

LanguageService is not known for the old container instance (cache), and can therefore not be instantiated, while the newer class requires a DI configuration.


Related issues

Related to TYPO3 Core - Task #90418: Improve dependency injection container caching Closed 2020-02-18

Associated revisions

Revision e42412a8 (diff)
Added by Benjamin Franzke 3 months ago

[BUGFIX] Avoid using the symfony container to clear its own caches

With the introduction of a custom DI cache in #90418, the container
was used to lookup its own cache and the cache identifier. This
results in bugs if the container cache is stale:
Loading from the cache and flushing the cache will work, but code that
runs after the cache has been flushed (ext_localconf loading) will still
use the a stale container (configuration), as the instance has been
created too early (to be able to clear itself).

Therefore we do now avoid instantiating the symfony container before the
container cache has been cleared.

A positive side effect of this change is that the container cache is
warmed up after the flush.

Releases: master
Resolves: #91114
Related: #90418
Change-Id: I5f10474ab3fab2d17cfdca6cd514b0a95f10bbbc
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64234
Tested-by: Jonas Eberle <>
Tested-by: TYPO3com <>
Tested-by: Helmut Hummel <>
Tested-by: Benjamin Franzke <>
Reviewed-by: Susanne Moog <>
Reviewed-by: Helmut Hummel <>
Reviewed-by: Benjamin Franzke <>

History

#1 Updated by Gerrit Code Review 3 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64234

#2 Updated by Benjamin Franzke 3 months ago

  • Related to Task #90418: Improve dependency injection container caching added

#3 Updated by Gerrit Code Review 3 months ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64234

#4 Updated by Gerrit Code Review 3 months ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64234

#5 Updated by Benjamin Franzke 3 months ago

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

#6 Updated by Benni Mack 3 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF