#109968Command application loads all commands with incomplete Container
Description
In some edge cases the \TYPO3\CMS\Core\Console\CommandApplication will try to load all registered commands, even if only the minimal fallback container has been initialized.
The issue can be reproduced by executing bin/typo3 dump in a Composer installation.
Observed errors
I’ve seen 3 different error messages during my tests:
> Too few arguments to function TYPO3\CMS\Core\Schema\TcaSchemaFactory::__construct(), 0 passed in typo3/sysext/core/Classes/Utility/GeneralUtility.php on line 2884
> Uncaught TYPO3 Exception Too few arguments to function TYPO3\CMS\Core\Registry::__construct(), 0 passed in typo3/sysext/core/Classes/Utility/GeneralUtility.php on line 2489 and exactly 2 expected thrown in file typo3/sysext/core/Classes/Registry.php in line 45
Both are caused by \TYPO3\CMS\Impexp\Import::fetchStorages() which is called in the constructor.
> No TCA schema exists for the name “sys_redirect”.
This one is caused by the \TYPO3\CMS\Redirects\Command\CleanupRedirectsCommand which depends on the \TYPO3\CMS\Redirects\Repository\RedirectRepository which tries to fetch the sys_redirect TCA schema in its contructor.
The hidden error
Both errors mask the actual error message that should be displayed because the command is disabled in a Composer environment.
> The command “dumpautoload” does not exist.
This happens due to the alias resolution in the Command Application and Symfony Console’s error handling:
- First it checks, if a full boot is needed, since the alias is not known, it assumes it is
- In a later check the real command
dumpautoloadhas been resolved and a full boot is no longer required. This means the TCA will not be initialized - The
dumpautoloadcommand is not enabled in Composer environments. Therefore Symfony will fail with a\Symfony\Component\Console\Exception\CommandNotFoundException - During the Failure, Symfony will load all commands to show more information to the user
- This will crash for commands of which the constructor depends on a fully available Container / TCA
Possible solutions
- Make sure the container is fully initialized, if the command is not available (current Patch)
- Alternative 1: Fix the underlying issues by making the Command Constructors more robust and not rely on TCA functions
- Alternative 2: Remove fallback logic that boots the container without loading TCA -> uses can not rely on aliases, the full command must be used
Reviews 1
History 46
-
Gerrit Code Review pushed patch set 1 for main to change 94286 status
NewUnder Review <span data-processor="relativetime" data-value="2026-06-02T23:20:28+00:00" > 06/02/26, 23:20 </span> -
Alexander Stehlik changed description <span data-processor="relativetime" data-value="2026-06-03T05:59:01+00:00" > 06/03/26, 05:59 </span>
-
Alexander Stehlik changed description <span data-processor="relativetime" data-value="2026-08-06T22:08:28+00:00" > 08/06/26, 22:08 </span>
-
Alexander Stehlik changed description <span data-processor="relativetime" data-value="2026-08-06T22:08:45+00:00" > 08/06/26, 22:08 </span>
-
Alexander Stehlik changed description <span data-processor="relativetime" data-value="2026-08-06T22:08:56+00:00" > 08/06/26, 22:08 </span>
-
Gerrit Code Review pushed patch set 2 for main to change 94286 <span data-processor="relativetime" data-value="2026-10-02T07:01:30+00:00" > 10/02/26, 07:01 </span>