eclipse-theia / theia

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
http://theia-ide.org
Eclipse Public License 2.0
19.9k stars 2.49k forks source link

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

Closed marcdumais-work closed 6 years ago

marcdumais-work commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

hexa00 commented 6 years ago

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 commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

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

kittaakos commented 6 years ago

I do not understand this.

hexa00 commented 6 years ago

I mean why is the workspace root Document & Settings ?

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

kittaakos commented 6 years ago

Correct.

marcdumais-work commented 6 years ago

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 commented 6 years ago

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

kittaakos commented 6 years ago

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

hexa00 commented 6 years ago

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

kittaakos commented 6 years ago

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 commented 6 years ago

@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 commented 6 years ago

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

hexa00 commented 6 years ago

From your script C: is working fine...

kittaakos commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

marcdumais-work commented 6 years ago

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

hexa00 commented 6 years ago

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 commented 6 years ago

@marcdumais-work, thanks for checking!

kittaakos commented 6 years ago

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 commented 6 years ago

@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 commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

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

We go with this approach. Furthermore, we expose a method on the FS: getCurrentUserHome(): Promise<FileStat> and we offer that in the workspace root selector dialog.

hexa00 commented 6 years ago

BTW I was also concerned that based on this error the navigator seems to work depth first and create a whole tree in memory while this is not needed...

Is that true ? Or it's going level by level as the user navigates ?

kittaakos commented 6 years ago

Is that true

No, we decrease the depth here: https://github.com/theia-ide/theia/blob/5e6da4c26093a1d203db93c11d7e7cdfcbb29af5/packages/filesystem/src/node/node-filesystem.ts#L348

hexa00 commented 6 years ago

I think there's still an error there since:

https://github.com/theia-ide/theia/blob/5e6da4c26093a1d203db93c11d7e7cdfcbb29af5/packages/filesystem/src/node/node-filesystem.ts#L348

This will call:

https://github.com/theia-ide/theia/blob/5e6da4c26093a1d203db93c11d7e7cdfcbb29af5/packages/filesystem/src/node/node-filesystem.ts#L309

With depth = 0

But this will call in turn:

https://github.com/theia-ide/theia/blob/5e6da4c26093a1d203db93c11d7e7cdfcbb29af5/packages/filesystem/src/node/node-filesystem.ts#L332

This is were we get:

 return binding.readdir(pathModule._makeLong(path), options.encoding);
                 ^

Error: EPERM: operation not permitted, scandir 'C:\Documents and Settings'

By doing readdirSync with a depth of 0 we're asking for the children when we do not have to.

This should rather be:

const children = depth > 0 ? this.doGetChildren(uri, files, depth) : [];

and:

 protected doGetChildren(uri: URI, files: string[], depth: number): FileStat[] {
   const files = fs.readdirSync(path);
        const children = [];
for (const file of files) {

Note I also make it so that no children is [] when it could be undefined before.

WDTY?

kittaakos commented 6 years ago

Please add a failing test case, thank you!

hexa00 commented 6 years ago

You mean to demonstrate or as part of a fix ?

kittaakos commented 6 years ago

It does not matter, if it fails, I will fix it, and it will be part of the PR anyway.

hexa00 commented 6 years ago

Well what I propose would fix the issue by kinda avoiding it.

So I think there still needs to be a general way to handle the things like you seem to be doing. But what I suggest will just improve our code...

kittaakos commented 6 years ago

But what I suggest will just improve our code...

Maybe it worth a follow-up task; can you create a new issue for that? Thanks!

hexa00 commented 6 years ago

K I'll just create an issue and PR for it.

kittaakos commented 6 years ago

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 commented 6 years ago

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

kittaakos commented 6 years ago

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

hexa00 commented 6 years ago

We need to figure out what the perm issue is ?

kittaakos commented 6 years ago

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.

hexa00 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

PR: #643

hexa00 commented 6 years ago

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 ?

hexa00 commented 6 years ago

Created #646 about the issue I mentioned before

marcdumais-work commented 6 years ago

Duplicate of #663