Closed gilbertsoft closed 2 years ago
which TYPO3/PHP Version? (works for me with 10 and 7.2)
V11.5.14 and PHP 8.0
@chrcan
ok, got it, seems a problem with typo3-console and DataHandler used in the Upgrade Wizard (no idea why at the moment)
I would recommend to use to container:sorting --apply
ddev exec -- typo3cms container:sorting --apply
I'm currently working with the container version 1.6.1 can wait until a fix comes ... But I will test your suggestion Thanks
@achimfritz my guess, it's related to the new be auth in v11 which makes a http request but the url could not be properly calculated because of the missing information in the cli context. That's why it may also be a misconfiguration e.g. for other console commands the url can be defined. But I'm wondering why a be login is needed here at all.... Avoiding it would solve the issue as far as I can see. Maybe also @helhum has a hint.
the Migration use DataHandler to fix sorting
The following patch solve these issue for us.
Works within deployment with typo3_console
and Install Tool with a normal login.
The standalone Install Tool will not work. Some error with missing a global request object within method initializeBackendAuthentication
.
Index: Classes/Updates/ContainerMigrateSorting.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/Classes/Updates/ContainerMigrateSorting.php b/Classes/Updates/ContainerMigrateSorting.php
--- a/Classes/Updates/ContainerMigrateSorting.php
+++ b/Classes/Updates/ContainerMigrateSorting.php (date 1662016044833)
@@ -13,7 +13,10 @@
*/
use B13\Container\Integrity\Sorting;
+use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
+use TYPO3\CMS\Core\Authentication\CommandLineUserAuthentication;
use TYPO3\CMS\Core\Core\Bootstrap;
+use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite;
use TYPO3\CMS\Install\Updates\RepeatableInterface;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
@@ -61,7 +64,7 @@
public function executeUpdate(): bool
{
- Bootstrap::initializeBackendUser();
+ Bootstrap::initializeBackendUser(Environment::isCli() ? CommandLineUserAuthentication::class : BackendUserAuthentication::class);
Bootstrap::initializeBackendAuthentication();
Bootstrap::initializeLanguageObject();
$this->sorting->run(false);
Index: Classes/Updates/ContainerDeleteChildrenWithWrongPid.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/Classes/Updates/ContainerDeleteChildrenWithWrongPid.php b/Classes/Updates/ContainerDeleteChildrenWithWrongPid.php
--- a/Classes/Updates/ContainerDeleteChildrenWithWrongPid.php
+++ b/Classes/Updates/ContainerDeleteChildrenWithWrongPid.php (date 1662016044829)
@@ -15,7 +15,10 @@
use B13\Container\Integrity\Error\WrongPidError;
use B13\Container\Integrity\Integrity;
use B13\Container\Integrity\IntegrityFix;
+use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
+use TYPO3\CMS\Core\Authentication\CommandLineUserAuthentication;
use TYPO3\CMS\Core\Core\Bootstrap;
+use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite;
use TYPO3\CMS\Install\Updates\RepeatableInterface;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
@@ -76,7 +77,7 @@
public function executeUpdate(): bool
{
- Bootstrap::initializeBackendUser();
+ Bootstrap::initializeBackendUser(Environment::isCli() ? CommandLineUserAuthentication::class : BackendUserAuthentication::class);
Bootstrap::initializeBackendAuthentication();
Bootstrap::initializeLanguageObject();
$res = $this->integrity->run();
the Migration use DataHandler to fix sorting
@achimfritz Upgrade Wizards always run with a full bootstrapped TYPO3. So the question is, why you think you need to add some bootstrap code in addition.
@websi , @helhum thanks for feedback, no bootstrap is required for cli mode and also not for TYPO3 v10 Install-Tool. but bootstrap is required for TYPO3 v11 Install Tool (else the Datahandler throws an Exception because has no BE_USER)
@achimfritz then this is a bug in v11 install tool I would argue
no bootstrap is required for cli mode and also not for TYPO3 v10 Install-Tool. but bootstrap is required for TYPO3 v11 Install Tool (else the Datahandler throws an Exception because has no BE_USER)
I looked into the code of 10.4 and 11.5. In both versions a backend user is initialized properly (like it should) on CLI, but not for web requests in the install tool. This is a TYPO3 bug, that needs to be fixed within TYPO3, otherwise upgrade wizards can't run DataHandler actions reliably.
With that in mind, I'd argue the bootstrap code should rather removed here to allow execution of the wizards on CLI.
Looks like the commit https://github.com/b13/container/commit/944da0d19190bed39cbc85175ee73aa8eea27df8 is breaking using the TYPO3 Console to run the upgrade wizard. Can you confirm this or is it maybe a misconfiguration?
This problem was discovered by @chrcan during an update today.