Fatal error: Uncaught Symfony\Component\Filesystem\Exception\IOException: Cannot rename "/htdocs/var/cache/dev/translations/catalogue..NXhscRe.php51kXL1" to "/htdocs/var/cache/dev/translations/catalogue..NXhscRe.php". in /htdocs/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php:302
Stack trace:
#0 /htdocs/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php(737): Symfony\Component\Filesystem\Filesystem->rename('/var/www/shop.c...', '/var/www/shop.c...', true)
#1 /htdocs/vendor/symfony/symfony/src/Symfony/Component/Config/ResourceCheckerConfigCache.php(127): Symfony\Component\Filesystem\Filesystem->dumpFile('/var/www/shop.c...', '<?php\n\nuse Symf...')
#2 /htdocs/vendor/symfony/symfony/src/Symfony/Component/Translation/Translator.php(334): Symfony\Component\Config\ResourceCheckerConfigCache->write('<?php\n\nuse Symf...' in /htdocs/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php on line 302
Ошибка в файле /vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php
public function dumpFile($filename, $content)
{
$dir = dirname($filename);
if (!is_dir($dir)) {
$this->mkdir($dir);
}
if (!is_writable($dir)) {
throw new IOException(sprintf('Unable to write to the "%s" directory.', $dir), 0, null, $dir);
}
// Will create a temp file with 0600 access rights
// when the filesystem supports chmod.
$tmpFile = $this->tempnam($dir, basename($filename));
//---------------------------------------------------------------------------------------
//Тут файл есть
//---------------------------------------------------------------------------------------
if (false === @file_put_contents($tmpFile, $content)) {
throw new IOException(sprintf('Failed to write file "%s".', $filename), 0, null, $filename);
}
//---------------------------------------------------------------------------------------
//Тут файла нет
//---------------------------------------------------------------------------------------
@chmod($tmpFile, file_exists($filename) ? fileperms($filename) : 0666 & ~umask());
$this->rename($tmpFile, $filename, true);
return $str;
}
PS. Ошибка нестабильная, 1 раз из 15-20 заходов на страницу, и 200-300 срабатываний этого метода
PSS. Наличие файла проверяю чтением содержимого директории и file_exists.