Issue Bug Resolved

#108567Renaming file on S3: Exception "File has been deleted"

Christian Weiske 12/23/25, 08:51 updated 09/07/26, 09:40

Description

We’re using TYPO3 v13.4.22 with the aus-driver-amazon-s3 FAL driver on a MinIO object storage.
When renaming a file, the file gets renamed but then a RuntimeException “File has been deleted.” is thrown when the preview image shall be regenerated.

  • This only happens with the S3 driver, not with the local file system driver
  • This only happens in the File list “Tiles” view, not in the list view.

I still think it is a bug in TYPO3.

What happens

  1. File gets renamed via AJAX call
  2. File list in “Tiles” view gets reloaded and wants to render an scaled preview image
  3. Extbase ImageService::applyProcessingInstructions() is called and calls $image->process()
  4. An existing ProcessedFile is found and asked if re-processing is necessary: ProcessedFile::needsReprocessing(). The local storage driver says no, the S3 driver says yes. (Note: The task checksum changes because it contains the file modification time, which changes on S3 – because it does not have a “move file” API endpoint: It re-uploads the file with the new name and then deletes the old one)
  5. ProcessedFile::needsReprocessing() deletes itself from storage and marks itself as deleted with setDeleted()
  6. The processing task re-generates the thumbnail and stores it.
  7. imageService calls setCompatibilityValues, which calls ImageResource::createFromProcessedFile that notices that the file object is marked as deleted, and throws the “File has been deleted” exception.

What should happen

When the processing task re-creates the thumbnail, the ProcessedFile object should be marked as “not deleted”.
This could happen in FileProcessingService::processFile() or in the task processor, e.g. DeferredBackendImageProcessor.

Alternatively, a new ProcessedFile instance needs to be used.

Problems

There is no API to reset the “deleted” property on file objects from external classes.

Links

Reviews 5

