javascript-typescript-langserver icon indicating copy to clipboard operation
javascript-typescript-langserver copied to clipboard

Error: EACCES: permission denied when project contains inaccessible directories

Open alecdwm opened this issue 7 years ago • 2 comments

Hello!

When working in a project that contains a directory my user has no access to, I encounter the following error:

ERROR Handle textDocumentDidOpen: { Error: EACCES: permission denied, scandir '/tmp/example/db/diagnostic.data'
  errno: -13,
  code: 'EACCES',
  syscall: 'scandir',
  path: '/tmp/example/db/diagnostic.data' }

An example use case of this scenario is when working with docker-compose, one might want to mount a host directory (say, $PROJECT_DIR/db) to a container directory in order to store persistent data between application restarts. However, the user running the application within the container is not always necessarily going to be the same as the user who started the docker container on the host.

I have here some steps that will reproduce the issue when using

  • javascript-typescript-langserver version 2.8.0 with
  • LanguageClient-neovim version 0.1.39.
mkdir /tmp/example
cd /tmp/example
git init
mkdir -p db/diagnostic.data
chmod 600 db/diagnostic.data
sudo chown root db/diagnostic.data
mkdir src
touch src/index.js
vim src/index.js
# almost immediately the error is displayed in the vim command bar:
# [Error] { Error: EACCES: permission denied, sc...,^@  path: '/tmp/example/db/diagnostic.data' }

alecdwm avatar Mar 14 '18 03:03 alecdwm

Yeah same here, basically makes this project unusable. Weirdly my files are all in client (including package.json) and it even complains about a file in the directory above client. My situation is the same as yours... using docker-compose and sharing data with a postgres container.

insidewhy avatar Nov 17 '18 11:11 insidewhy

I don't see the error until I type gd somewhere to go to a definition. At which stage I see the EACCESS error in my console and it fails to go to the definition.

insidewhy avatar Nov 17 '18 11:11 insidewhy