0

I run the command

 php app\console cache:clear

And get the fowllowing answer in a local environnement in Windows

 [Symfony\Component\Filesystem\Exception\IOException]
 Failed to remove directory "D:\nginx\web\symfony\dev\var\cache\de~\annotations\fd"

I first checked if the weird de~ folder existed and deleted it running :

mkdir empty
c:\Windows\System32\Robocopy.exe /MIR empty cache *

which by the way works also to delete too long file names in the cache folder.

Then I checked in windows ui the cache folders, I had a previous cache folder in the app directory and now that I updated Symfony using composer (v2.8.7), it appears to be in the var folder.

All those cache folders are empty, but I still get the weird message with that de~ folder that does not exist anymore.

I know I worked with annotations to improve my entities to create a postgresql database and tables with correct behavior and modified my config file to use entity managers to have more control over which tables tables to create but I don't know if that error comes from there as I use Doctrine annotations in these entities files.

Mantisse
  • 309
  • 4
  • 15
  • you should definitely set the correct rights on the cache folder http://stackoverflow.com/questions/15814976/symfony-2-cache-clearing-issue –  Jun 22 '16 at 01:29
  • I am under Windows and I know some of icacls commands but I quickly checked I have rights to read and write as a normal or admininistrator and I still get the same error message. Moreover, the cache folders are empty. I wonder if the error does not come from an undetected error I made using annotations somewhere in my entities. – Mantisse Jun 22 '16 at 02:53

1 Answers1

2

Try adding the --no-warmup flag to the cache clear command:

$ php app\console cache:clear --no-warmup

This has negated strange cache errors for me in the past. Otherwise some wrong permissions are probably being set somewhere.

Maltronic
  • 1,782
  • 10
  • 21
  • I checked the permissions and ran the command as an administrator even if it worked previously with a regular account. Also tried the option you are talking about. – Mantisse Jun 22 '16 at 00:16