madeyourday/contao-rocksolid-custom-elements

'Cannot rename' error

fritzmg opened this issue · 4 comments

If you execute composer install or composer update with RSCE present in the composer.json, but the system/tmp folder is not present yet (which is the case if you either first install Contao - but with RSCE already present as a requirement, or if you deploy a Contao instance via Deployer for example), then the following error happens:

In Filesystem.php line 305:
                                                                                                                                                                                 
  [Symfony\Component\Filesystem\Exception\IOException]                                                                                                                           
  Cannot rename "system/tmp/7892027ef94b205113cc552724516f97" to "var\cache\prod/contao/rocksolid_custom_elements_co   
  nfig.php": rename(system/tmp/7892027ef94b205113cc552724516f97,var\cache\prod/contao/rocksolid_custom_elements_conf   
  ig.php): The system cannot find the path specified. (code: 3)                                                                                                                  


Exception trace:
  at vendor\symfony\filesystem\Filesystem.php:305
 Symfony\Component\Filesystem\Filesystem->rename() at vendor\contao\core-bundle\src\Resources\contao\library\Contao\Files.php:220
 Contao\Files->rename() at vendor\contao\core-bundle\src\Resources\contao\library\Contao\File.php:552
 Contao\File->close() at vendor\madeyourday\contao-rocksolid-custom-elements\src\CustomElements.php:1566
 MadeYourDay\RockSolidCustomElements\CustomElements::loadConfig() at vendor\madeyourday\contao-rocksolid-custom-elements\src\CustomElements.php:1642 MadeYourDay\RockSolidCustomElements\CustomElements->loadLanguageFileHook() at vendor\contao\core-bundle\src\Resources\contao\library\Contao\System.php:574
 Contao\System::loadLanguageFile() at vendor\contao\core-bundle\src\Resources\contao\library\Contao\DcaExtractor.php:376
 Contao\DcaExtractor->createExtract() at vendor\contao\core-bundle\src\Resources\contao\library\Contao\DcaExtractor.php:128
 Contao\DcaExtractor->__construct() at vendor\contao\core-bundle\src\Resources\contao\library\Contao\DcaExtractor.php:150
 Contao\DcaExtractor::getInstance() at vendor\contao\core-bundle\src\Cache\ContaoCacheWarmer.php:170
 Contao\CoreBundle\Cache\ContaoCacheWarmer->generateDcaExtracts() at vendor\contao\core-bundle\src\Cache\ContaoCacheWarmer.php:67
 Contao\CoreBundle\Cache\ContaoCacheWarmer->warmUp() at vendor\symfony\http-kernel\CacheWarmer\CacheWarmerAggregate.php:99
 Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate->warmUp() at vendor\symfony\framework-bundle\Command\CacheWarmupCommand.php:82       
 Symfony\Bundle\FrameworkBundle\Command\CacheWarmupCommand->execute() at vendor\symfony\console\Command\Command.php:298
 Symfony\Component\Console\Command\Command->run() at vendor\symfony\console\Application.php:1033
 Symfony\Component\Console\Application->doRunCommand() at vendor\symfony\framework-bundle\Console\Application.php:96
 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at vendor\symfony\console\Application.php:299
 Symfony\Component\Console\Application->doRun() at vendor\symfony\framework-bundle\Console\Application.php:82
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at vendor\symfony\console\Application.php:171
 Symfony\Component\Console\Application->run() at vendor\contao\manager-bundle\bin\contao-console:36
 include() at vendor\bin\contao-console:112

To reproduce you can do the following:

  1. rm -rf system/tmp
  2. vendor/bin/contao-console cache:warmup --env=prod

Seems to be similar to #77 ? May be webmozart/path-util or symfony/filesystem can help here?

This was in Contao 4.13-RC2

I can confirm it looks like Contao 4.13 introduced this issue.

Hotifx Deployer:

before('deploy:vendors', function () {
    run("cd {{release_path}} && mkdir -p system/tmp");
});
ausi commented

Can you verify if your issue is fixed in dev-master?

Looks good, no errors occurred with above reproduction or during a deployment 👍

I second this 👍