Fileadmin garbage collection is failing
The scheduler job "Fileadmin garbage collection" is failing with the error message:
Execution failed: 1314516809, File /foo/bar/fileadmin/subfolder/_recycler_ does not exist.
I'm using typo3 v7.6.23
A look at the source code reveals that this cannot work and never has. That's strange because it was reviewed and tested, allegedly:
It's not working because the method getFileObjectFromCombinedIdentifier() receives wrong input:
should be something like: 'fileadmin/subfolder/_recycler_/garbage.txt'
but is: '/foo/bar/fileadmin/subfolder/_recycler_'
Maybe the version from master does run in v7? It seems to be much cleaner and better.
[BUGFIX] Failing task "Fileadmin garbage collection"
Fix the identifier string, which is used to retrive the file object,
a relative path instead of an absolute path is expected.
Tested-by: TYPO3com <firstname.lastname@example.org>
Reviewed-by: Christian Kuhn <email@example.com>
Tested-by: Christian Kuhn <firstname.lastname@example.org>
Reviewed-by: Manuel Selbach <email@example.com>
Tested-by: Manuel Selbach <firstname.lastname@example.org>
Reviewed-by: Benni Mack <email@example.com>
Tested-by: Benni Mack <firstname.lastname@example.org>
#1 Updated by Alexander Grein 9 months ago
I can confirm this bug.
There is a problem inside the method cleanupRecycledFiles of the typo3/sysext/scheduler/Classes/Task/RecyclerGarbageCollectionTask.php class.
It is this call in line 93:
$fileObject = ResourceFactory::getInstance()->getFileObjectFromCombinedIdentifier($filePath);
The passed parameter is an absolute path without the filename, but should be a relative path to a file from the web root view to work as an identifier for the resource factory.
If you change this line to
$fileObject = ResourceFactory::getInstance()->getFileObjectFromCombinedIdentifier(substr($fileName, strlen(PATH_site)));the error message of this issue will disappear.