for-win icon indicating copy to clipboard operation
for-win copied to clipboard

NTFS hidden files are not visible when shared through gRPC Fuse

Open dbolkensteyn opened this issue 6 years ago • 24 comments

I could reproduce with both the stable and edge channels:

  • Stable 2.2.0.3 (42716)
  • Edge 2.21.0 (42746)

Expected behavior

All shared files, regardless of whether or not they have the hidden NTFS attribute, should show up in the file listing produced by ls -al from a container on a shared folder.

Actual behavior

Hidden files are omitted from ls -al's listing.

Information

Because of the new caching mechanism that comes with gRPC Fuse, simply removing the hidden attribute from the file will not make it appear in ls -al's output. One way to workaround that is to create and delete a random file in the same folder, which seems to invalidate the cache.

dbolkensteyn avatar Feb 18 '20 18:02 dbolkensteyn

I've just tested with Docker Stable 2.1.0.5 (40693) which was pre-gRPC FUSE and I confirm that hidden files were indeed showing up.

dbolkensteyn avatar Feb 18 '20 19:02 dbolkensteyn

Thanks for the report, @dbolkensteyn. @djs55, is there a simple flag we can toggle in the FUSE library that would just make this work?

stephen-turner avatar Feb 21 '20 12:02 stephen-turner

We're currently filtering out files with FILE_ATTRIBUTE_SYSTEM and FILE_ATTRIBUTE_HIDDEN. I've made a PR to remove the filter for FILE_ATTRIBUTE_HIDDEN.

djs55 avatar Feb 24 '20 08:02 djs55

Sorry for the delay getting back to you. I've got a development build suitable for testing: https://download-stage.docker.com/win/edge/43083/Docker%20Desktop%20Installer.exe It reports as version 2.2.2.0 (43083). It has prototype fixes for

  • missing inotify MODIFY event
  • missing hidden files
  • filesystem events on long paths
  • case-insensitivity fix for create
  • fix a panic when removing a watch that doesn't exist
  • ability to see filesystem events across directory junctions
  • represent directory junctions as directories rather than symlinks

If you have a chance to test the build, let me know how it goes! If something goes wrong, please describe what happened in as much detail as you can and please include diagnostics.

djs55 avatar Mar 02 '20 10:03 djs55

Thank you @djs55 , I have tested the build and I can confirm that this issue is indeed solved.

I still am getting another issue though for which I'll file a separate issue with a diagnostics, but it'll take a bit more time to come up with a minimal reproducer. This is libgit2 failing to clone a Git repository, note however that the git command line itself works. Just putting it out there in case it rings a bell:

failed to truncate pack file /github/zzz40500/Android-PullToNextLayout/objects/pack/pack_git2_xG7FzD: Operation not permitted

Thanks a lot, I'll close this issue as it is resolved!

dbolkensteyn avatar Mar 09 '20 22:03 dbolkensteyn

@dbolkensteyn thanks for letting me know about the hidden files issue.

Regarding the failed to truncate: there was a known bug/limitation to do with concurrent file access and locking which I've recently fixed. If you have time and would like to try it the most recent development build is here: https://download-stage.docker.com/win/edge/43358/Docker%20Desktop%20Installer.exe

Thanks again for your help!

djs55 avatar Mar 09 '20 23:03 djs55

This fix is now released in 2.2.0.4.

stephen-turner avatar Mar 13 '20 13:03 stephen-turner

Hi @stephen-turner, i am having the same issue than @dbolkensteyn cloning a git repository with libgit2 using 2.2.0.5 release. Last release working properly is 2.1.0.5. Same error:

LibGit2Sharp.LibGit2SharpException: 'failed to truncate pack file '/app/repository/.git/objects/pack/pack_git2_gMlADA': Operation not permitted'

eugenioestrada avatar Apr 04 '20 08:04 eugenioestrada

@djs55 I know the "failed to truncate" was not the primary issue in this ticket, but where did the fix reach? I'm guessing it's on Edge 2.2.3.0 but not Stable 2.2.0.5 so that @eugenioestrada's observation is expected?

stephen-turner avatar Apr 06 '20 13:04 stephen-turner

@stephen-turner @eugenioestrada yes I believe that's correct -- the fix for the read-only file issue (which caused git to fail) was not merged to 2.2.0.5. I did make test builds based off that branch but the actual fix is only released in edge 2.2.3.0.

djs55 avatar Apr 06 '20 19:04 djs55

@djs55 @stephen-turner I've tested the 2.2.3.0 edge release, still failing when cloning a repo but different error.

"LibGit2Sharp.LibGit2SharpException: 'failed to mmap. Could not write data: Permission denied'"

eugenioestrada avatar Apr 07 '20 08:04 eugenioestrada

@eugenioestrada could you reproduce the error and then upload a diagnostics report? The diagnostics option is in the whale menu in the system tray -> Troubleshoot -> Diagnostics. Once it uploads it provides an ID which you can quote here -- this will allow me to look at your logs. Thanks in advance!

djs55 avatar Apr 07 '20 10:04 djs55

hi @djs55, i've published a repo with an example of the issue:

https://github.com/eugenioestrada/docker-for-win-issue-example

I've also uploaded the diagnostics data with ID: 41FE822B-5B64-4E26-BE56-FCE8C8E9F548/20200408143336

Hope it can help you to solve this :)

eugenioestrada avatar Apr 08 '20 14:04 eugenioestrada

hi @djs55 @stephen-turner, was it useful to reproduce the issue?

eugenioestrada avatar Apr 15 '20 13:04 eugenioestrada

hello @djs55 @stephen-turner issue is already happening in 2.3 release using WSL2

eugenioestrada avatar Apr 23 '20 12:04 eugenioestrada

@eugenioestrada sorry for the delay getting back to you and thanks for the repro example. On latest edge 2.3.0.0 (44472) I get the error:

Unhandled exception. LibGit2Sharp.LibGit2SharpException: failed to truncate pack file '/shared/repo/.git/objects/pack/pa
ck_git2_dohfjH': Operation not permitted

which corresponds to the low-level trace

{
    "ID": 7718,
    "Name": "Truncate",
    "Time": "2020-04-24T14:29:25.544172232Z",
    "Request": {
      "Name": "c/Users/djs/bugs/5808/docker-for-win-issue-example/shared/repo/.git/objects/pack/pack_git2_dohfjH",
      "Size": 14168047,
      "Context": {
        "Owner": {},
        "Pid": 20251,
        "Export": 2
      }
    },
    "Response": null
  },
  {
    "ID": 7718,
    "Name": "Truncate",
    "Filesystem": "remote",
    "Time": "2020-04-24T14:29:25.546498432Z",
    "Request": null,
    "Response": {
      "Status": {
        "Code": 1
      }
    }
  },

where "Code": 1 is EPERM i.e. "Permission denied". I need to check further where the error is coming from. Thanks for making a repro example!

djs55 avatar Apr 24 '20 15:04 djs55

@eugenioestrada I've made a prototype fix and have a test build: https://download-stage.docker.com/win/edge/44749/Docker%20Desktop%20Installer.exe For me the repro example runs to completion and prints "Hello World". If you have time, could you let me know if it fixes the problem for you? If not, could you upload a fresh set of diagnostics. Thanks again!

djs55 avatar Apr 25 '20 18:04 djs55

Hi @djs55, with the edge release 44749 is working in the demo project and also in my real life project. So it's fixed ;) I've also tested the new edge release 44875 and it's fixed too there.

Thanks you!!!

eugenioestrada avatar Apr 29 '20 13:04 eugenioestrada

@eugenioestrada I'm glad to hear the problem is fixed! Thanks for your help tracking this down -- the repro case was invaluable.

djs55 avatar Apr 29 '20 14:04 djs55

@djs55 sorry, i think i made a mistake testing the issue. I tested it locally instead of running on Docker :(

44749 and 44875 still failing on my computer in demo project, the real life project fails in another point of the code but it could be because a change of code.

Running the repro case I've still getting the exception:

LibGit2Sharp.LibGit2SharpException: 'failed to mmap. Could not write data: Permission denied'

Sorry for my previous message!!!

eugenioestrada avatar Apr 29 '20 19:04 eugenioestrada