Task #88927
closedThe temporary cache file ... could not be written
0%
Description
TYPO3\CMS\Core\Cache\Exception: The temporary cache file "/var/www/.../typo3temp/var/Cache/Code/cache_core/5d499dd925221994946712.temp" could not be written. File "typo3_src-8.7.27/typo3/sysext/core/Classes/Cache/Backend/SimpleFileBackend.php", line 233, in set throw new \TYPO3\CMS\Core\Cache\Exception('The temporary cache file "' . $temporaryCacheEntryPathAndFilename . '" could not be written.', 1334756737); File "typo3_src-8.7.27/typo3/sysext/core/Classes/Cache/Frontend/PhpFrontend.php", line 64, in set $this->backend->set($entryIdentifier, $sourceCode, $tags, $lifetime); File "typo3_src-8.7.27/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php", line 1822, in createBaseTcaCacheFile . ';' File "typo3_src-8.7.27/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php", line 1710, in loadBaseTca static::createBaseTcaCacheFile(); File "typo3_src-8.7.27/typo3/sysext/core/Classes/Core/Bootstrap.php", line 966, in loadBaseTca ExtensionManagementUtility::loadBaseTca($allowCaching); ... (6 additional frame(s) were not displayed)
It may be a race condition due to parallel requests and should be handle more friendly: "Okay, a temporary error, but go on"
Updated by Christoph Lehmann about 5 years ago
- Related to Story #81432: Replace TYPO3 caching solution with PSR-6 / Doctrine capable alternative added
Updated by Susanne Moog over 4 years ago
- Status changed from New to Needs Feedback
When does this happen / is there a way to reproduce it?
In addition: it might be a temporary error or a deeper problem, we have currently no way to differentiate the two.
Updated by Martin Schulz over 4 years ago
When does this happen / is there a way to reproduce it?
- Start a long runing script that uses a SimpleFileBackend cache
- Clear the file cache by flushing the /cache dir
In my case the long runing scipt is an importer script using some parts of extbase. So the cache in that case would be the extbase reflection cache.
So when is the cache flushed as described above?
I found the follwing 2, but there might be more:
- Using "Admin>Maintenance>Flush TYPO3 and PHP Cache" function in backend
- running install:generatepackagestates (from https://github.com/TYPO3-Console/TYPO3-Console) e.g. uppon some deployment
The problem is, that the cache file/directory to use is only initializes once. So if the file/dir is deleted (by an other script) during a long runing script, writing the cache will crash.
Updated by Alexander Vogt over 4 years ago
The error occurs after the "flushDirectory" call:
https://github.com/TYPO3/TYPO3.CMS/blob/9.5/typo3/sysext/install/Classes/Service/ClearCacheService.php#L44
After that the specific cache directory (e.g. var/cache/data/extbase_reflection) will be deleted and this leads to the exception:
https://github.com/TYPO3/TYPO3.CMS/blob/9.5/typo3/sysext/core/Classes/Cache/Backend/SimpleFileBackend.php#L231
The directory will only be recreated on cache initialization:
https://github.com/TYPO3/TYPO3.CMS/blob/9.5/typo3/sysext/core/Classes/Cache/Backend/SimpleFileBackend.php#L91
Updated by Christoph Lehmann over 4 years ago
For me it happens for requests while switching a symlinked document root.
Updated by Mathias Brodala about 4 years ago
- Related to Bug #91768: Race condition while caching data using SimpleFileBackend added
Updated by Sybille Peters over 1 year ago
This has been on "Needs Feedback" for 3 years. Christoph, can you provide more information on your setup and when this happens?
Updated by Christoph Lehmann over 1 year ago
- Status changed from Needs Feedback to Closed
I don't maintain the system anymore and i don't had this problem in any other system since then.