Issue Bug Closed

#85685Uncaught TYPO3 Exception in form update wizard

Sybille Peters 07/30/18, 13:44 updated 07/31/18, 10:57

Description

Method FormFileExtensionUpdate::checkForUpdate calls FormPersistenceManager::retrieveYamlFilesFromStorageFolders which may throw Exception somewhere along the way.

If this is the case (as seen with 8.7.17), the Upgrade Wizard is no longer usable because the Exception gets thrown and breaks it.

While the error does occur in the indexing of files and only occurred here because of a rather exotically named file, I think this Update Wizard should in any case handle this and the general Upgrade Wizard should still be usable.

Stack Trace (complete stacktrace is attached as file exception-1314516809.txt):

Uncaught TYPO3 Exception
#1314516809: File /user_upload/niederlandistik/bilder/foto_ba\'s.JPG does not exist. (More information)

InvalidArgumentException thrown in file
/var/www/t3dev.uni-oldenburg.de/htdocs5/typo3_src-8.7.17/typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php in line 253.

21 TYPO3\CMS\Core\Resource\Driver\LocalDriver::getFileInfoByIdentifier("/user_upload/niederlandistik/bilder/foto_ba\'s.JPG", array)

/var/www/t3dev.uni-oldenburg.de/htdocs5/typo3_src-8.7.17/typo3/sysext/core/Classes/Resource/ResourceStorage.php:
01414:     public function getFileInfoByIdentifier($identifier, array $propertiesToExtract = [])
01415:     {
01416:         return $this->driver->getFileInfoByIdentifier($identifier, $propertiesToExtract);
01417:     }
01418: 

20 TYPO3\CMS\Core\Resource\ResourceStorage::getFileInfoByIdentifier("/user_upload/niederlandistik/bilder/foto_ba\'s.JPG")

/var/www/t3dev.uni-oldenburg.de/htdocs5/typo3_src-8.7.17/typo3/sysext/core/Classes/Resource/Index/Indexer.php:
00308:     protected function gatherFileInformationArray($identifier)
00309:     {
00310:         $fileInfo = $this->storage->getFileInfoByIdentifier($identifier);
00311:         $fileInfo = $this->transformFromDriverFileInfoArrayToFileObjectFormat($fileInfo);
00312:         $fileInfo['type'] = $this->getFileType($fileInfo['mime_type']);

19 TYPO3\CMS\Core\Resource\Index\Indexer::gatherFileInformationArray("/user_upload/niederlandistik/bilder/foto_ba\'s.JPG")

/var/www/t3dev.uni-oldenburg.de/htdocs5/typo3_src-8.7.17/typo3/sysext/core/Classes/Resource/Index/Indexer.php:
00069:             throw new \InvalidArgumentException('Invalid file identifier given. It must be of type string and not empty. "' . gettype($identifier) . '" given.', 1401732565);
00070:         }
00071:         $fileProperties = $this->gatherFileInformationArray($identifier);
00072:         $record = $this->getFileIndexRepository()->addRaw($fileProperties);
00073:         $fileObject = $this->getResourceFactory()->getFileObject($record['uid'], $record);

18 TYPO3\CMS\Core\Resource\Index\Indexer::createIndexEntry("/user_upload/niederlandistik/bilder/foto_ba\'s.JPG")

/var/www/t3dev.uni-oldenburg.de/htdocs5/typo3_src-8.7.17/typo3/sysext/core/Classes/Resource/ResourceFactory.php:
00431:             $fileData = $this->getFileIndexRepository()->findOneByStorageUidAndIdentifier($storage->getUid(), $fileIdentifier);
00432:             if ($fileData === false) {
00433:                 $fileObject = $this->getIndexer($storage)->createIndexEntry($fileIdentifier);
00434:             } else {
00435:                 $fileObject = $this->getFileObject($fileData['uid'], $fileData);

17 TYPO3\CMS\Core\Resource\ResourceFactory::getFileObjectByStorageAndIdentifier(1, "/user_upload/niederlandistik/bilder/foto_ba\'s.JPG")

/var/www/t3dev.uni-oldenburg.de/htdocs5/typo3_src-8.7.17/typo3/sysext/core/Classes/Resource/ResourceStorage.php:
01513:                 $fileObject = $this->getFileFactory()->getFileObject($rows[$identifier]['uid'], $rows[$identifier]);
01514:             } else {
01515:                 $fileObject = $this->getFileFactory()->getFileObjectByStorageAndIdentifier($this->getUid(), $identifier);
01516:             }
01517:             if ($fileObject instanceof FileInterface) {

16 TYPO3\CMS\Core\Resource\ResourceStorage::getFilesInFolder(TYPO3\CMS\Core\Resource\Folder, 0, 0, boolean, boolean, "", boolean)

/var/www/t3dev.uni-oldenburg.de/htdocs5/typo3_src-8.7.17/typo3/sysext/core/Classes/Resource/Folder.php:
00225:         }
00226: 
00227:         $fileObjects = $this->storage->getFilesInFolder($this, $start, $numberOfItems, $useFilters, $recursive, $sort, $sortRev);
00228: 
00229:         $this->restoreBackedUpFiltersInStorage($backedUpFilters);

15 TYPO3\CMS\Core\Resource\Folder::getFiles(0, 0, 1, boolean)

/var/www/t3dev.uni-oldenburg.de/htdocs5/typo3_src-8.7.17/typo3/sysext/form/Classes/Mvc/Persistence/FormPersistenceManager.php:
00373:                 0,
00374:                 Folder::FILTER_MODE_USE_OWN_AND_STORAGE_FILTERS,
00375:                 true
00376:             );
00377:             $filesFromStorageFolders = $filesFromStorageFolders + $files;

14 TYPO3\CMS\Form\Mvc\Persistence\FormPersistenceManager::retrieveYamlFilesFromStorageFolders()

/var/www/t3dev.uni-oldenburg.de/htdocs5/typo3_src-8.7.17/typo3/sysext/form/Classes/Hooks/FormFileExtensionUpdate.php:
00260: 
00261:         return array_filter(
00262:             $persistenceManager->retrieveYamlFilesFromStorageFolders(),
00263:             function (File $file) use ($yamlSource) {
00264:                 $isNewFormFile = StringUtility::endsWith(

13 TYPO3\CMS\Form\Hooks\FormFileExtensionUpdate::getAllStorageFormFilesWithOldNaming()

/var/www/t3dev.uni-oldenburg.de/htdocs5/typo3_src-8.7.17/typo3/sysext/form/Classes/Hooks/FormFileExtensionUpdate.php:
00052:         $updateNeeded = false;
00053: 
00054:         $allStorageFormFiles = $this->getAllStorageFormFilesWithOldNaming();
00055:         $referencedExtensionFormFiles = $this->groupReferencedExtensionFormFiles(
00056:             $this->getReferencedFormFilesWithOldNaming()

12 TYPO3\CMS\Form\Hooks\FormFileExtensionUpdate::checkForUpdate("")

/var/www/t3dev.uni-oldenburg.de/htdocs5/typo3_src-8.7.17/typo3/sysext/install/Classes/Updates/AbstractUpdate.php:
00117:     {
00118:         $explanation = '';
00119:         $result = $this->checkForUpdate($explanation);
00120:         return (bool)$result === true;
00121:     }

11 TYPO3\CMS\Install\Updates\AbstractUpdate::shouldRenderWizard()

/var/www/t3dev.uni-oldenburg.de/htdocs5/typo3_src-8.7.17/typo3/sysext/install/Classes/Controller/Action/Tool/UpgradeWizard.php:
00142:                 ];
00143:             } else {
00144:                 if ($updateObject->shouldRenderWizard()) {
00145:                     // $explanation is changed by reference in Update objects!
00146:                     $explanation = '';

10 TYPO3\CMS\Install\Controller\Action\Tool\UpgradeWizard::listUpdates()

/var/www/t3dev.uni-oldenburg.de/htdocs5/typo3_src-8.7.17/typo3/sysext/install/Classes/Controller/Action/Tool/UpgradeWizard.php:
00115:                 $actionMessages[] = $message;
00116:             }
00117:             $this->listUpdates();
00118:             $this->view->assign('updateAction', 'listUpdates');
00119:         }

9 TYPO3\CMS\Install\Controller\Action\Tool\UpgradeWizard::executeAction()

/var/www/t3dev.uni-oldenburg.de/htdocs5/typo3_src-8.7.17/typo3/sysext/install/Classes/Controller/Action/AbstractAction.php:
00066:     {
00067:         $this->initializeHandle();
00068:         return $this->executeAction();
00069:     }
00070: 

8 TYPO3\CMS\Install\Controller\Action\AbstractAction::handle()

/var/www/t3dev.uni-oldenburg.de/htdocs5/typo3_src-8.7.17/typo3/sysext/install/Classes/Controller/ToolController.php:
00185:         $toolAction->setPostValues($this->getPostValues());
00186:         $toolAction->setLastError($this->getLastError());
00187:         $this->output($toolAction->handle());
00188:     }
00189: }

7 TYPO3\CMS\Install\Controller\ToolController::dispatchAuthenticationActions()

/var/www/t3dev.uni-oldenburg.de/htdocs5/typo3_src-8.7.17/typo3/sysext/install/Classes/Controller/ToolController.php:
00061:         $this->outputLoginFormIfNotAuthorized();
00062:         $this->registerExtensionConfigurationErrorHandler();
00063:         $this->dispatchAuthenticationActions();
00064:     }
00065: 

6 TYPO3\CMS\Install\Controller\ToolController::execute()

/var/www/t3dev.uni-oldenburg.de/htdocs5/typo3_src-8.7.17/typo3/sysext/install/Classes/Http/RequestHandler.php:
00061:                 $controllerClassName = \TYPO3\CMS\Install\Controller\StepController::class;
00062:         }
00063:         GeneralUtility::makeInstance($controllerClassName)->execute();
00064:     }
00065: 

5 TYPO3\CMS\Install\Http\RequestHandler::handleRequest(TYPO3\CMS\Core\Http\ServerRequest)

/var/www/t3dev.uni-oldenburg.de/htdocs5/typo3_src-8.7.17/typo3/sysext/core/Classes/Core/Bootstrap.php:
00314: 
00315:         // Execute the command which returns a Response object or NULL
00316:         $this->response = $requestHandler->handleRequest($request);
00317:         return $this;
00318:     }

4 TYPO3\CMS\Core\Core\Bootstrap::handleRequest(TYPO3\CMS\Core\Http\ServerRequest)

/var/www/t3dev.uni-oldenburg.de/htdocs5/typo3_src-8.7.17/typo3/sysext/install/Classes/Http/Application.php:
00073:     public function run(callable $execute = null)
00074:     {
00075:         $this->bootstrap->handleRequest(\TYPO3\CMS\Core\Http\ServerRequestFactory::fromGlobals());
00076: 
00077:         if ($execute !== null) {

3 TYPO3\CMS\Install\Http\Application::run()

/var/www/t3dev.uni-oldenburg.de/htdocs5/typo3_src-8.7.17/typo3/sysext/install/Resources/Private/Php/install.php:
00101: call_user_func(function () {
00102:     $classLoader = require __DIR__ . '/../../../../../../vendor/autoload.php';
00103:     (new \TYPO3\CMS\Install\Http\Application($classLoader))->run();
00104: });

2 {closure}()

/var/www/t3dev.uni-oldenburg.de/htdocs5/typo3_src-8.7.17/typo3/sysext/install/Resources/Private/Php/install.php:
00102:     $classLoader = require __DIR__ . '/../../../../../../vendor/autoload.php';
00103:     (new \TYPO3\CMS\Install\Http\Application($classLoader))->run();
00104: });

1 require("/var/www/t3dev.uni-oldenburg.de/htdocs5/typo3_src-…3/sysext/install/Resources/Private/Php/install.php")

/var/www/t3dev.uni-oldenburg.de/htdocs5/typo3_src-8.7.17/typo3/install.php:
00001: <?php
00002: 
00003: require __DIR__ . '/sysext/install/Resources/Private/Php/install.php';

File name that causes this (file exists):

ls -l fileadmin/user_upload/niederlandistik/bilder/foto_ba\\\'s.JPG 
-rw-r-----. 1 user group 194414 Nov  1  2012 fileadmin/user_upload/niederlandistik/bilder/foto_ba\'s.JPG

See also Wiki entry for Exception: https://wiki.typo3.org/Exception/CMS/1314516809

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.