History 715

  1. Christian Weiske commented <span data-processor="relativetime" data-value="2025-12-23T08:54:44+00:00" > 12/23/25, 08:54 </span>

    Stack trace: Exception

    (1/1) #1329821486 RuntimeException
    File has been deleted.
      in /var/www/typo3/vendor/typo3/cms-core/Classes/Resource/AbstractFile.php line 594
    at TYPO3\CMS\Core\Resource\AbstractFile->getForLocalProcessing() in /var/www/typo3/vendor/typo3/cms-core/Classes/Imaging/ImageResource.php line 60
    at TYPO3\CMS\Core\Imaging\ImageResource::createFromProcessedFile() in /var/www/typo3/vendor/typo3/cms-extbase/Classes/Service/ImageService.php line 183
    at TYPO3\CMS\Extbase\Service\ImageService->setCompatibilityValues() in /var/www/typo3/vendor/typo3/cms-extbase/Classes/Service/ImageService.php line 70
    at TYPO3\CMS\Extbase\Service\ImageService->applyProcessingInstructions() in /var/www/typo3/vendor/typo3/cms-fluid/Classes/ViewHelpers/ImageViewHelper.php line 133
    at TYPO3\CMS\Fluid\ViewHelpers\ImageViewHelper->render() in /var/www/typo3/vendor/typo3fluid/fluid/src/Core/ViewHelper/AbstractViewHelper.php line 270
    at TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper->initializeArgumentsAndRender() in /var/www/typo3/vendor/typo3fluid/fluid/src/Core/ViewHelper/ViewHelperInvoker.php line 74
    at TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInvoker->invoke() in /var/www/typo3/var/cache/code/fluid_template/Default_action_Filelist_Tiles_936e29912687ec41.php line 353
    at Default_action_Filelist_Tiles_936e29912687ec41->{closure:Default_action_Filelist_Tiles_936e29912687ec41::section_f51c20eec3b92e44():316}() in /var/www/typo3/vendor/typo3fluid/fluid/src/Core/ViewHelper/AbstractConditionViewHelper.php line 95
    at TYPO3Fluid\Fluid\Core\ViewHelper\AbstractConditionViewHelper->renderThenChild() in /var/www/typo3/vendor/typo3fluid/fluid/src/Core/ViewHelper/AbstractConditionViewHelper.php line 64
    at TYPO3Fluid\Fluid\Core\ViewHelper\AbstractConditionViewHelper->render() in /var/www/typo3/vendor/typo3fluid/fluid/src/Core/ViewHelper/AbstractViewHelper.php line 270
    at TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper->initializeArgumentsAndRender() in /var/www/typo3/vendor/typo3fluid/fluid/src/Core/ViewHelper/ViewHelperInvoker.php line 74
    at TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInvoker->invoke() in /var/www/typo3/var/cache/code/fluid_template/Default_action_Filelist_Tiles_936e29912687ec41.php line 388
    at Default_action_Filelist_Tiles_936e29912687ec41->section_f51c20eec3b92e44() in /var/www/typo3/vendor/typo3fluid/fluid/src/View/AbstractTemplateView.php line 247
    at TYPO3Fluid\Fluid\View\AbstractTemplateView->renderSection() in /var/www/typo3/vendor/typo3fluid/fluid/src/ViewHelpers/RenderViewHelper.php line 161
    at TYPO3Fluid\Fluid\ViewHelpers\RenderViewHelper->render() in /var/www/typo3/vendor/typo3fluid/fluid/src/Core/ViewHelper/AbstractViewHelper.php line 270
    at TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper->initializeArgumentsAndRender() in /var/www/typo3/vendor/typo3fluid/fluid/src/Core/ViewHelper/ViewHelperInvoker.php line 74
    at TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInvoker->invoke() in /var/www/typo3/var/cache/code/fluid_template/Default_action_Filelist_Tiles_936e29912687ec41.php line 644
    at Default_action_Filelist_Tiles_936e29912687ec41->{closure:Default_action_Filelist_Tiles_936e29912687ec41::render():616}() in /var/www/typo3/vendor/typo3fluid/fluid/src/Core/ViewHelper/AbstractViewHelper.php line 291
    at TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper->renderChildren() in /var/www/typo3/vendor/typo3fluid/fluid/src/ViewHelpers/ForViewHelper.php line 133
    at TYPO3Fluid\Fluid\ViewHelpers\ForViewHelper->render() in /var/www/typo3/vendor/typo3fluid/fluid/src/Core/ViewHelper/AbstractViewHelper.php line 270
    at TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper->initializeArgumentsAndRender() in /var/www/typo3/vendor/typo3fluid/fluid/src/Core/ViewHelper/ViewHelperInvoker.php line 74
    at TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInvoker->invoke() in /var/www/typo3/var/cache/code/fluid_template/Default_action_Filelist_Tiles_936e29912687ec41.php line 659
    at Default_action_Filelist_Tiles_936e29912687ec41->render() in /var/www/typo3/vendor/typo3fluid/fluid/src/View/AbstractTemplateView.php line 158
    at TYPO3Fluid\Fluid\View\AbstractTemplateView->render() in /var/www/typo3/vendor/typo3/cms-fluid/Classes/View/FluidViewAdapter.php line 57
    at TYPO3\CMS\Fluid\View\FluidViewAdapter->render() in /var/www/typo3/vendor/typo3/cms-filelist/Classes/FileList.php line 289
    at TYPO3\CMS\Filelist\FileList->renderTiles() in /var/www/typo3/vendor/typo3/cms-filelist/Classes/FileList.php line 379
    at TYPO3\CMS\Filelist\FileList->render() in /var/www/typo3/vendor/typo3/cms-filelist/Classes/Controller/FileListController.php line 400
    at TYPO3\CMS\Filelist\Controller\FileListController->generateFileList() in /var/www/typo3/vendor/typo3/cms-filelist/Classes/Controller/FileListController.php line 251
    at TYPO3\CMS\Filelist\Controller\FileListController->processRequest() in /var/www/typo3/vendor/typo3/cms-filelist/Classes/Controller/FileListController.php line 240
    at TYPO3\CMS\Filelist\Controller\FileListController->handleRequest() in /var/www/typo3/vendor/typo3/cms-backend/Classes/Http/RouteDispatcher.php line 82

    Stack trace: setDeleted() on ProcessedFile

    (1/1) Exception
      setDeleted
    in /var/www/typo3/vendor/typo3/cms-core/Classes/Resource/AbstractFile.php line 466
    at TYPO3\CMS\Core\Resource\AbstractFile->setDeleted() in /var/www/typo3/vendor/typo3/cms-core/Classes/Resource/ResourceStorage.php line 1950
    at TYPO3\CMS\Core\Resource\ResourceStorage->deleteFile() in /var/www/typo3/vendor/typo3/cms-core/Classes/Resource/AbstractFile.php line 449
    at TYPO3\CMS\Core\Resource\AbstractFile->delete() in /var/www/typo3/vendor/typo3/cms-core/Classes/Resource/ProcessedFile.php line 419
    at TYPO3\CMS\Core\Resource\ProcessedFile->delete() in /var/www/typo3/vendor/typo3/cms-core/Classes/Resource/ProcessedFile.php line 505
    at TYPO3\CMS\Core\Resource\ProcessedFile->needsReprocessing() in /var/www/typo3/vendor/typo3/cms-core/Classes/Resource/ProcessedFile.php line 267
    at TYPO3\CMS\Core\Resource\ProcessedFile->isProcessed() in /var/www/typo3/vendor/typo3/cms-core/Classes/Resource/Processing/AbstractTask.php line 149
    at TYPO3\CMS\Core\Resource\Processing\AbstractTask->fileNeedsProcessing() in /var/www/typo3/vendor/typo3/cms-core/Classes/Resource/Service/FileProcessingService.php line 76
    at TYPO3\CMS\Core\Resource\Service\FileProcessingService->processFile() in /var/www/typo3/vendor/typo3/cms-core/Classes/Resource/ResourceStorage.php line 1477
    at TYPO3\CMS\Core\Resource\ResourceStorage->processFile() in /var/www/typo3/vendor/typo3/cms-core/Classes/Resource/File.php line 241
    at TYPO3\CMS\Core\Resource\File->process() in /var/www/typo3/vendor/typo3/cms-extbase/Classes/Service/ImageService.php line 69
    at TYPO3\CMS\Extbase\Service\ImageService->applyProcessingInstructions() in /var/www/typo3/vendor/typo3/cms-fluid/Classes/ViewHelpers/ImageViewHelper.php line 133
    at TYPO3\CMS\Fluid\ViewHelpers\ImageViewHelper->render() in /var/www/typo3/vendor/typo3fluid/fluid/src/Core/ViewHelper/AbstractViewHelper.php line 270
    at TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper->initializeArgumentsAndRender() in /var/www/typo3/vendor/typo3fluid/fluid/src/Core/ViewHelper/ViewHelperInvoker.php line 74
    at TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInvoker->invoke() in /var/www/typo3/var/cache/code/fluid_template/Default_action_Filelist_Tiles_2ae0e386995ce5b1.php line 372
  2. Andreas Kießling commented <span data-processor="relativetime" data-value="2026-01-03T14:01:31+00:00" > 01/03/26, 14:01 </span>

    Seems like this also fixes my issue in v13 with the local driver.
    I update local images with \TYPO3\CMS\Core\Resource\File::setContents which invalidates the thumbnails —> and then the “File has been deleted” message shows up in the next request.

  3. S P commented <span data-processor="relativetime" data-value="2026-06-23T07:46:33+00:00" > 06/23/26, 07:46 </span>

    Not sure whether this is related, but since upgrading to v14 we see this error in our log once in a while

    Uncaught TYPO3 Exception: #1329821486: File has been deleted

    in ext:core/Classes/Resource/AbstractFile.php on line 431

    We are only using the local file driver , however. We are not able to reliably reporduce it, but once in a while some content editor manages to create this exception while doing regular content editing stuff in the v14 backend. Never saw this on v13 in the same environment, and we also see no errors in FE output or inconsistent file contents.

    To me it seems, there’s some more general race-condition happening, not just for S3.

  4. Hannes Bochmann commented <span data-processor="relativetime" data-value="2026-08-31T10:21:58+00:00" > 08/31/26, 10:21 </span>

    S P wrote in #note-7:
    > Not sure whether this is related, but since upgrading to v14 we see this error in our log once in a while
    >
    > Uncaught TYPO3 Exception: #1329821486: File has been deleted
    >
    > in ext:core/Classes/Resource/AbstractFile.php on line 431
    >
    > We are only using the local file driver , however. We are not able to reliably reporduce it, but once in a while some content editor manages to create this exception while doing regular content editing stuff in the v14 backend. Never saw this on v13 in the same environment, and we also see no errors in FE output or inconsistent file contents.
    >
    > To me it seems, there’s some more general race-condition happening, not just for S3.

    I can second that. Still not sure what is going on but sometimes I get the exact same exception during local processing. Not able to reproduce.

  5. Benni Mack commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-09-07T09:40:09+00:00" > 09/07/26, 09:40 </span>

    Applied in changeset commit:acd959c07ccf6207bbd3470acbc3e21b21575a0f.