Skip to content
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

File not changing inside docker container after updating from 2.1.0.5 to 2.2.0.0 #5530

Closed
2 tasks done
adrien-carre opened this issue Jan 22, 2020 · 267 comments
Closed
2 tasks done

Comments

@adrien-carre
Copy link

  • I have tried with the latest version of my channel (Stable or Edge)
  • I have uploaded Diagnostics
  • Diagnostics ID: 0B5E8EE6-4822-4D32-BE64-EFD8FDFBF13F/20200122095329

Expected behavior

When a file is changed in the windows filesystem, it should be changed inside the container.

Actual behavior

When a file is changed in the windows filesystem, it's not changed, it's the same as when the container started. The file's modification time is not changing as well.

Information

  • Windows Version: 10
  • 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

  1. start a container with shared folder
  2. edit in windows a file in the shared folder
  3. the file is not changed in the container
@kohlerdominik
Copy link

I can confirm this. Same Setup, running as "Linux Containers" if this is somewhat helpfull.

Does anyone already have a solution or workaround?

@Brainshaker95
Copy link

My workaround was downgrading to 2.1.0.5

@SamuelReinfelder
Copy link

How do you downgrade?

@argentinaluiz
Copy link

Me too, I am downgrading to 2.1.0.5

@Xammie
Copy link

Xammie commented Jan 22, 2020

I'm also downgrading.

@SamuelReinfelder This is the download link for 2.1.0.5
https://download.docker.com/win/stable/40693/Docker%20Desktop%20Installer.exe

@mightyfineyall
Copy link

Same issue here - running a few gulp tasks using nginx / urbantrout's Craft CMS image / mysql, it will compile once and then never change the file. Obviously can't develop when your files don't update.

@paslandau
Copy link

Same issue. In addition it also seemed to interfere with files loaded in my local IDE (PHPStorm):

  • files were unable to be loaded by the IDE
  • in one case, the contents of a file I was modifying was completely deleted

@andrei-dascalu
Copy link

andrei-dascalu commented Jan 22, 2020

Same issue, the only thing that helped was downgrading. Any previous issue is ok

@mat007
Copy link
Member

mat007 commented Jan 22, 2020

Sorry for the inconvenience, uploading more diagnostics and/or specific reproduction steps would help a lot.
Thanks!

@argentinaluiz
Copy link

Hi @mat007 , for me, I only set in docker-compose.yaml:

volumes:
    - .:/var/www

All changes in any files doesnt persist in container.
Thanks!

@frankmohaupt
Copy link

Steps to reproduce:
Change a shared file on your host.
Exec in the docker container
check the file in the container that you have changed in your host before.

RESULT: The changes you have made to the file in the host are not "transferred" to the container.

If you restart the docker Environment the changes are there.

@BenjaminKalle
Copy link

Same Issue;
Few differences / Inclusions though;

  • The issue was removed for the better part of an Hour after updating windows to it's latest version.
  • The issue was, for a short time after reappearance, fixable when forcing your cache to clear.
  • If you wait for the better part of 5 minutes the changes to the files will be passed through to the container.
  • There where differences between different types of files in the extend and/or timing of the changes.
    (E.G.: changes to an HTML file 'seemed' to be quicker in changing the result instantly while any changes to PHP files took longer, but eventually they take the same amount of time before the changes are visible from within the container.)

@rfay
Copy link
Contributor

rfay commented Jan 22, 2020

I also find the converse: Files changed in the container do not show up on the host. The file mount consistency of 2.2.0.0 is not working out.

@kasp3r
Copy link

kasp3r commented Jan 23, 2020

Same issue, but I noticed, that file in container starts being updated after I nano file.html inside container.

@blackangelxl
Copy link

My Solution:

Set ":consistent" command behind the volume path

Example:
"./www/:/usr/share/nginx/html/www:consistent"

Volume ":cached" is now by default...

@KevinVonJocoon
Copy link

KevinVonJocoon commented Jan 23, 2020

We're just experiencing similar problems.
My colleagues are at version 2.2+ and I just stayed at 2.1.0.5.

My observation:

We're having a php composer project where we're symlinking local git repositories into the vendor dir of composer, e.g.:
src/vendor/codename/abc -> src/modules/codename/abc

(changed for human readability and to get the concept of mixing static composer deps with local dev projects using autoloading)

The directories are volume-bound with the whole project dir, so the "symlink" is a local NTFS junction automatically created by composer. We tested volume bindings with no option (default is :cached for the major project files), :cached, :delegated and :consistent - while we're still using :delegated and for local dev DBs, profiler data and logs.

