kaermorchen / twig-language-server

Language server for Twig templates.
24 stars 3 forks source link

The Twig Language Server server crashed 5 times in the last 3 minutes. #30

Open tanc opened 9 months ago

tanc commented 9 months ago

Hi, I see this error since installing Modern Twig:

The Twig Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

The full output is:

node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[Error: EACCES: permission denied, scandir '[redacted]/docker-volumes/solr-data/data'] {
  errno: -13,
  code: 'EACCES',
  syscall: 'scandir',
  path: '[redacted]/docker-volumes/solr-data/data'
}

Node.js v18.15.0
[Info  - 10:20:25 AM] Connection to server got closed. Server will restart.
true
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[Error: EACCES: permission denied, scandir '[redacted]/docker-volumes/solr-data/data'] {
  errno: -13,
  code: 'EACCES',
  syscall: 'scandir',
  path: '[redacted]/docker-volumes/solr-data/data'
}

Node.js v18.15.0
[Info  - 10:20:26 AM] Connection to server got closed. Server will restart.
true
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[Error: EACCES: permission denied, scandir '[redacted]/docker-volumes/solr-data/data'] {
  errno: -13,
  code: 'EACCES',
  syscall: 'scandir',
  path: '[redacted]/docker-volumes/solr-data/data'
}

Node.js v18.15.0
[Info  - 10:20:34 AM] Connection to server got closed. Server will restart.
true
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[Error: EACCES: permission denied, scandir '[redacted]/docker-volumes/solr-data/data'] {
  errno: -13,
  code: 'EACCES',
  syscall: 'scandir',
  path: '[redacted]/docker-volumes/solr-data/data'
}

Node.js v18.15.0
[Info  - 10:20:37 AM] Connection to server got closed. Server will restart.
true
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[Error: EACCES: permission denied, scandir '[redacted]/docker-volumes/solr-data/data'] {
  errno: -13,
  code: 'EACCES',
  syscall: 'scandir',
  path: '[redacted]/docker-volumes/solr-data/data'
}

Node.js v18.15.0
[Error - 10:20:39 AM] The Twig Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

Note that [redacted] in the path is my change for this issue, it actually contains the full path.

I have the Modern Twig extension enabled and no other twig extensions.

kaermorchen commented 9 months ago

Hi.

EACCES: permission denied

Looks like the node process can't get access to folder.

tanc commented 9 months ago

Is there any chance to have the language server not crash if it can't access a file?

I have some annoying permissions on some containers that I can't change for political reasons.

moetelo commented 9 months ago

Hello @tanc,

What kind of data the directory [redacted]/docker-volumes/solr-data/data contains? Should it be accessible by the extension? i.e does it contain any Twig templates? What permissions are given to the folder?ls -ld [redacted]/docker-volumes/solr-data/data

It would be great if you could provide direct steps on how to reproduce this problem.


Also, you can try the fork of this extension. I've changed the strategy in such way that the extension does not read all directories on startup. Although the problem may occur on completion inside of {{ include('|') }} blocks. Please tell me if it does.

kaermorchen commented 9 months ago

@tanc Are you sure that this isn't a docker image access issue?

tanc commented 9 months ago

@kaermorchen I mean it is a docker access issue in the sense that the language server crashes when it doesn't have access to certain folders/files. But in my opinion if the language server is scanning files it can't read then it shouldn't crash, it should gracefully move on.

tanc commented 9 months ago

@moetelo the [redacted]/docker-volumes/solr-data/data contains the apache solr index data. It does not contain Twig templates and is of no interest to the extension. It would be good to be able to (optionally) specify the location of the twig templates as they are all located within one directory.

kaermorchen commented 9 months ago

@tanc How can I reproduce your issue?

tanc commented 9 months ago

@kaermorchen the simplest repro I can come up with is this:

mkdir twig-test
cd twig-test
mkdir unreadable-test
sudo chown 8983:8983 unreadable-test
sudo chmod 770 unreadable-test
code .

This will open VSCode in the directory twig-test and the language server will crash because it can't read unreadable-test directory.