staticfilecache icon indicating copy to clipboard operation
staticfilecache copied to clipboard

PHP Warning: rename

Open edesignagentur opened this issue 10 months ago • 2 comments

Hi everyone,

we are getting PHP warnings like this:

Core: Error handler (FE): PHP Warning: rename(/web/typo3_src-12.4.8/public/typo3temp/assets/tx_staticfilecache/https_websitedomain-swiss.com_443_1713096909408_1713096929698_1713096945415_1713096952942_1713096960463_1713096997423_1713097003268_1713097007779_1713097011803_1713097014684_1713097020187_1713097025938_1713097034288_1713097044102_1713097047035_1713097050147/,/web/typo3_src-12.4.8/public/typo3temp/assets/tx_staticfilecache/https_websitedomain-swiss.com_443_1713096909408_1713096929698_1713096945415_1713096952942_1713096960463_1713096997423_1713097003268_1713097007779_1713097011803_1713097014684_1713097020187_1713097025938_1713097034288_1713097044102_1713097047035_1713097050147_1713265324924/): File name too long in /web/typo3_src-12.4.8/vendor/lochmueller/staticfilecache/Classes/Service/RemoveService.php line 71

How can we fix this ?

Environment

  • TYPO3 12.4.13
  • staticfilecache version: 14.0.1
  • Composer mode
  • PHP 8.2

edesignagentur avatar Apr 16 '24 11:04 edesignagentur

I refactor the write and delete process of files and directories: https://github.com/lochmueller/staticfilecache/commit/3c0b16aa83ea70ffd69e0f440c9aebe18c9b455b https://github.com/lochmueller/staticfilecache/commit/999000d169633b3a5d82407eea4179ad90f4cc7f

Could you check the permissions of the directory, that is not deleted on your machine? The problem is, that the dir is renamed before the directory is removed, to speed up the flush process: https://github.com/lochmueller/staticfilecache/blob/master/Classes/Service/RemoveService.php#L74 If there are not enough permissions and the dir is not dropped, the renaming is execute every flush cache process. This will end in the "folder name is to long" error.

Please check the permissions. If this is the problem, perhaps all "GeneralUtility::writeFile" calles, should added the third parameter (fix permissions)!?!

Regards, Tim

lochmueller avatar Apr 16 '24 19:04 lochmueller

Hi Tim, just checked the permissions, each Folder automatically gets 770, even if the tx_staticfilecache has 777 permissions. I tried differnet combinations.

edesignagentur avatar Apr 17 '24 18:04 edesignagentur