While this still works on my Docker CE 2.1.0.5 on Windows, we just found out manually opening the same PHP file via nano in the container renders different results on later versions of Docker on Windows - though, in theory, it is the same file:

  • src/modules/codename/abc/backend/class/app.php
  • src/vendor/codename/abc/backend/class/app.php

The latter one does not reflect changes performed on the host, while the first one does.
This just came to my mind: the new inotify-capability might not reflect NTFS junctions, local symlinks or something inbetween - which might be even a Windows issue?

@ventayol
Copy link

I'm having the same issue, I do change in the host but the changes are not reflected in the docker container.

Information
Windows Version: 10
Docker Desktop Version: 2.2.0.0
WSL Version: 2.0

Restarting the docker containers actually updates the content of the files.

@ventayol
Copy link

I tried @blackangelxl solution of using :consistent but it doesn't work, changes are not reflected in the docker container.

@Aex
Copy link

Aex commented Jan 23, 2020

Chiming in on this issue, I've noticed my files are not always reflecting changes in the volume as well. I've exec'd into the container and noticed that the date on the file changes to Jan 1, 1970 when the file refuses to update.

Inside the container, if I touch the file, it will then update based on the changes in my volume and this may persist for a short time (shows the correct date at this time) before it stops updating again and the date changes to Jan 1, 1970.

total 0
drwxrwxrwx 1 root root 0 Jan 23 19:22 ./
drwxrwxrwx 1 root root 4096 Jan 23 01:01 ../
-rwxr-xr-x 1 root root 343 Jan 1 1970 data.cfc*
-rwxr-xr-x 1 root root 45 Jan 23 19:38 index.cfm*

@stephen-turner
Copy link
Contributor

Thanks, @Aex, that's a good observation. It may indicate that this is the same as #5543.

I see that this issue has lots of "me too"s, but I haven't been to reproduce it. Does anyone have a simple, reliable repro with step by step instructions?

@stephen-turner
Copy link
Contributor

@KevinVonJocoon I think your issue with junctions is different. I've created a new issue for it, #5582.

@kohlerdominik
Copy link

Hi @stephen-turner

It might be an issue, that a lot of people downgraded because it's critical work environment, as for me.

However, in our team we have different setups, while one works and the other doesn't. Therefore i try to describe the difference and maybe you can guess where the issue comes from:

