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

[Windows] Cannot retrieve roots from FS (EPERM for 'Documents and Settings') #631

Closed
marcdumais-work opened this issue Oct 13, 2017 · 49 comments
Assignees
Labels
bug bugs found in the application duplicate duplicated issues

Comments

@marcdumais-work
Copy link
Contributor

On Windows (10) it seems impossible to open a workspace. The "Open Workspace" button is there but pressing it has no effect.

On another Windows 10 machine, I saw yesterday a slightly different behavior: that machine had multiple disks: starting Theia from the first one (C:) had the same issue as above. Starting it from the second disk (D:), the "Open Workspace" button did work, but presented me with a directory selection dialog that contained only the D drive and no sub-directory to select. Chosing the drive "worked" but left me with an empty open workspace, with no file/directories in the file navigator.

@kittaakos
Copy link
Contributor

kittaakos commented Oct 13, 2017

button is there but pressing it has no effect.

Uncaught (in promise) Error: Request getRoots failed with message: EPERM: operation not permitted, scandir 'c:\Documents and Settings'
    at new ResponseError (messages.js:46)
    at handleResponse (main.js:421)
    at processMessageQueue (main.js:249)
    at main.js:233
    at run (setImmediate.js:40)
    at runIfPresent (setImmediate.js:69)
    at onGlobalMessage (setImmediate.js:109)

That means, we cannot get the workspace root on Windows. Nice.

@kittaakos kittaakos self-assigned this Oct 13, 2017
@kittaakos
Copy link
Contributor

My super complex script fails with the same problem.

foo.js:

const fs = require("fs");
const a1 = fs.readdirSync("C:\\");
console.log(a1);
const a2 = fs.readdirSync("C:\\Documents and Settings");
console.log(a2);
kittaakos@DESKTOP-T6DO8IJ MINGW64 ~/dev
$ node foo.js
[ '$Recycle.Bin',
  'Documents and Settings',
  'pagefile.sys',
  'PerfLogs',
  'Program Files',
  'Program Files (x86)',
  'ProgramData',
  'Recovery',
  'swapfile.sys',
  'System Volume Information',
  'Users',
  'Windows' ]
fs.js:911
  return binding.readdir(pathModule._makeLong(path), options.encoding);
                 ^

Error: EPERM: operation not permitted, scandir 'C:\Documents and Settings'
    at Object.fs.readdirSync (fs.js:911:18)
    at Object.<anonymous> (C:\Users\kittaakos\dev\foo.js:4:15)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)
    at Function.Module.runMain (module.js:665:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:607:3

kittaakos@DESKTOP-T6DO8IJ MINGW64 ~/dev

@kittaakos kittaakos changed the title [Windows] Can't open workspace [Windows] Cannot retrieve roots from FS (EPERM for 'Documents and Settings') Oct 13, 2017
@kittaakos
Copy link
Contributor

It fails on Windows 10 inside both VirtualBox and VMWare Fusion. (node 8.2.1 and 8.6.0)

@hexa00
Copy link

hexa00 commented Oct 13, 2017

Is it that we should not use Document & Settings to store app data ?
I don't know much about windows but I seem to remember app data under the User/LocalApp or something like that...

@kittaakos
Copy link
Contributor

@marcdumais-work, the above error is gone, if I execute the module from a terminal I have opened as an administrator. This "trick" has no effect when running Theia.

@kittaakos
Copy link
Contributor

Is it that we should not use Document & Settings to store app data ?

No. And we do not store anything but trying to create a tree from the file-resource hierarchy.

@hexa00
Copy link

hexa00 commented Oct 13, 2017

Rigth but humm why is the hiearchy starting there again ? :)

@kittaakos
Copy link
Contributor

I do not understand this.

@hexa00
Copy link

hexa00 commented Oct 13, 2017

I mean why is the workspace root Document & Settings ?

Or is it C: and it tries to do a recursive tree from there ?

@kittaakos
Copy link
Contributor

Correct.

@marcdumais-work
Copy link
Contributor Author

marcdumais-work commented Oct 13, 2017

Or is it C: and it tries to do a recursive tree from there ?

This might explain why it's working a little better when I start Theia on D:, which on my machine is a pure data drive, without "Documents & Settings", etc.

@kittaakos
Copy link
Contributor

@marcdumais-work, could you please try it again after turning off the Windows Defender? Thanks!

@kittaakos
Copy link
Contributor

Or just try to ignore node.exe. See here: https://blog.johnnyreilly.com/2017/06/windows-defender-step-away-from-npm.html

@hexa00
Copy link

hexa00 commented Oct 13, 2017

Should we not just recover from an exception like that list the dir name, do not go further and continue making the tree ?

@kittaakos
Copy link
Contributor

I do not think that would solve the issue. If we would do that, then the user would see a tree with the root C: without any children.

@marcdumais-work
Copy link
Contributor Author

@kittaakos Ok, I have added the exclusion. I get the following error in the fronte-end, when clicking on "open Workspace" :

messages.js:46 Uncaught (in promise) Error: Request getRoots failed with message: EBUSY: resource busy or locked, stat 'c:\pagefile.sys'
    at new ResponseError (messages.js:46)
    at handleResponse (main.js:421)
    at processMessageQueue (main.js:249)
    at main.js:233
    at run (setImmediate.js:40)
    at runIfPresent (setImmediate.js:69)
    at onGlobalMessage (setImmediate.js:109)

I get the same when altogether disabling Windows Defender

@hexa00
Copy link

hexa00 commented Oct 13, 2017

@kittaakos it should see the C children but not the children of Document & Settings no ?

@hexa00
Copy link

hexa00 commented Oct 13, 2017

From your script C: is working fine...

@kittaakos
Copy link
Contributor

Do you have any antivirus program running? Some people recommend to turn that off too. Disabling the Windows Defender did not help here either. The only workaround I have found so far is to run the terminal as an administrator.

@kittaakos
Copy link
Contributor

it should see the C children but not the children of Document & Settings no ?

True. But what could the user do with the Documents and Settings if we were not even able to read its content? I see your point, but I would not consider it as a fix.

@hexa00
Copy link

hexa00 commented Oct 13, 2017

Why are we trying to figureout a workaround ? Theia should not need admin to run.
We should handle the no perm issue.

@marcdumais-work
Copy link
Contributor Author

@kittaakos no I think it's just Windows Defender on that machine.

@hexa00
Copy link

hexa00 commented Oct 13, 2017

True. But what could the user do with the Documents and Settings if we were not even able to read its content? I see your point, but I would not consider it as a fix.

It is fine if there a dir we are not allowed to read.

@kittaakos
Copy link
Contributor

@marcdumais-work, thanks for checking!

@kittaakos
Copy link
Contributor

we are not allowed to read

Please define not allowed to read, I can read it from the terminal, a windows commander, or a windows explorer. I cannot read it from Node.js.

@marcdumais-work
Copy link
Contributor Author

marcdumais-work commented Oct 13, 2017

@akosyakov from a git bash teminal, I can't access c:\pagefile.sys, the same file as in the error I got above:

image

@hexa00
Copy link

hexa00 commented Oct 13, 2017

@kittaakos but you are admin on that terminal/windows explorer no ?
And you are not from node.

Unless node is not running as the current user but I doubt it ?

@hexa00
Copy link

hexa00 commented Oct 13, 2017

I think unlike on linux osx/linux when you start something from an admin Git Bash the children are not admin but are from the current user.
Not clear how to confirm that.

kittaakos added a commit that referenced this issue Oct 16, 2017
Signed-off-by: Akos Kitta <kittaakos@gmail.com>
@kittaakos
Copy link
Contributor

Although, the issue seems to be fixed with the changes, it reveals other problems on Windows:

$ yarn run start
yarn run v1.0.2
$ theia start
Starting the express server worker...

The express server worker 1 has been started.

The express server worker 1 is ready to accept messages.

