Bug #87174

.... typo3temp/var/cache/code/cache_core/site-configuration.php): Access is denied

Added by Eckard Gehrke almost 3 years ago. Updated over 1 year ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Caching
Target version:
-
Start date:
2018-12-16
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Hi,

after upgrade from 8.7.13 I am getting now this error very frequently in the log:

Core: Error handler (BE): PHP Warning: rename(C:/dev_95/typo3temp/var/cache/code/cache_core/5c16b9b2bd900101327003.temp,C:/dev_95/typo3temp/var/cache/code/cache_core/site-configuration.php): Access is denied. (code: 5) in C:\dev_95\typo3\sysext\core\Classes\Cache\Backend\SimpleFileBackend.php line 234

Looking to the files it seems to be just an empty php files:

[] #

No other "Access is denied" errors fopr other files appear.

Best regards
Eckard.


Related issues

Related to TYPO3 Core - Bug #91768: Race condition while caching data using SimpleFileBackendNew2020-07-08

Actions
#1

Updated by Riccardo De Contardi almost 3 years ago

I get the same errors on a XAMPP environment (windows 10); my installation is TYPO3 9.5.3, completely fresh installation (nothing installed except system extensions and empty default page)

#2

Updated by Eckard Gehrke over 2 years ago

  • Category deleted (Backend API)
  • PHP Version set to 7.3

Hi,
has anybody else the same problem and found a solution in the meantime?
It seems to be a windows problem.
When a file is locked it cannot be renamed:

\typo3\sysext\core\Classes\Cache\Backend\SimpleFileBackend.php line 237
I found a suggestion
(https://stackoverflow.com/questions/12894822/access-denied-error-on-rename-call-when-uploading-files-in-symfony)

try {
rename($temporaryCacheEntryPathAndFilename,$cacheEntryPathAndFilename);
} catch(\Exception $e) {
if (copy($temporaryCacheEntryPathAndFilename,$cacheEntryPathAndFilename)) {
unlink($temporaryCacheEntryPathAndFilename);
}
}

But that does not solve the issue here.

Best regards
Eckard.

#3

Updated by Markus Dübbert over 2 years ago

  • TYPO3 Version changed from 9 to 8
  • PHP Version changed from 7.3 to 7.1

I get the same error:

Core: Error handler (BE): PHP Warning: rename(/var/www/html/web/typo3temp/var/Cache/Data/flux/5d1587584590b881734967.temp,/var/www/html/web/typo3temp/var/Cache/Data/flux/flux_content_types): No such file or directory in /var/www/html/vendor/typo3/cms/typo3/sysext/core/Classes/Cache/Backend/SimpleFileBackend.php line 236

the error occured after deinstalling/installing an extension.
see also
https://forge.typo3.org/issues/84123
https://forge.typo3.org/issues/55099

local ddev installation on windows 10

is there a solution for this yet?

update:
the problem for me is:
https://github.com/docker/for-win/issues/525

#4

Updated by Tymoteusz Motylewski over 2 years ago

for me on xampp with win 10
a workaround like

 $res = @rename($temporaryCacheEntryPathAndFilename, $cacheEntryPathAndFilename);
       if (!$res) {
           $e = copy($temporaryCacheEntryPathAndFilename, $cacheEntryPathAndFilename);
            unlink($temporaryCacheEntryPathAndFilename);

       }

worked.

see also https://github.com/doctrine/common/pull/874

#5

Updated by Stephan Salzmann about 2 years ago

Markus Dübbert wrote:

local ddev installation on windows 10

If you start the docker-desktop with administrative priviliges the error disappears.

#6

Updated by Riccardo De Contardi almost 2 years ago

Tymoteusz Motylewski wrote:

for me on xampp with win 10
a workaround like
[...]
worked.

see also https://github.com/doctrine/common/pull/874

I tried to modify the file /typo3/sysext/core/Classes/Cache/Backend/SimpleFileBackend.php but the error seems still present (but it is not reported on the log (?) :/ )

#7

Updated by Susanne Moog over 1 year ago

Additional info: on ddev environments you can get rid of the error with https://stackoverflow.com/questions/57554778/how-can-i-fix-the-caching-issue-in-typo3-and-ddev

#8

Updated by Randy Fay over 1 year ago

It seems to me that the root of this is that TYPO3 uses a filesystem as if it were tmpfs (<projectroot>/var/cache) when that may well be a slow filesystem, as it is whenever it's mounted from anywhere, as with ddev. Is there a reason that TYPO3 doesn't have a configured cache directory that's actually tmpfs, for example just pointing it to /tmp ?

For ddev, it would be possible to work around this by automatically setting var/cache to be a tmpfs mount. But since the problem appears in many environments (mostly Windows it seems) it may be better to just move that cache to a more appropriate place?

#9

Updated by Susanne Moog over 1 year ago

  • Category set to Caching
#10

Updated by Michael Stucki over 1 year ago

Randy Fay wrote:

It seems to me that the root of this is that TYPO3 uses a filesystem as if it were tmpfs (<projectroot>/var/cache) when that may well be a slow filesystem, as it is whenever it's mounted from anywhere, as with ddev. Is there a reason that TYPO3 doesn't have a configured cache directory that's actually tmpfs, for example just pointing it to /tmp ?

For ddev, it would be possible to work around this by automatically setting var/cache to be a tmpfs mount. But since the problem appears in many environments (mostly Windows it seems) it may be better to just move that cache to a more appropriate place?

Good idea to offer a tmpfs cache! Unfortunately it looks like the cache directory can't be changed because the setter function setCacheDirectory() is never called in TYPO3 v10.
So the most simple way to do this is to mount a tmpfs filesystem on top of typo3temp/var/Cache/.

On a single-host site, the workaround using tmpfs would work. However, in a multi-host setup with a single database, the typo3temp folder should be the same on all hosts, therefore it needs to be shared using NFS, CephFS, etc.

#11

Updated by Michael Stucki over 1 year ago

  • TYPO3 Version changed from 8 to 10
  • PHP Version changed from 7.1 to 7.2
#12

Updated by Michael Stucki over 1 year ago

I was adding comments here because I ran into a very similar problem. However, just decided to move my comments into a separate issue #91768.

#13

Updated by Michael Stucki over 1 year ago

  • Related to Bug #91768: Race condition while caching data using SimpleFileBackend added

Also available in: Atom PDF