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

Parcel watcher: inotify_add_watch failed #135907

Closed
karthiknadig opened this issue Oct 26, 2021 · 9 comments
Closed

Parcel watcher: inotify_add_watch failed #135907

karthiknadig opened this issue Oct 26, 2021 · 9 comments
Assignees
Labels
author-verification-requested Issues potentially verifiable by issue author bug Issue identified by VS Code Team member as probable bug file-watcher File watcher insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Milestone

Comments

@karthiknadig
Copy link
Member

Testing #135653

  ERR [File Watcher (parcel)] Unexpected error in event callback: inotify_add_watch failed: Not a directory (path: /home/kanadig/GIT/vscode-python)

This occurred after adding and deleting virtual envs under this folder a couple of times. It was watching everything fine until then.

@bpasero
Copy link
Member

bpasero commented Oct 27, 2021

@karthiknadig I have seen this particular error before when I would pass in a folder to watch to parcel that is a symlink (refs parcel-bundler/watcher#62). But we always now try to resolve any symlinks and only pass in the real path to parcel, never the symlink.

Another possible issue might be that we end up asking parcel to watch a folder that no longer exists on disk.

Do you have reliable steps to reproduce?

@bpasero bpasero added the info-needed Issue requires more information from poster label Oct 27, 2021
@bpasero bpasero changed the title Parcel watcher: inotify_add_watch failed Parcel watcher: inotify_add_watch failed Oct 27, 2021
@karthiknadig
Copy link
Member Author

/home/kanadig/GIT/vscode-python is the root directory after doing a git clone https://github.com/microsoft/vscode-python, definitely not a symbolic link. I had this folder open in VS Code, and I was creating and deleting virtual envs under this directory. This on linux (mint) running on a bootable usb drive. I don't have a consistent repro, but it did happen to me a few times.

@bpasero
Copy link
Member

bpasero commented Oct 27, 2021

This is part of #135902 and reported as parcel-bundler/watcher#76. Bottom line: parcel does not support to watch symbolic links when they are encountered. In other words, the watcher will never follow symlinks. The steps involved result in symlinks being created on disk and the error is just us printing this case.

Merging into #135902.

@bpasero bpasero closed this as completed Oct 27, 2021
@bpasero bpasero added *duplicate Issue identified as a duplicate of another issue(s) file-watcher File watcher and removed info-needed Issue requires more information from poster labels Oct 27, 2021
@bpasero
Copy link
Member

bpasero commented Oct 27, 2021

Actually since I have pushed 27f2019 I wonder if you can validate that fix in tomorrows insider.

@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug and removed *duplicate Issue identified as a duplicate of another issue(s) labels Oct 27, 2021
@bpasero bpasero modified the milestones: November 2021, October 2021 Oct 27, 2021
@alexr00 alexr00 added the author-verification-requested Issues potentially verifiable by issue author label Oct 28, 2021
@alexr00
Copy link
Member

alexr00 commented Oct 29, 2021

\closedWith 27f2019

@alexr00 alexr00 added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Oct 29, 2021
@meganrogge meganrogge added the verification-steps-needed Steps to verify are needed for verification label Oct 29, 2021
@alexr00
Copy link
Member

alexr00 commented Nov 1, 2021

@bpasero what is the best way to verify this?

@bpasero
Copy link
Member

bpasero commented Nov 1, 2021

Steps:

  • open a folder using insiders on Linux
  • anywhere add a symbolic link under that folder (a symbolic link that points to a folder)
  • ensure that file watching does not stop working (you might see a message about watcher restarting)

(we do not support to watch for changes inside the symbolic link unless you add it via files.watcherExclude)

@alexr00 alexr00 added verified Verification succeeded and removed verification-steps-needed Steps to verify are needed for verification labels Nov 1, 2021
@karthiknadig
Copy link
Member Author

Confirming that this works.

DEBUG [File Watcher (parcel)] Request to start watching: /home/kanadig/GIT/vscode-python (excludes: **/.git/objects/**,**/.git/subtree-cache/**,**/node_modules/*/**,**/.hg/store/**)
workbench.desktop.main.js:602 DEBUG [File Watcher (parcel)] Request to stop watching:
workbench.desktop.main.js:602 DEBUG [File Watcher (parcel)] Started watching: '/home/kanadig/GIT/vscode-python' with backend 'inotify' and native excludes '/home/kanadig/GIT/vscode-python/.git/objects, /home/kanadig/GIT/vscode-python/.git/subtree-cache, /home/kanadig/GIT/vscode-python/node_modules, /home/kanadig/GIT/vscode-python/.hg/store'
workbench.desktop.main.js:602   ERR [File Watcher (parcel)] Unexpected error: inotify_add_watch failed: Not a directory (EUNKNOWN) (path: /home/kanadig/GIT/vscode-python)
workbench.desktop.main.js:602   ERR [File Watcher (parcel)] restarting watcher after error: inotify_add_watch failed: Not a directory
workbench.desktop.main.js:602 DEBUG [File Watcher (parcel)] Request to start watching: /home/kanadig/GIT/vscode-python (excludes: **/.git/objects/**,**/.git/subtree-cache/**,**/node_modules/*/**,**/.hg/store/**)
workbench.desktop.main.js:602 DEBUG [File Watcher (parcel)] Request to stop watching:
workbench.desktop.main.js:602 DEBUG [File Watcher (parcel)] Started watching: '/home/kanadig/GIT/vscode-python' with backend 'inotify' and native excludes '/home/kanadig/GIT/vscode-python/.git/objects, /home/kanadig/GIT/vscode-python/.git/subtree-cache, /home/kanadig/GIT/vscode-python/node_modules, /home/kanadig/GIT/vscode-python/.hg/store'

@github-actions github-actions bot locked and limited conversation to collaborators Dec 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
author-verification-requested Issues potentially verifiable by issue author bug Issue identified by VS Code Team member as probable bug file-watcher File watcher insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants
@bpasero @karthiknadig @meganrogge @alexr00 and others