-
Notifications
You must be signed in to change notification settings - Fork 289
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
Volume doesn't sync when you delete a folder in Windows #5550
Comments
@coolfarmer thanks for the report (and your english is fine!) I tried it on my Mac and on my Windows host (since the file sharing is different). I can't make one of the steps work: Step 2: (I removed the
Step 3:
and in the logs:
I think this error is preventing the app from rebuilding the cache? Unfortunately I'm not very familiar with Symfony so I don't know how to fix this. Possibly an |
@coolfarmer Look at this, I think you have similar problem #5530 (comment) |
@djs55 , omg I'm so sorry, I cut too much things to simplify my demo code that I have forgot the nginx conf file. I edited my post and steps. @corpsepk , yes I think it's the samething. Sometime I delete the cache folder on the host, and when I do a "ls -lsa" in my container I can see the folder (who should no longer be there). This happen only since 2.2.0.0. I just rollback on 2.1.0.5 and the problem is gone. |
@coolfarmer I’ve been trying to reproduce on 2.2.0.0 but wasn’t really successful.
It fails quite quickly after a few iterations but not exactly how I was expecting.
And when I refresh the page in my browser: The cache is however gone both on the host and in the container
I then need to compose down and up to restart everything. I’m not overly familiar with Symfony, is this expected or part of the issue? |
With symfony it's pretty simple, when you delete the cache folder "dev", at the next refresh Symfony will rebuild all the cache and will create a new "dev" folder under /cache/. This is the only thing you need to know about symfony for this issue. The error you have on your screenshot is part of the problem yeah, if you have that error, you have successfully reproduced the issue. Warning: file_put_contents(/app/bitnami2/var/cache/dev/App_KernelDevDebugContainerDeprecations.log): failed to open stream: No such file or directory This error mean that symfony can't access/delete/create the cache folder (aka permission error). If you don't have the dev folder, try to create an empty one with "mkdir dev", you will receive "mkdir: cannot create directory 'dev': File exists". But the directory doesn't exist when you run ls -lsa, that is so weird. One thing is sure, if you got that error when your refresh your browser, you perfectly reproduce the problem. Symfony MUST ALWAYS re-build the cache folder when you delete it, and this work correctly before 2.2.0.0. |
Ah I see! |
In the meanwhile you can deactivate the caching by creating an empty file |
I have already downgraded to 2.1.0.5 but thanks for the workaround. I think I'll wait a stable 2.2.0.0. |
No worries, thanks for your help! |
Another instance at #5572 (comment) |
We have a new build that we hope fixes this error. You can get it from https://download-stage.docker.com/win/stable/42644/Docker%20Desktop%20Installer.exe. We had to switch one of the software libraries we use for an alternative, so we would appreciate any testing that people are able to do on it. Thank you for your help. |
@stephen-turner , I just tested your new build (2.2.0.2) and I have good and bad news! Problem is 50% fixed. If I delete the folder inside Windows Explorer, now it work! YAYYY! BUT, with the same folder, if I delete it with my IDE (Jetbrain PhpStorm 2019.3.1), the same problem occure. I tested it with my personal project AND with my demo project (Bitnami3) that you can find in my first post : the result is the same, I can reproduce the same bug but now with my IDE only. Again my english in not the best so please don't hesitate if you want more details. |
@coolfarmer thanks for all your help so far. We have another build (version I tested it by starting your compose example with #!/bin/sh
set -ex
while true; do
# container builds a cache
if curl -s http://localhost:8784/ | grep "Internal Server Error"; then
# cache was in the middle of being deleted
echo 500 Internal Server error
exit 1
fi
# host removes the cache
rm -rf bitnami3/var/cache/dev
# cache removals are being propagated to the container now
winpty docker exec -it folder-sync_bitnami3_1 ls //app/bitnami3/var/cache
done I then observe a sequence of HTTP 404s in the logs, ending in a 500 when the deletes from The important difference is that if I
it now works as I would expect. Host and container quickly get back in sync and the app can repopulate the cache. Previously (as you observed) you could get into a stuck out-of-sync state where the directory could not be created because it already existed from the container's point of view and yet it could not be removed because it didn't exist from the host's point of view. I've fixed a number of filesystem event propagation bugs so hopefully both host and container will remain in sync (modulo the time taken to propagate changes) |
You guys are machines! Now it work even with my IDE. :) I tried to test the limits of the system and the error come back only if I am too fast like refreshing the browser ~500ms after the folder was deleted. But this time, if I get the error, I just have to refresh again and the cache is recreated without problem! So yeah, I think the bug is gone, until next issue (I hope not haha), I don't find any other ways to break that thing. Nice job and thanks again! :) |
Thanks for confirming, @coolfarmer. We have just released 2.2.0.3 publicly, so closing this ticket. In case any Edge users are watching this ticket, it will be on the Edge channel tomorrow too. |
@stephen-turner , hey Stephen, just a little message to let you know that the problem was back again, to fix it I had to reboot my computer (Docker Restart didn't help). I hope it will not do that every day. |
@coolfarmer That's weird. If it happens again, could you send us new diagnostics please? |
Closed issues are locked after 30 days of inactivity. If you have found a problem that seems similar to this, please open a new issue. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
Expected behavior
Sync should work, if I delete a folder in Windows, ls -lsa should show me the correct result.
Actual behavior
Actually I have the problem when phpfpm and nginx exist in my docker-compose. If I only have the service who run my symfony the sync will work.
Information
Is it reproducible? Yes, every time
Is the problem new? Yes, only with 2.2.0.0
Did the problem appear with an update? Yes, 2.2.0.0
A reproducible case if this is a bug, Dockerfiles with reproduction inside is best.
Windows Version: Windows 10 Version 1903 Build 18362.592
Docker Desktop Version: 2.2.0.0
Are you running inside a virtualized Windows e.g. on a cloud server or on a mac VM: No
Steps to reproduce the behavior
Run docker-compose up -d
Normally you should access the demo page of symfony at localhost:8784
In your project directory, go to /var/cache/ and delete the folder "dev"
Refresh the web browser to recreate the cache folder
Delete again the folder dev in /var/cache
Open the container with docker exec -ti {ID} /bin/bash
Go to /app/bitnami2/var/cache then run ls -lsa
The folder "dev" is not there, run now "mkdir dev"
This result that symfony can't recreate the cache folder and if your refresh your browser this time you will have:
Warning: file_put_contents(/app/bitnami2/var/cache/dev/App_KernelDevDebugContainerDeprecations.log): failed to open stream: No such file or directory
I don't know why that happen only with php-fpm and nginx. If I remove them and ONLY have a service with symfony, I can delete the cache folder as many time I want and every refresh Symfony will success to recreate the cache folder.
My english is not the best i'm sorry for that.
If more information is needed I'll keep an eye on this issue.
The text was updated successfully, but these errors were encountered: