apollographql / apollo-tooling

✏️ Apollo CLI for client tooling (Mostly replaced by Rover)
https://apollographql.com
MIT License
3.04k stars 468 forks source link

VSCode extension shouldn't fail on scanning directories #2299

Open Tymek opened 3 years ago

Tymek commented 3 years ago

Intended outcome:

Apollo VSCode extension doesn't scan directories excluded in apollo.config.js and loads without an error.

Actual outcome:

[Trace - 11:38:38 AM] Sending request 'initialize - (0)'.
[Trace - 11:38:39 AM] Received response 'initialize - (0)' in 489ms. Request failed: Request initialize failed with message: EACCES: permission denied, scandir '/srv/momentum/data/postgres' (-32603).
[Error - 11:38:39 AM] Server initialization failed.
  Message: Request initialize failed with message: EACCES: permission denied, scandir '/srv/momentum/data/postgres'
  Code: -32603 

Screenshot from 2021-05-03 11-40-12

How to reproduce the issue:

In root directory of a project create a file or directory owned by different user (root for example). Add it to client.excludes and make sure that client.includes and service.localSchemaFile doesn't use it.

Versions

v1.18.9

Related to:

https://github.com/apollographql/apollo-tooling/issues/1715

Tymek commented 3 years ago

I narrowed the problem down to packages/apollo-language-server/src/workspace.ts#L117

PR welcome? I would try to substitute glob package with fast-glob, since it looks like this was the intent behind fg variable.

arochadaniel commented 3 years ago

Any updates on this? Can't use the extension either because of this problem.

image

adarshaacharya commented 3 years ago

Same problem here. Has anyone found the fix?

superami-code commented 1 year ago

I am seeing this issue as well, also due to a sub-directory that is not accessible by my default user.