Bug #82672

Fileadmin garbage collection is failing

Added by Michael Buergi about 1 year ago. Updated about 2 months ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
scheduler
Target version:
-
Start date:
2017-10-04
Due date:
% Done:

100%

TYPO3 Version:
7
PHP Version:
5.6
Tags:
Complexity:
Is Regression:
Sprint Focus:
On Location Sprint

Description

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:

https://forge.typo3.org/issues/78473
commit: a43deabd6728526b1237b4d76a369baffd211c27

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.

Regards
Michael

Associated revisions

Revision d1105723 (diff)
Added by Sebastian Hofer 12 months ago

[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.

Releases: 7.6
Fixes: #82672
Change-Id: I8786330f07996f1b341bb38fafa50709d364d25e
Reviewed-on: https://review.typo3.org/54839
Tested-by: TYPO3com <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>
Reviewed-by: Manuel Selbach <>
Tested-by: Manuel Selbach <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

History

#1 Updated by Alexander Grein 12 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.

#2 Updated by Sebastian Hofer 12 months ago

  • Sprint Focus set to On Location Sprint

#3 Updated by Gerrit Code Review 12 months ago

  • Status changed from New to Under Review

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54839

#4 Updated by Gerrit Code Review 12 months ago

Patch set 2 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54839

#5 Updated by Gerrit Code Review 12 months ago

Patch set 3 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54839

#6 Updated by Sebastian Hofer 12 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#7 Updated by Benni Mack about 2 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF