#108567Renaming file on S3: Exception "File has been deleted"
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
- File gets renamed via AJAX call
- File list in “Tiles” view gets reloaded and wants to render an scaled preview image
- Extbase
ImageService::applyProcessingInstructions()is called and calls$image->process() - An existing
ProcessedFileis 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) ProcessedFile::needsReprocessing()deletes itself from storage and marks itself as deleted withsetDeleted()- The processing task re-generates the thumbnail and stores it.
imageServicecallssetCompatibilityValues, which callsImageResource::createFromProcessedFilethat 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
- main 95698[TASK] Fix CGL violation in ProcessedFileTest
- main 92213[BUGFIX] Mark processed files as not deleted after processing
- 13.4 95678[BUGFIX] Avoid stale deleted state on reprocessed files
- 14.3 95677[BUGFIX] Avoid stale deleted state on reprocessed files
- main 95074[BUGFIX] Avoid stale deleted state on reprocessed files