[2017-10-16T13:37:28.917Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Starting watching: [ 'c:\\Users\\kittaakos\\dev\\theia\\examples\\browser\\package.json' ]

[2017-10-16T13:37:28.918Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Starting watching: [ 'c:\\Users\\kittaakos\\.theia\\settings.json' ]

[2017-10-16T13:37:28.919Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Starting watching: [ '\\.theia\\settings.json' ]

[2017-10-16T13:37:28.922Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Theia app listening on http://localhost:3000. []

[2017-10-16T13:37:28.927Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Started watching: [ 'c:\\Users\\kittaakos\\dev\\theia\\examples\\browser\\package.json' ]

[2017-10-16T13:37:28.928Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Started watching: [ 'c:\\Users\\kittaakos\\.theia\\settings.json' ]

[2017-10-16T13:37:28.928Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Started watching: [ '\\.theia\\settings.json' ]

[2017-10-16T13:37:39.522Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Starting watching: [ 'c:\\Users\\kittaakos\\.theia\\settings.json' ]

[2017-10-16T13:37:39.522Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Starting watching: [ '\\.theia\\settings.json' ]

[2017-10-16T13:37:39.524Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Started watching: [ 'c:\\Users\\kittaakos\\.theia\\settings.json' ]

[2017-10-16T13:37:39.524Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Started watching: [ '\\.theia\\settings.json' ]

[2017-10-16T13:37:39.697Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Starting watching: [ 'c:\\Users\\kittaakos\\.theia\\settings.json' ]

[2017-10-16T13:37:39.697Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Starting watching: [ '\\.theia\\settings.json' ]

[2017-10-16T13:37:39.697Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Started watching: [ 'c:\\Users\\kittaakos\\.theia\\settings.json' ]

[2017-10-16T13:37:39.698Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Started watching: [ '\\.theia\\settings.json' ]

[2017-10-16T13:37:45.599Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Stopping watching: [ '\\.theia\\settings.json' ]

[2017-10-16T13:37:45.599Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Stopped watching. []

[2017-10-16T13:37:45.599Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Stopping watching: [ '\\.theia\\settings.json' ]

[2017-10-16T13:37:45.599Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Stopped watching. []

[2017-10-16T13:37:45.599Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Stopping watching: [ 'c:\\Users\\kittaakos\\.theia\\settings.json' ]

[2017-10-16T13:37:45.599Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Stopped watching. []

[2017-10-16T13:37:45.599Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Stopping watching: [ 'c:\\Users\\kittaakos\\.theia\\settings.json' ]

[2017-10-16T13:37:45.599Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Stopped watching. []

[2017-10-16T13:37:46.883Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Starting watching: [ 'c:\\Users\\kittaakos\\.theia\\settings.json' ]

[2017-10-16T13:37:46.883Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Starting watching: [ 'c:\\Users\\kittaakos\\.theia\\settings.json' ]

[2017-10-16T13:37:46.883Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Started watching: [ 'c:\\Users\\kittaakos\\.theia\\settings.json' ]

[2017-10-16T13:37:46.884Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Started watching: [ 'c:\\Users\\kittaakos\\.theia\\settings.json' ]

[2017-10-16T13:37:47.120Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Starting watching: [ 'c:\\Users\\kittaakos\\.theia\\settings.json' ]

[2017-10-16T13:37:47.120Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Starting watching: [ 'c:\\Users\\kittaakos\\.theia\\settings.json' ]

[2017-10-16T13:37:47.127Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Started watching: [ 'c:\\Users\\kittaakos\\.theia\\settings.json' ]

[2017-10-16T13:37:47.127Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Started watching: [ 'c:\\Users\\kittaakos\\.theia\\settings.json' ]

[2017-10-16T13:37:47.244Z]  INFO: Theia/4468 on DESKTOP-T6DO8IJ: Starting watching: [ 'c:\\Users\\kittaakos' ]

[2017-10-16T13:37:47.275Z] ERROR: Theia/4468 on DESKTOP-T6DO8IJ:
    Watching error: [ { Error: watch c:\Users\kittaakos\Application Data EPERM
        at _errnoException (util.js:1019:11)
        at FSWatcher.start (fs.js:1383:19)
        at Object.fs.watch (fs.js:1409:11)
        at createFsWatchInstance (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:37:15)
        at setFsWatchListener (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:80:15)
        at FSWatcher.NodeFsHandler._watchWithNodeFs (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:228:14)
        at FSWatcher.NodeFsHandler._handleDir (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:407:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:455:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:460:16)
        at FSReqWrap.oncomplete (fs.js:154:5)
        code: 'EPERM',
        errno: 'EPERM',
        syscall: 'watch c:\\Users\\kittaakos\\Application Data',
        filename: 'c:\\Users\\kittaakos\\Application Data' } ]

[2017-10-16T13:37:47.276Z] ERROR: Theia/4468 on DESKTOP-T6DO8IJ:
    Watching error: [ { Error: watch c:\Users\kittaakos\Cookies EPERM
        at _errnoException (util.js:1019:11)
        at FSWatcher.start (fs.js:1383:19)
        at Object.fs.watch (fs.js:1409:11)
        at createFsWatchInstance (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:37:15)
        at setFsWatchListener (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:80:15)
        at FSWatcher.NodeFsHandler._watchWithNodeFs (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:228:14)
        at FSWatcher.NodeFsHandler._handleDir (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:407:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:455:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:460:16)
        at FSReqWrap.oncomplete (fs.js:154:5)
        code: 'EPERM',
        errno: 'EPERM',
        syscall: 'watch c:\\Users\\kittaakos\\Cookies',
        filename: 'c:\\Users\\kittaakos\\Cookies' } ]

[2017-10-16T13:37:47.276Z] ERROR: Theia/4468 on DESKTOP-T6DO8IJ:
    Watching error: [ { Error: watch c:\Users\kittaakos\Local Settings EPERM
        at _errnoException (util.js:1019:11)
        at FSWatcher.start (fs.js:1383:19)
        at Object.fs.watch (fs.js:1409:11)
        at createFsWatchInstance (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:37:15)
        at setFsWatchListener (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:80:15)
        at FSWatcher.NodeFsHandler._watchWithNodeFs (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:228:14)
        at FSWatcher.NodeFsHandler._handleDir (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:407:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:455:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:460:16)
        at FSReqWrap.oncomplete (fs.js:154:5)
        code: 'EPERM',
        errno: 'EPERM',
        syscall: 'watch c:\\Users\\kittaakos\\Local Settings',
        filename: 'c:\\Users\\kittaakos\\Local Settings' } ]

[2017-10-16T13:37:47.277Z] ERROR: Theia/4468 on DESKTOP-T6DO8IJ:
    Watching error: [ { Error: watch c:\Users\kittaakos\My Documents EPERM
        at _errnoException (util.js:1019:11)
        at FSWatcher.start (fs.js:1383:19)
        at Object.fs.watch (fs.js:1409:11)
        at createFsWatchInstance (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:37:15)
        at setFsWatchListener (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:80:15)
        at FSWatcher.NodeFsHandler._watchWithNodeFs (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:228:14)
        at FSWatcher.NodeFsHandler._handleDir (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:407:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:455:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:460:16)
        at FSReqWrap.oncomplete (fs.js:154:5)
        code: 'EPERM',
        errno: 'EPERM',
        syscall: 'watch c:\\Users\\kittaakos\\My Documents',
        filename: 'c:\\Users\\kittaakos\\My Documents' } ]

[2017-10-16T13:37:47.278Z] ERROR: Theia/4468 on DESKTOP-T6DO8IJ:
    Watching error: [ { Error: watch c:\Users\kittaakos\NetHood EPERM
        at _errnoException (util.js:1019:11)
        at FSWatcher.start (fs.js:1383:19)
        at Object.fs.watch (fs.js:1409:11)
        at createFsWatchInstance (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:37:15)
        at setFsWatchListener (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:80:15)
        at FSWatcher.NodeFsHandler._watchWithNodeFs (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:228:14)
        at FSWatcher.NodeFsHandler._handleDir (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:407:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:455:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:460:16)
        at FSReqWrap.oncomplete (fs.js:154:5)
        code: 'EPERM',
        errno: 'EPERM',
        syscall: 'watch c:\\Users\\kittaakos\\NetHood',
        filename: 'c:\\Users\\kittaakos\\NetHood' } ]

[2017-10-16T13:37:47.278Z] ERROR: Theia/4468 on DESKTOP-T6DO8IJ:
    Watching error: [ { Error: watch c:\Users\kittaakos\PrintHood EPERM
        at _errnoException (util.js:1019:11)
        at FSWatcher.start (fs.js:1383:19)
        at Object.fs.watch (fs.js:1409:11)
        at createFsWatchInstance (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:37:15)
        at setFsWatchListener (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:80:15)
        at FSWatcher.NodeFsHandler._watchWithNodeFs (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:228:14)
        at FSWatcher.NodeFsHandler._handleDir (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:407:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:455:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:460:16)
        at FSReqWrap.oncomplete (fs.js:154:5)
        code: 'EPERM',
        errno: 'EPERM',
        syscall: 'watch c:\\Users\\kittaakos\\PrintHood',
        filename: 'c:\\Users\\kittaakos\\PrintHood' } ]

[2017-10-16T13:37:47.279Z] ERROR: Theia/4468 on DESKTOP-T6DO8IJ:
    Watching error: [ { Error: watch c:\Users\kittaakos\Recent EPERM
        at _errnoException (util.js:1019:11)
        at FSWatcher.start (fs.js:1383:19)
        at Object.fs.watch (fs.js:1409:11)
        at createFsWatchInstance (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:37:15)
        at setFsWatchListener (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:80:15)
        at FSWatcher.NodeFsHandler._watchWithNodeFs (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:228:14)
        at FSWatcher.NodeFsHandler._handleDir (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:407:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:455:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:460:16)
        at FSReqWrap.oncomplete (fs.js:154:5)
        code: 'EPERM',
        errno: 'EPERM',
        syscall: 'watch c:\\Users\\kittaakos\\Recent',
        filename: 'c:\\Users\\kittaakos\\Recent' } ]

[2017-10-16T13:37:47.279Z] ERROR: Theia/4468 on DESKTOP-T6DO8IJ:
    Watching error: [ { Error: watch c:\Users\kittaakos\SendTo EPERM
        at _errnoException (util.js:1019:11)
        at FSWatcher.start (fs.js:1383:19)
        at Object.fs.watch (fs.js:1409:11)
        at createFsWatchInstance (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:37:15)
        at setFsWatchListener (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:80:15)
        at FSWatcher.NodeFsHandler._watchWithNodeFs (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:228:14)
        at FSWatcher.NodeFsHandler._handleDir (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:407:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:455:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:460:16)
        at FSReqWrap.oncomplete (fs.js:154:5)
        code: 'EPERM',
        errno: 'EPERM',
        syscall: 'watch c:\\Users\\kittaakos\\SendTo',
        filename: 'c:\\Users\\kittaakos\\SendTo' } ]

[2017-10-16T13:37:47.280Z] ERROR: Theia/4468 on DESKTOP-T6DO8IJ:
    Watching error: [ { Error: watch c:\Users\kittaakos\Start Menu EPERM
        at _errnoException (util.js:1019:11)
        at FSWatcher.start (fs.js:1383:19)
        at Object.fs.watch (fs.js:1409:11)
        at createFsWatchInstance (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:37:15)
        at setFsWatchListener (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:80:15)
        at FSWatcher.NodeFsHandler._watchWithNodeFs (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:228:14)
        at FSWatcher.NodeFsHandler._handleDir (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:407:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:455:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:460:16)
        at FSReqWrap.oncomplete (fs.js:154:5)
        code: 'EPERM',
        errno: 'EPERM',
        syscall: 'watch c:\\Users\\kittaakos\\Start Menu',
        filename: 'c:\\Users\\kittaakos\\Start Menu' } ]

[2017-10-16T13:37:47.280Z] ERROR: Theia/4468 on DESKTOP-T6DO8IJ:
    Watching error: [ { Error: watch c:\Users\kittaakos\Templates EPERM
        at _errnoException (util.js:1019:11)
        at FSWatcher.start (fs.js:1383:19)
        at Object.fs.watch (fs.js:1409:11)
        at createFsWatchInstance (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:37:15)
        at setFsWatchListener (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:80:15)
        at FSWatcher.NodeFsHandler._watchWithNodeFs (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:228:14)
        at FSWatcher.NodeFsHandler._handleDir (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:407:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:455:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:460:16)
        at FSReqWrap.oncomplete (fs.js:154:5)
        code: 'EPERM',
        errno: 'EPERM',
        syscall: 'watch c:\\Users\\kittaakos\\Templates',
        filename: 'c:\\Users\\kittaakos\\Templates' } ]

[2017-10-16T13:37:47.369Z] ERROR: Theia/4468 on DESKTOP-T6DO8IJ:
    Watching error: [ { Error: watch c:\Users\kittaakos\Documents\My Music EPERM
        at _errnoException (util.js:1019:11)
        at FSWatcher.start (fs.js:1383:19)
        at Object.fs.watch (fs.js:1409:11)
        at createFsWatchInstance (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:37:15)
        at setFsWatchListener (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:80:15)
        at FSWatcher.NodeFsHandler._watchWithNodeFs (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:228:14)
        at FSWatcher.NodeFsHandler._handleDir (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:407:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:455:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:460:16)
        at FSReqWrap.oncomplete (fs.js:154:5)
        code: 'EPERM',
        errno: 'EPERM',
        syscall: 'watch c:\\Users\\kittaakos\\Documents\\My Music',
        filename: 'c:\\Users\\kittaakos\\Documents\\My Music' } ]

[2017-10-16T13:37:47.370Z] ERROR: Theia/4468 on DESKTOP-T6DO8IJ:
    Watching error: [ { Error: watch c:\Users\kittaakos\Documents\My Pictures EPERM
        at _errnoException (util.js:1019:11)
        at FSWatcher.start (fs.js:1383:19)
        at Object.fs.watch (fs.js:1409:11)
        at createFsWatchInstance (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:37:15)
        at setFsWatchListener (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:80:15)
        at FSWatcher.NodeFsHandler._watchWithNodeFs (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:228:14)
        at FSWatcher.NodeFsHandler._handleDir (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:407:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:455:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:460:16)
        at FSReqWrap.oncomplete (fs.js:154:5)
        code: 'EPERM',
        errno: 'EPERM',
        syscall: 'watch c:\\Users\\kittaakos\\Documents\\My Pictures',
        filename: 'c:\\Users\\kittaakos\\Documents\\My Pictures' } ]

[2017-10-16T13:37:47.370Z] ERROR: Theia/4468 on DESKTOP-T6DO8IJ:
    Watching error: [ { Error: watch c:\Users\kittaakos\Documents\My Videos EPERM
        at _errnoException (util.js:1019:11)
        at FSWatcher.start (fs.js:1383:19)
        at Object.fs.watch (fs.js:1409:11)
        at createFsWatchInstance (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:37:15)
        at setFsWatchListener (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:80:15)
        at FSWatcher.NodeFsHandler._watchWithNodeFs (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:228:14)
        at FSWatcher.NodeFsHandler._handleDir (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:407:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:455:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:460:16)
        at FSReqWrap.oncomplete (fs.js:154:5)
        code: 'EPERM',
        errno: 'EPERM',
        syscall: 'watch c:\\Users\\kittaakos\\Documents\\My Videos',
        filename: 'c:\\Users\\kittaakos\\Documents\\My Videos' } ]

[2017-10-16T13:37:47.497Z] ERROR: Theia/4468 on DESKTOP-T6DO8IJ:
    Watching error: [ { Error: watch c:\Users\kittaakos\AppData\Local\Application Data EPERM
        at _errnoException (util.js:1019:11)
        at FSWatcher.start (fs.js:1383:19)
        at Object.fs.watch (fs.js:1409:11)
        at createFsWatchInstance (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:37:15)
        at setFsWatchListener (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:80:15)
        at FSWatcher.NodeFsHandler._watchWithNodeFs (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:228:14)
        at FSWatcher.NodeFsHandler._handleDir (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:407:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:455:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:460:16)
        at FSReqWrap.oncomplete (fs.js:154:5)
        code: 'EPERM',
        errno: 'EPERM',
        syscall: 'watch c:\\Users\\kittaakos\\AppData\\Local\\Application Data',
        filename: 'c:\\Users\\kittaakos\\AppData\\Local\\Application Data' } ]

[2017-10-16T13:37:47.497Z] ERROR: Theia/4468 on DESKTOP-T6DO8IJ:
    Watching error: [ { Error: watch c:\Users\kittaakos\AppData\Local\History EPERM
        at _errnoException (util.js:1019:11)
        at FSWatcher.start (fs.js:1383:19)
        at Object.fs.watch (fs.js:1409:11)
        at createFsWatchInstance (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:37:15)
        at setFsWatchListener (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:80:15)
        at FSWatcher.NodeFsHandler._watchWithNodeFs (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:228:14)
        at FSWatcher.NodeFsHandler._handleDir (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:407:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:455:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:460:16)
        at FSReqWrap.oncomplete (fs.js:154:5)
        code: 'EPERM',
        errno: 'EPERM',
        syscall: 'watch c:\\Users\\kittaakos\\AppData\\Local\\History',
        filename: 'c:\\Users\\kittaakos\\AppData\\Local\\History' } ]

[2017-10-16T13:37:47.498Z] ERROR: Theia/4468 on DESKTOP-T6DO8IJ:
    Watching error: [ { Error: watch c:\Users\kittaakos\AppData\Local\Temporary Internet Files EPERM
        at _errnoException (util.js:1019:11)
        at FSWatcher.start (fs.js:1383:19)
        at Object.fs.watch (fs.js:1409:11)
        at createFsWatchInstance (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:37:15)
        at setFsWatchListener (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:80:15)
        at FSWatcher.NodeFsHandler._watchWithNodeFs (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:228:14)
        at FSWatcher.NodeFsHandler._handleDir (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:407:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:455:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:460:16)
        at FSReqWrap.oncomplete (fs.js:154:5)
        code: 'EPERM',
        errno: 'EPERM',
        syscall: 'watch c:\\Users\\kittaakos\\AppData\\Local\\Temporary Internet Files',
        filename: 'c:\\Users\\kittaakos\\AppData\\Local\\Temporary Internet Files' } ]

[2017-10-16T13:37:50.129Z] ERROR: Theia/4468 on DESKTOP-T6DO8IJ:
    Watching error: [ { Error: watch c:\Users\kittaakos\AppData\Local\Microsoft\Windows\Temporary Internet Files EPERM
        at _errnoException (util.js:1019:11)
        at FSWatcher.start (fs.js:1383:19)
        at Object.fs.watch (fs.js:1409:11)
        at createFsWatchInstance (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:37:15)
        at setFsWatchListener (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:80:15)
        at FSWatcher.NodeFsHandler._watchWithNodeFs (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:228:14)
        at FSWatcher.NodeFsHandler._handleDir (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:407:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:455:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:460:16)
        at FSReqWrap.oncomplete (fs.js:154:5)
        code: 'EPERM',
        errno: 'EPERM',
        syscall: 'watch c:\\Users\\kittaakos\\AppData\\Local\\Microsoft\\Windows\\Temporary Internet Files',
        filename: 'c:\\Users\\kittaakos\\AppData\\Local\\Microsoft\\Windows\\Temporary Internet Files' } ]

[2017-10-16T13:37:52.842Z] ERROR: Theia/4468 on DESKTOP-T6DO8IJ:
    Watching error: [ { Error: watch c:\Users\kittaakos\AppData\Local\Microsoft\Windows\INetCache\Content.IE5 EPERM
        at _errnoException (util.js:1019:11)
        at FSWatcher.start (fs.js:1383:19)
        at Object.fs.watch (fs.js:1409:11)
        at createFsWatchInstance (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:37:15)
        at setFsWatchListener (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:80:15)
        at FSWatcher.NodeFsHandler._watchWithNodeFs (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:228:14)
        at FSWatcher.NodeFsHandler._handleDir (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:407:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:455:19)
        at FSWatcher.<anonymous> (C:\Users\kittaakos\dev\theia\node_modules\chokidar\lib\nodefs-handler.js:460:16)
        at FSReqWrap.oncomplete (fs.js:154:5)
        code: 'EPERM',
        errno: 'EPERM',
        syscall: 'watch c:\\Users\\kittaakos\\AppData\\Local\\Microsoft\\Windows\\INetCache\\Content.IE5',
        filename: 'c:\\Users\\kittaakos\\AppData\\Local\\Microsoft\\Windows\\INetCache\\Content.IE5' } ]

@hexa00
Copy link

hexa00 commented Oct 16, 2017

Indeed a problem there, you should have access to those, is listing working but not watching ?

@kittaakos
Copy link
Contributor

I can transform the error message into a warning and omit the stack trace. Any other ideas?

@hexa00
Copy link

hexa00 commented Oct 16, 2017

We need to figure out what the perm issue is ?

@kittaakos
Copy link
Contributor

I do not understand this, could you please elaborate? I can do the following; in the watcher, when I receive an exception, I can check for the code and the existence of the filename. If the error code is EPERM and the file name is present, instead of logging the error with the full stack trace, I can log a warning that shows the permission issue plus the file name.

kittaakos added a commit that referenced this issue Oct 16, 2017
Instead of logging an error with its full stack trace, we log a
warning when the file change cannot be watched do to insufficient
user permissions.

Signed-off-by: Akos Kitta <kittaakos@gmail.com>
@hexa00
Copy link

hexa00 commented Oct 16, 2017

Yes that's fine but I think we need to know why we can't watch for example c:\Users\kittaakos\Documents\My Videos

Maybe we're doing something wrong that will be an issue at some point for a rootdir also?

@kittaakos
Copy link
Contributor

I think unlike on linux osx/linux when you start something from an admin Git Bash the children are not admin but are from the current user.
Not clear how to confirm that.

I think the problem is somewhere here. Maybe we should use runas.exe when invoking npm scripts for build/start.

@kittaakos
Copy link
Contributor

PR: #643

kittaakos added a commit that referenced this issue Oct 16, 2017
Signed-off-by: Akos Kitta <kittaakos@gmail.com>
@hexa00
Copy link

hexa00 commented Oct 16, 2017

think the problem is somewhere here. Maybe we should use runas.exe when invoking npm scripts for build/start.

but My Documents/Videos should be accessible from the user no ?

kittaakos added a commit that referenced this issue Oct 16, 2017
Added method for getting the current user's home directory.

Signed-off-by: Akos Kitta <kittaakos@gmail.com>
kittaakos added a commit that referenced this issue Oct 16, 2017
From now on, FS gracefully handles when operation is not permitted
or when resource is busy, so that it does not fail when getting file
stats.

Signed-off-by: Akos Kitta <kittaakos@gmail.com>
kittaakos added a commit that referenced this issue Oct 16, 2017
From now on the workspace root selector dialog proposes the current
user's home directory instead of the FS root.

Signed-off-by: Akos Kitta <kittaakos@gmail.com>
kittaakos added a commit that referenced this issue Oct 16, 2017
Signed-off-by: Akos Kitta <kittaakos@gmail.com>
kittaakos added a commit that referenced this issue Oct 16, 2017
Instead of logging an error with its full stack trace, we log a
warning when the file change cannot be watched do to insufficient
user permissions.

Signed-off-by: Akos Kitta <kittaakos@gmail.com>
@hexa00
Copy link

hexa00 commented Oct 16, 2017

Created #646 about the issue I mentioned before

kittaakos added a commit that referenced this issue Oct 17, 2017
Added method for getting the current user's home directory.

Signed-off-by: Akos Kitta <kittaakos@gmail.com>
kittaakos added a commit that referenced this issue Oct 17, 2017
From now on, FS gracefully handles when operation is not permitted
or when resource is busy, so that it does not fail when getting file
stats.

Signed-off-by: Akos Kitta <kittaakos@gmail.com>
kittaakos added a commit that referenced this issue Oct 17, 2017
From now on the workspace root selector dialog proposes the current
user's home directory instead of the FS root.

Signed-off-by: Akos Kitta <kittaakos@gmail.com>
kittaakos added a commit that referenced this issue Oct 17, 2017
Signed-off-by: Akos Kitta <kittaakos@gmail.com>
kittaakos added a commit that referenced this issue Oct 17, 2017
Instead of logging an error with its full stack trace, we log a
warning when the file change cannot be watched do to insufficient
user permissions.

Signed-off-by: Akos Kitta <kittaakos@gmail.com>
@marcdumais-work
Copy link
Contributor Author

Duplicate of #663

@marcdumais-work marcdumais-work marked this as a duplicate of #663 Jan 17, 2018
@marcdumais-work marcdumais-work added the duplicate duplicated issues label Jan 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application duplicate duplicated issues
Projects
None yet
Development

No branches or pull requests

3 participants