Project

General

Profile

Actions

Bug #91204

closed

Migrates existing sys_log entries into sys_history fails sometimes

Added by Kurt Gusbeth over 4 years ago. Updated about 2 years ago.

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

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

We had/have sometimes problems to extecute the Upgrade wizard
Migrates existing sys_log entries into sys_history
sucessfully. It breaks down. Even when the db-table sys_log is empty it is not working alwaly.
Current error message (TYPO3 9.5.15):

Whoops, looks like something went wrong.
(1/1) TypeError

Argument 4 passed to TYPO3\CMS\Install\Updates\SeparateSysHistoryFromSysLogUpdate::updateTablesAndTrackProgress() must be of the type array, boolean given, called in /html/typo3-dev/typo3_src-9.5.15/typo3/sysext/install/Classes/Updates/SeparateSysHistoryFromSysLogUpdate.php on line 195

Because it happens again and again, someone should fix this bug!

Actions #1

Updated by Kurt Gusbeth over 4 years ago

The install tool seems to create entries in sys_log too. When I delete them just before executing this wizard on an empty sys_log table
the wizard is working without an error.

Actions #2

Updated by Paul Beck over 4 years ago

I can confirm this issue.. It happens when sys_log`s DB entries have an empty log_data field which cannot be unserialize() in line 172 of SeparateSysHistoryFromSysLogUpdate.php

Actions #3

Updated by Franz Holzinger about 4 years ago

This error still happens in TYPO3 9.5.22.

 TypeError

Argument 4 passed to TYPO3\CMS\Install\Updates\SeparateSysHistoryFromSysLogUpdate::updateTablesAndTrackProgress() must be of the type array, boolean given, called in /home/www/doc/path/typo3_src-9.5.22/typo3/sysext/install/Classes/Updates/SeparateSysHistoryFromSysLogUpdate.php on line 195
in /home/www/doc/path/typo3_src-9.5.22/typo3/sysext/install/Classes/Updates/SeparateSysHistoryFromSysLogUpdate.php line 242

     * @param array $logData
     * @param array $row
     * @return array
     */
    protected function updateTablesAndTrackProgress(
        Connection $connection,
        Connection $connectionForSysRegistry,
        array $updateData,
        array $logData,

at TYPO3\CMS\Install\Updates\SeparateSysHistoryFromSysLogUpdate->updateTablesAndTrackProgress(object(TYPO3\CMS\Core\Database\Connection), object(TYPO3\CMS\Core\Database\Connection), array('actiontype' => 2, 'usertype' => 'BE', 'userid' => 2, 'sys_log_uid' => 0, 'history_data' => '{"oldRecord":{"config":"\\r\\ntemp.submenu {\\r\\n 10 {\\r\\n value =\\r\\n wrap = <div class=\\"submenu\\"> | <\\/div>\\r\\n }\\r\\n}\\r\\n\\r\\ntemp.logo {\\r\\n 20 {\\r\\n\\tfile.width = 500\\r\\n }\\r\\n 30 = TEXT\\r\\n 30 {\\r\\n wrap = &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\r\\n }\\r\\n 40 = IMAGE\\r\\n 40 {\\r\\n file = {$mastertemplate.path}\\/images\\/typo3logo.gif\\r\\n wrap=<a href=\\"http:\\/\\/www.typo3.org\\">|<\\/a>\\r\\n }\\r\\n}\\r\\n\\r\\ntemp.right {\\r\\n 5 = CONTENT \\r\\n 5 {\\r\\n table = tt_content\\r\\n select {\\r\\n orderBy = sorting\\r\\n pidInList = 17\\r\\n where = colPos = 0\\r\\n }\\r\\n }\\r\\n}\\r\\n\\r\\n<INCLUDE_TYPOSCRIPT: source=\\"FILE: EXT:mastertemplate\\/static\\/setup.txt\\">\\r\\n\\r\\n"},"newRecord":{"config":"\\r\\ntemp.submenu {\\r\\n 10 {\\r\\n value =\\r\\n wrap = <div class=\\"submenu\\"> | <\\/div>\\r\\n }\\r\\n}\\r\\n\\r\\ntemp.logo {\\r\\n 20 {\\r\\n\\tparams = style=\\"margin: 0px 20px;\\"\\r\\n\\tfile.width = 500\\r\\n }\\r\\n 30 = TEXT\\r\\n 30 {\\r\\n wrap = &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\\r\\n }\\r\\n 40 = IMAGE\\r\\n 40 {\\r\\n file = {$mastertemplate.path}\\/images\\/typo3logo.gif\\r\\n wrap=<a href=\\"http:\\/\\/www.typo3.org\\">|<\\/a>\\r\\n }\\r\\n}\\r\\n\\r\\ntemp.right {\\r\\n 5 = CONTENT \\r\\n 5 {\\r\\n table = tt_content\\r\\n select {\\r\\n orderBy = sorting\\r\\n pidInList = 17\\r\\n where = colPos = 0\\r\\n }\\r\\n }\\r\\n}\\r\\n\\r\\n<INCLUDE_TYPOSCRIPT: source=\\"FILE: EXT:mastertemplate\\/static\\/setup.txt\\">\\r\\n\\r\\n"}}', 'originaluserid' => null), false, array('history_uid' => 1422, 'history_data' => 'a:2:{s:9:"oldRecord";a:1:{s:6:"config";s:599:" temp.submenu { 10 { value = wrap = <div class="submenu"> | </div> } } temp.logo { 20 { file.width = 500 } 30 = TEXT 30 { wrap = &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } 40 = IMAGE 40 { file = {$mastertemplate.path}/images/typo3logo.gif wrap=<a href="http://www.typo3.org">|</a> } } temp.right { 5 = CONTENT 5 { table = tt_content select { orderBy = sorting pidInList = 17 where = colPos = 0 } } } <INCLUDE_TYPOSCRIPT: source="FILE: EXT:mastertemplate/static/setup.txt"> ";}s:9:"newRecord";a:1:{s:6:"config";s:636:" temp.submenu { 10 { value = wrap = <div class="submenu"> | </div> } } temp.logo { 20 { params = style="margin: 0px 20px;" file.width = 500 } 30 = TEXT 30 { wrap = &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } 40 = IMAGE 40 { file = {$mastertemplate.path}/images/typo3logo.gif wrap=<a href="http://www.typo3.org">|</a> } } temp.right { 5 = CONTENT 5 { table = tt_content select { orderBy = sorting pidInList = 17 where = colPos = 0 } } } <INCLUDE_TYPOSCRIPT: source="FILE: EXT:mastertemplate/static/setup.txt"> ";}}', 'uid' => 311, 'userid' => 2, 'action' => 0, 'recuid' => 0, 'tablename' => '', 'recpid' => 0, 'error' => 2, 'details' => 'Core: Exception handler (WEB): Uncaught TYPO3 Exception: Using $this when not in object context | Error thrown in file /home/www/doc/path/typo3conf/ext/tt_products/Classes/Api/BasketApi.php in line 71. Requested URL: http://neu.ttproducts.de/index.php?id=tt_products_ext', 'tstamp' => 1526473079, 'type' => 5, 'details_nr' => 0, 'IP' => '89.0.250.199', 'log_data' => '', 'event_pid' => -1, 'workspace' => 0, 'NEWid' => '', 'pid' => 0, 'request_id' => '', 'time_micro' => 0.0, 'component' => '', 'level' => 0, 'message' => null, 'data' => null))
in /home/www/doc/path/typo3_src-9.5.22/typo3/sysext/install/Classes/Updates/SeparateSysHistoryFromSysLogUpdate.php line 195

                            $connection,
                            $connection,
                            $updateData,
                            $logData,
                            $row
                        );
                        $connection->commit();
                    } catch (\Exception $up) {
                        $connection->rollBack();

at TYPO3\CMS\Install\Updates\SeparateSysHistoryFromSysLogUpdate->moveDataFromSysLogToSysHistory(object(TYPO3\CMS\Core\Database\Connection), object(TYPO3\CMS\Core\Database\Connection), array('phase' => 0, 'uid' => 1421))
in /home/www/doc/path/typo3_src-9.5.22/typo3/sysext/install/Classes/Updates/SeparateSysHistoryFromSysLogUpdate.php line 125

        if ($startPositionAndPhase['phase'] === self::MOVE_DATA) {
            $startPositionAndPhase = $this->moveDataFromSysLogToSysHistory(
                $connection,
                $connectionForSysRegistry,
                $startPositionAndPhase
            );
        }

        if ($startPositionAndPhase['phase'] === self::UPDATE_HISTORY) {

at TYPO3\CMS\Install\Updates\SeparateSysHistoryFromSysLogUpdate->executeUpdate()
in /home/www/doc/path/typo3_src-9.5.22/typo3/sysext/install/Classes/Service/UpgradeWizardsService.php line 397

                        $performResult = true;
                    }
                } else {
                    // confirmation yes or non-confirmable
                    $performResult = $updateObject->executeUpdate();
                }
            }

            $stream = $this->output->getStream();

at TYPO3\CMS\Install\Service\UpgradeWizardsService->executeWizard('separateSysHistoryFromLog')
in /home/www/doc/path/typo3_src-9.5.22/typo3/sysext/install/Classes/Controller/UpgradeController.php line 1000

        // ext_localconf, db and ext_tables must be loaded for the updates :(
        $this->loadExtLocalconfDatabaseAndExtTables();
        $upgradeWizardsService = new UpgradeWizardsService();
        $identifier = $request->getParsedBody()['install']['identifier'];
        $messages = $upgradeWizardsService->executeWizard($identifier);
        return new JsonResponse([
            'success' => true,
            'status' => $messages,
        ]);

at TYPO3\CMS\Install\Controller\UpgradeController->upgradeWizardsExecuteAction(object(TYPO3\CMS\Core\Http\ServerRequest))
in /home/www/doc/path/typo3_src-9.5.22/typo3/sysext/install/Classes/Http/RequestHandler.php line 221

                    'Unknown action method ' . $action . ' in controller ' . $controllerName,
                    1505216027
                );
            }
            $response = $controller->$action($request);
        }

        return $response;
    }

at TYPO3\CMS\Install\Http\RequestHandler->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /home/www/doc/path/typo3_src-9.5.22/typo3/sysext/install/Classes/Http/Application.php line 65

    {
        $this->initializeContext();
        foreach ($this->availableRequestHandlers as $handler) {
            if ($handler->canHandleRequest($request)) {
                return $handler->handle($request)
                    ->withHeader('X-Frame-Options', 'SAMEORIGIN');
            }
        }
        throw new \TYPO3\CMS\Core\Exception('No suitable request handler found.', 1518448686);

at TYPO3\CMS\Install\Http\Application->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /home/www/doc/path/typo3_src-9.5.22/typo3/sysext/core/Classes/Http/AbstractApplication.php line 120

    final public function run(callable $execute = null)
    {
        try {
            $response = $this->handle(
                \TYPO3\CMS\Core\Http\ServerRequestFactory::fromGlobals()
            );
            if ($execute !== null) {
                call_user_func($execute);
            }

at TYPO3\CMS\Core\Http\AbstractApplication->run()
in /home/www/doc/path/typo3_src-9.5.22/typo3/install.php line 104

call_user_func(function () {
    $classLoader = require dirname(__DIR__).'/vendor/autoload.php';
    \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(1, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_INSTALL);
    \TYPO3\CMS\Core\Core\Bootstrap::init($classLoader, true)->get(\TYPO3\CMS\Install\Http\Application::class)->run();
});

at {closure}()
in /home/www/doc/path/typo3_src-9.5.22/typo3/install.php line 105

call_user_func(function () {
    $classLoader = require dirname(__DIR__).'/vendor/autoload.php';
    \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(1, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_INSTALL);
    \TYPO3\CMS\Core\Core\Bootstrap::init($classLoader, true)->get(\TYPO3\CMS\Install\Http\Application::class)->run();
});

Actions #4

Updated by Gerrit Code Review over 2 years ago

  • Status changed from New to Under Review

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

Actions #5

Updated by Benni Mack over 2 years ago

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

Updated by Sebastien Michel about 2 years ago

Benni Mack wrote in #note-5:

Applied in changeset 29c832d76421f063813886b73e8e84603b91a3ed.

Anyone knows how-to backport this patch in branch 9?

Actions #7

Updated by Sebastien Michel about 2 years ago

Note : Don't understand why this ticket was marked as resolved as branch 9 was not patched.

If branch 9 was not patched, can we skip that update when moving to branch 9 and do it only when moving to branch 10? I have a couple of installs to migrate from TYPO3 8 to 10. Thanks!

Actions #8

Updated by Benni Mack about 2 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF