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

Inconsistent file counts using PHP via Docker Desktop on WSL2 #8997

Closed
2 tasks done
themizzi opened this issue Oct 13, 2020 · 8 comments
Closed
2 tasks done

Inconsistent file counts using PHP via Docker Desktop on WSL2 #8997

themizzi opened this issue Oct 13, 2020 · 8 comments

Comments

@themizzi
Copy link

  • I have tried with the latest version of my channel (Stable or Edge)
  • I have uploaded Diagnostics
  • Diagnostics ID: E92C0EAB-8494-4665-BCAE-571376715391/20201013021123

Expected behavior

File counts from scandir and RecursiveDirectoryIterator do not diverge.

Actual behavior

File counts diverge between scandir and RecursiveDirectoryIterator.

Information

  • Windows Version: 10 (2004)
  • Docker Desktop Version: 2.4.0.0 (48506)
  • Are you running inside a virtualized Windows e.g. on a cloud server or on a mac VM: Running locally on my desktop.

Steps to reproduce the behavior

Must be using the WSL2 engine!

Please see this repository for a full reproduction:

https://github.com/themizzi/wsl2-php-recursive-directory-iterator-bug

@simonferquel
Copy link

Hi,
Are you hosting the files within your WSL2 distro or on the Windows file system ?

@themizzi
Copy link
Author

I am hosting this on the Windows file system because as a developer working on PHP with IntelliJ products it is not optimal to access the WSL2 filesystem over a network share in their software. It may be a tradeoff I have to sacrifice now or I need to use the Hyper V backend which has its own file performance issues. There is a bug tracking with WSL that lseek is not working properly against v9fs (microsoft/WSL#5074) that PHP has responded as being the issue, but that issue is closed. I fear I am in a position where nobody really cares about this but myself right now. Does not appear that this is particularly an issue with Docker for Desktop itself though and at least there is still some remediation by using the Hyper V backend.

@simonferquel
Copy link

Actually file system performance with files hosted on Windows is worse with WSL2 backend than with Hyper-V, So you should really put your files within the WSL2 distro and make IntelliJ access them from \\wsl\Ubuntu\....

Note that since latest version, you can mount files living in a WSL distro from a Windows executable, with mount expressions such as docker run -v \\wsl\Ubuntu\sources:/sources ...

@bezdutchek
Copy link

@themizzi did u manage to fix it?

@themizzi
Copy link
Author

themizzi commented Feb 2, 2021

This is still an issue for us. We have reverted to using the hyper-v docker backend for our PHP applications. It would be really great if this worked, though, since the WSL file system performs so much faster than the hyper-v backend.

@bezdutchek
Copy link

@themizzi I don't know your use case of RecursiveDirectoryIterator but here's what helped me ... simply I started having this issue after running PHP app on Windows machine under WSL2 but the code it was running was completely copied from my previous Linux distro. One of my composer dependencies was using the RecursiveDirectoryIterator.

I don't know why and how but it all suddenly started working when I deleted vendor folder and ran composer install again under WSL2

@docker-robott
Copy link
Collaborator

Issues go stale after 90 days of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30 days of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

@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

@docker docker locked and limited conversation to collaborators Jul 2, 2021
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

4 participants