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

Operation not permitted when file in use in WSL #2401

Closed
alanzanattadev opened this issue Aug 8, 2017 · 5 comments
Closed

Operation not permitted when file in use in WSL #2401

alanzanattadev opened this issue Aug 8, 2017 · 5 comments

Comments

@alanzanattadev
Copy link

  • Your Windows build number: (Type ver at a Windows Command Prompt)
    Microsoft Windows [version 10.0.15063]

  • What you're doing and what's happening: (Copy&paste specific commands and their output, or include screen shots)
    yarn run storybook (front-end javascript development) or run anything that uses the filesystem (unit tests in watch mode, server, anything).

  • What's wrong / what should be happening instead:
    If you try to replace files, for example with an install of new version of a library you're using (and which is used by the program currently using the filesystem), it will result in a Operation Not permitted. You have to close the program, rerun the update of the files, and rerun the program.

This limit is not present if the tool (storybook, jest) is launched from powershell. It's only happening when using WSL.

It would be great if it was not blocking the update, it's not the case on Powershell and Linux, so it shouldn't be the case on WSL.

  • Strace of the failing command, if applicable: (If <cmd> is failing, then run strace -o strace.txt -ff <cmd>, and post the strace.txt output here)
    error An unexpected error occurred: "EPERM: operation not permitted, unlink 'C:\Users\alanz\Documents\Veyo\veyo-react-fronten
    d\websites\recare\app\node_modules\.bin\start-storybook'".

(from yarn upgrade library).

@therealkenc
Copy link
Collaborator

therealkenc commented Aug 9, 2017

No strace provided, but on a hunch: Is start-storybook a file or a directory? If it is a directory you are possibly looking at #1529, #2243 (maybe not). Post a gist of yarn.strace from the following and someone can take a look:

$ strace -ff yarn run storybook 2> yarn.strace

@alanzanattadev
Copy link
Author

I've tried, but storybook can't be used with strace, it's becoming too slow for the webpage to load and it's preventing it from accessing to the point where it "requires" files. How can I help without doing this command ? I've encountered the issue also by doing a git stash when files being stashed are used by storybook. So it's a file issue, not folders apparently. The worst part is the file is removed when there is this issue.

@therealkenc
Copy link
Collaborator

Repro steps and someone might pick it up.

@alanzanattadev
Copy link
Author

alanzanattadev commented Aug 10, 2017

The repro is super simple, that's a good thing:

  • Get any linux tool that watch the file system (Jest in watch mode for testing javascript, a webpack-dev-server, anything that watch for files to change)
  • launch it from WSL
  • create a file BEING USED by the tool, for example a unit test file for Jest.
  • git init
  • git stash from Powershell, outside WSL
  • It will throw an error saying permission denied, because the file is in use. If you stop the watching tool, you can git stash. Sometimes the file is even deleted for some reason.

@therealkenc
Copy link
Collaborator

Ah. #1956, #2086

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

No branches or pull requests

2 participants