Working Setup:
using mingw for bash executing, calling docker-compose on windows (version 1.24.1 because of #7169)

Not Working Setup
Using WSL (Debian), calling docker-compose binary in linux (version 1.23.1, because forgot to update this), and using the exposed deamon (localhost:2375) on windows

everything else should be the same: using a compose-file with multiple containers. I noticed the bug in our php-container (php:7.3.4-fpm-alpine3.9), didn't test other containers. volumes are mounted as - ${APP_CODE_PATH}:/var/www:cached

@rfay
Copy link
Contributor

rfay commented Apr 30, 2020

Spun off #5530 (comment) and #5530 (comment) (about bind-mounts from one container bleeding into another even after the first container is stopped) into #6512

@JexPY
Copy link

JexPY commented May 6, 2020

I'm suddenly seeing the same issue with 2.2.0.5 on OSX. No other way just downgrading to 2.1.0.5 hope this will fix the problem.

@stephen-turner
Copy link
Contributor

@JexPY Please describe the exact reproduction steps and upload diagnostics, otherwise we can't do anything. Thanks.

@ccaballero646
Copy link

ccaballero646 commented May 6, 2020

I'll defer to @simonferquel's advice on that.

@stephen-turner any news on this?

@simonferquel
Copy link

@ccaballero646 on WSL2, we use WSL baked-in 9p server to share files between the host and Docker Desktop. Unfortunately this does not support INotify events (yet). I can't tell for sure but as INotify and caching of host files is a regular complaint from users, I think Microsoft is working on it.

@ccaballero646
Copy link

Thanks @simonferquel

@stephen-turner
Copy link
Contributor

We have now released 2.3.0.1 to Edge channel and 2.3.0.2 to Stable channel, which we think fix all the bugs in this ticket that we have had repro cases for.

I am going to close this ticket now, as this thread has got too long for a single human to hold all of it in their head. 😃 And over time it has incorporated several issues that turned out to have different causes.

Of course, we still want to know if there are any remaining issues in this area. So if anyone is still having these symptoms in 2.3, we want to look at it. Please open a new ticket, and provide exact, detailed reproduction steps (we have had trouble reproducing bugs in this area before, even where the reporter thought it happened "all the time") and a diagnostics id.

Finally, thank you for everyone's patience and help as we ironed these issues out.

@flogr
Copy link

flogr commented May 13, 2020

Still experiencing not changing files inside my docker container with the latest version 2.3.0.2. Will deliver more info and a diagnostics id.

@Serhiy-Shekhovtsov
Copy link

Serhiy-Shekhovtsov commented May 13, 2020

Same here. Clearing cache, restarting, removing and readding drives - nothing helps.
Downgrading to 2.1.0.5 helped but I had to remove the current installation and all images.

@Eimantas123
Copy link

Eimantas123 commented May 13, 2020

Same, problem exists in 2.3.0.2. Those fsnotify.WRITE do not work. (used: Windows 10 Pro, version 1909, OS Build 1835.815)

@adrien-carre
Copy link
Author

Quick comment to thanks @flogr, @Serhiy-Shekhovtsov and @Eimantas123 for reporting this, you make me save time by not testing it.

@stephen-turner, of course if you need me to test i'll find time.

@stephen-turner
Copy link
Contributor

As I said above

Please open a new ticket, and provide exact, detailed reproduction steps (we have had trouble reproducing bugs in this area before, even where the reporter thought it happened "all the time") and a diagnostics id.

Without that we have nothing to look at. Thanks.

@Benedikt-Kluss
Copy link

@stephen-turner

As I said above
Without that we have nothing to look at. Thanks.

I opened up a new ticket on https://github.com/docker/for-mac/issues/4609 with the same issue.

@stephen-turner
Copy link
Contributor

Thanks for opening a new ticket, @Benedikt-Kluss. Although if it's on Mac it must be a different problem, because none of this code is shared between Mac and Windows. But let's continue the conversation there.

@maartenbusstra
Copy link

2.3.0.3 same issue for me

@dienbio
Copy link

dienbio commented Jun 11, 2020

Not only in Mac or Window, in Ubuntu i also get the same error, when I map a volume from my local machine to container for example with nginx:
docker run -p 8085:80 -v /home/dienbio/DOCKER/test/:/usr/share/nginx/html/:ro -d test:v2
the index.html in test folder (local) updated but inside container, file index.html is not overwritten

@mossygr
Copy link

mossygr commented Jun 13, 2020

My Solution:

Set ":consistent" command behind the volume path

Example:
"./www/:/usr/share/nginx/html/www:consistent"

Volume ":cached" is now by default...

worked for me

@PurHur
Copy link

PurHur commented Jun 14, 2020

Eventually this helps: (tried everything above already)
I had this error occur again when changing a lot of files on the same time in the docker mount. I had to restart the computer to get in sync again but after that it stays there. But i i am gonna change the files againt (a huge git checkout to another branch) i have to restart again.

@litan1106
Copy link

windows 10 pro with 2020h1 and docker desktop 2.3.0.3 same issue for me

@liquidboy
Copy link

liquidboy commented Jun 17, 2020

happening for me too ... host mapped volume refuses to update with any changes from the guest mapped volume ... docker version 2.3.0.3 (45519) stable

@GuerrillaCoder
Copy link

GuerrillaCoder commented Jun 24, 2020

I still have this issue with latest version. Is there an open issue for this?

Creating an empty file %APPDATA%\Docker\disable-filesystem-caching did not fix issue for me.

Does anyone have a workaround for getting container files to update from host folder?

@ouwejan
Copy link

ouwejan commented Jun 24, 2020

I'm sticking to Docker 2.1.0.5 until this issue is solved. Works for me.

@nick4fake
Copy link

Wow, just noticed this one, it completely ruins my workflow.

So far the only workaround is to do "touch" from inside container, it refreshes file content,

@nick4fake
Copy link

And why is it closed? Still an issue on 2.3.0.3

@adrien-carre
Copy link
Author

@nick4fake They wanted it to be on an other thread but i agree with you, this one should be kept open.

@stephen-turner
Copy link
Contributor

I explained above why it's closed:

We have now released 2.3.0.1 to Edge channel and 2.3.0.2 to Stable channel, which we think fix all the bugs in this ticket that we have had repro cases for.

I am going to close this ticket now, as this thread has got too long for a single human to hold all of it in their head. 😃 And over time it has incorporated several issues that turned out to have different causes.

Of course, we still want to know if there are any remaining issues in this area. So if anyone is still having these symptoms in 2.3, we want to look at it. Please open a new ticket, and provide exact, detailed reproduction steps (we have had trouble reproducing bugs in this area before, even where the reporter thought it happened "all the time") and a diagnostics id.

Finally, thank you for everyone's patience and help as we ironed these issues out.

As it says, if you still have a case that looks like this, it must be a different underlying issue, so please open a new ticket. And include exact, detailed reproduction steps and a diagnostics id, or we have nothing to analyse.

I'm going to lock this issue now so that this message stays pinned to the bottom.

@docker docker locked and limited conversation to collaborators Jun 26, 2020
@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

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.
/lifecycle locked

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests