Project

General

Profile

Actions

Bug #101924

closed

Try/catch cleanup:missingrelations to avoid crashes when setReferenceValue fails

Added by Benjamin Serfhos about 1 year ago. Updated 4 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
scheduler
Target version:
Start date:
2023-09-15
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

While running cleanup:missingrelations the datahandler crashes on retrieving a file and stops the further cleanup.
With a 'simple' try/catch the process should at least continue.

Removing reference in record "sys_file_metadata:95:file" (Hash: 031a1cfca7cf323b83930f4fe96645ae)

  [ TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException ]  
  No file found for given UID: 94                                  

Exception code: 1317178604

Exception trace:
#0 ()
   vendor/typo3/cms-core/Classes/Resource/ResourceFactory.php:210
#1 TYPO3\CMS\Core\Resource\ResourceFactory->getFileObject()
   vendor/typo3/cms-core/Classes/Resource/Security/FileMetadataPermissionsAspect.php:164
#2 TYPO3\CMS\Core\Resource\Security\FileMetadataPermissionsAspect->checkFileWriteAccessForFileMetaData()
   vendor/typo3/cms-core/Classes/Resource/Security/FileMetadataPermissionsAspect.php:101
#3 TYPO3\CMS\Core\Resource\Security\FileMetadataPermissionsAspect->checkModifyAccessList()
   vendor/typo3/cms-core/Classes/DataHandling/DataHandler.php:7113
#4 TYPO3\CMS\Core\DataHandling\DataHandler->checkModifyAccessList()
   vendor/typo3/cms-core/Classes/DataHandling/DataHandler.php:861
#5 TYPO3\CMS\Core\DataHandling\DataHandler->process_datamap()
   vendor/typo3/cms-core/Classes/Database/ReferenceIndex.php:740
#6 TYPO3\CMS\Core\Database\ReferenceIndex->setReferenceValue()
   vendor/typo3/cms-lowlevel/Classes/Command/MissingRelationsCommand.php:360
#7 TYPO3\CMS\Lowlevel\Command\MissingRelationsCommand->removeReferencesToMissingRecords()
   vendor/typo3/cms-lowlevel/Classes/Command/MissingRelationsCommand.php:170
#8 TYPO3\CMS\Lowlevel\Command\MissingRelationsCommand->execute()
   vendor/symfony/console/Command/Command.php:326
#9 Symfony\Component\Console\Command\Command->run()
   vendor/symfony/console/Application.php:1081
#10 Symfony\Component\Console\Application->doRunCommand()
   vendor/symfony/console/Application.php:320
#11 Symfony\Component\Console\Application->doRun()
   vendor/symfony/console/Application.php:174
#12 Symfony\Component\Console\Application->run()
   vendor/typo3/cms-core/Classes/Console/CommandApplication.php:112
#13 TYPO3\CMS\Core\Console\CommandApplication->run()
   vendor/typo3/cms-cli/typo3:23
#14 {closure}()
   vendor/typo3/cms-cli/typo3:24
#15 include()
   vendor/bin/typo3:120

cleanup:missingrelations [--dry-run] [--update-refindex]

Actions

Also available in: Atom PDF