Project

General

Profile

Actions

Bug #86877

closed

refindex:update does not work in CLI-Context

Added by Hannes Strangmeier over 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2018-11-07
Due date:
% Done:

100%

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

Description

Hi,

while updating the referenceindex on the commandline I get the following error:

me@mymachine:/path/to/typo3# php typo3/sysext/core/bin/typo3 referenceindex:update

*******************************************
Reference Index being Updated
*******************************************

Uncaught TYPO3 Exception Argument 1 passed to TYPO3\CMS\Core\Session\Backend\DatabaseSessionBackend::update() must be of the type string, null given, called in /path/to/typo3/typo3_src-9.5.1/typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php on line 1277
thrown in file /path/to/typo3/typo3_src-9.5.1/typo3/sysext/core/Classes/Session/Backend/DatabaseSessionBackend.php
in line 159

It looks like this is caused by typo3/sysext/core/Classes/Database/ReferenceIndex.php
Around line 1480 a FlashMessage is created, but the current context is not taken into account. Since there is no backend-session in the CLI context, this fails:

        $flashMessage = GeneralUtility::makeInstance(
            FlashMessage::class,
            $errorCount ? implode('##LF##', $errors) : 'Index Integrity was perfect!',
            $recordsCheckedString,
            $errorCount ? FlashMessage::ERROR : FlashMessage::OK
        );
        /** @var \TYPO3\CMS\Core\Messaging\FlashMessageService $flashMessageService */
        $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
        /** @var \TYPO3\CMS\Core\Messaging\FlashMessageQueue $defaultFlashMessageQueue */
        $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
        $defaultFlashMessageQueue->enqueue($flashMessage);
        $bodyContent = $defaultFlashMessageQueue->renderFlashMessages();

According to https://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/FlashMessages/Index.html I would assume, that FlashMessageRendererResolver should be used?
The referenceindex seems to be updated nontheless, but in environments where you determine the success of the referenceindex update based on the exit code (which is 1 in this case), you can only assume that it failed (thereby preventing further steps to be taken, unless you do not care about errors at all).

Initially i tested this on a fresh installation with the introductionpackage (installed via preconfigured distribution). The error also persists after deinstalling both bootstrap_package as well as introduction. So i assume that it is a core-issue.

I was able to reproduce this in different environments, including a Ubuntu 16.04.2 LTS‬ with Plesk 17.8 on and PHP 7.2.11 with TYPO3 9.5.1 (non-composer)


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #93549: DataHandler unusable in CLI (Symfony) mode because FlashMessages using session dataClosed2021-02-19

Actions
Actions

Also available in: Atom PDF