-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
cache:clear breaks with error: Warning: rmdir(...): Directory not empty in ... #2600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can you give an bigger stacktrace ? Seems you have an permissions error here. |
I also get this every now and then, it just fails to delete something for no apparent reason and then that crashes the entire process. |
Same for me. |
@ stloyd: I will try to get more info if it appears next time. |
I think the problem is automatic indexing of folders run from Windows. |
@joke2k: Maybe that's true. I have not tested it again. Maybe I can do that tomorrow. But I think it is important to check, if the files are writeable, bevor removing or moving them, in every case. If they are not writeable Symfony could throw an Exception. This would make it easier to find the reason. |
When I tried to clear cache today, I got the same error again.
Then I removed the folder app/cache/dev_old manually via Explorer and executed cache:clear again. |
me too. do you use some IDE like netbeans o eclipse? |
That solved the problem. But I do not understand why the indexing leads to permission problems... |
it seems a protection for mass file deleting... or more probabily a concurrency locking error |
you can "easily" reproduce this if you use a Linux VirtualBox on a Windows host. |
Okay, Issue can be closed, because it's not a bug in Symfony. But may be this will help others who are searching for a solution for the Problem. |
I had this same issue in Ubuntu 11.10 and fixed it by doing: cd app |
Had same problem in mac ox 10.8 mountain lion |
I have that same behavior, too on snow leopard, very weird stuff like:
|
It took me quite some time, but I have found a solution for my case, might be helpful to others as well, documented it here: http://forum.symfony-project.org/viewtopic.php?f=32&t=52241 |
@netmikey this is a known bug fixed by VirtualBox in version 2.1.18, you have to upgrade VirtualBox Guest Additions composer/composer#690 (comment) |
Actually, you just have to add the user to the group vboxsf. |
Are you running IIS or apache? We had problems with IIS locking files so had to stop IIS, clear cache, then restart IIS to get around it. |
same problem here. |
I got similar problem since updating to Symfony 2.8
I always need to manually remove whole cache. |
I am experiencing the same issues after upgrading from 2.3 to 2.8. These are my dependencies:
On Windows x64 with PHP 5.6. Looks to me as if some cache filenames are absurdly long and cause issues. For example, I have a |
There have been recent fixes regarding your problem in |
Thanks, I will give it a shot. Edit: Yes, using |
In my case it also relates to Windows x64, so probably it is what @xrstf said (too long pathnames) because in Unix-based instances everything works correctly. Thanks for pointing it out. |
This security change in the write privileges of Doctrine cache files could also be the problem. tl;dr; |
I'm having the exact same problem |
and the process never finishes stays here forever |
Which Symfony version and which OS do you use? |
@melissabillias That does work, however |
This is not a windows-only issue. Using Mac OS Sierra, latest virtual box, vagrant and Ubuntu 16.04, same problem. Did anyone actually fix this? |
@J7mbo Nope. I finally stopped using Symfony, so there's always that :) I even disabled caching everywhere and Symfony still dumps cache files out of nowhere. |
I'm using Windows 10 and run various Sf projects on various versions of Symfony from 2.3 to 3.2. I've had these problems in all of them since forever (also on Win 7). In some projects it's permanent, in others incidental - when clearing cache, things go bonkers - sometimes it can't rename a directory, sometimes it can't delete a file. Examples:
This one is very common (but only in some projects!):
When I looked into NTFS permissions on some folders within the cache directory I saw complete chaos like this: http://i.imgur.com/PSEGM72.png Sometimes it needed very deep interventions to enable me to simply delete the cache dir (some subdirectories had so crazy permissions that even as admin user I was unable to delete them and had to mingle with permissions first). Do you guys have any new insights on this? |
@kotbehemot53 |
How is this a closed issue? This is happening on mac os as well, not only windows. And only when using Symfony 🤔 |
The issue happens for me when running the app in a vagrant box. The error I get is [Symfony\Component\Filesystem\Exception\IOException] This is when running "php bin/console cache:clear" from within the vagrant guest. If I just do rm -rf var/cache/* from the host machine (OS X) then it works fine (and its faster). |
Same here, macOS Vagrant:
Looks like after deleting this pro~ directory and re-running cache:clear, the pro~ gets re-created so looks like it gets created as part of running cache:clear Excluding the folder in PhpStorm did not help. |
OK so upgrading Vagrant to 2.0.0 and mounting using NFS instead of "shared paths" has helped (macOS 10.12.6). In your Vagrant file, mount as: Hope this helps someone! |
Same here on Vagrant homestead 4.0.0 and Symfony 4.0-DEV
By the way, I had to remove the |
Executing //composer.json
{
"scripts": {
"auto-scripts": {
- "cache:clear": "symfony-cmd"
+ "cache:clear --no-warmup": "symfony-cmd"
}
}
} |
Ran into this as well with Symfony 4, I suspect it's actually a VirtualBox mapped-folder problem, because the the host and container temporarily show different file listings. Symfony probably just happens to be doing something that triggers the latent bug. Specifically:
When I copy all the files to a non-mapped folder, the problem doesn't occur, so I suspect some concurrency/race issue with the mapping. I'll see if I can boil it down to a minimal repro case before potentially disrupting things by upgrading VirtualBox. |
Can you try adding a few sleep before remove/rename calls in the command? Any better? |
But you should really upgrade before. We won't add code to deal with legacy setups. |
@nicolas-grekas I don't have it solved, but I have some... some very interesting WTF-data to share. First off, I analyzed what steps Symfony was trying to do and put them into a plain old PHP file with
So yeah, that's "question your sanity"-type behavior from a filesystem. As an experiment, I made a copy of After each of these steps, I restored the "pre-test" file structure by doing a
So my next step is to see at what the first point is in Summary
|
DO NO USE SHARED FILESYSTEM, it's bound to cause a problems. There is a lot of bug reports here that some-sort of shared FS e.g causes a lot of weird problems, |
@mvrhov I'm certain that's part of the problem. However, the use-case I have here is local-development, where it's much harder to tell people "set up SMB/NFS in order to test the site." I'm also worried that if I don't really understand the bug, how will I know it's fixed if it happens to go away when I upgrade? :) Minor additional findings:
|
This is the problem. It's the same with if you set up the vagrant with shared folder to do local dev linux to linux or vmware's shared folders. This thing is out of sync a lot of time. Just search the issues here and you'll se that this is the culprit most of the time. |
Got this issue during OROCommerce installation attempt using Homestead+Virtualbox. Definitely is some sort of IO bug of Virtualbox. Mounting folder as NFS helped me rather to get another type of permissions error, although might be a helpful solution for Symfony setups. Given I am not supposed to intrude in setup process, I just changed the VM provider, and finally had it to work. |
I had same problem. I use Vagrant on MacOs and configure it using puphpet. When I tried execute command:
I was getting error message:
I was able to fix this trouble changed synced_folder type to nfs in puphpet config. Now, when I try to remove chache, I am not reciving errors. Hope this helps someone. |
…cache:clear (nicolas-grekas) This PR was merged into the 3.4 branch. Discussion ---------- [FrameworkBundle] Silence "Failed to remove directory" on cache:clear | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #2600 | License | MIT | Doc PR | - Let's improve the experience of ppl (see old linked issue). This warning is just noise to most. Commits ------- 3ba624a [FrameworkBundle] Silence "Failed to remove directory" on cache:clear
I'm using macOS. I've solved my problem using What i've done to solve the problem: 1 - Install
3 - Happiness 🥇 |
This is works for me. |
Thanks, that helped! |
Hi,
I am running Symfony 2.0.5 on Windows 7 with PHP version 5.3.8.
When I am calling cache:clear on the console tool, I get this error sometimes (I do not know why):
When I remove the cache dir, it works again. But this is annoying a little bit.
The text was updated successfully, but these errors were encountered: