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

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

Open
tanc opened this issue Oct 5, 2023 · 8 comments
Open

Comments

@tanc
Copy link

tanc commented Oct 5, 2023

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
Copy link
Owner

Hi.

EACCES: permission denied

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

@tanc
Copy link
Author

tanc commented Oct 8, 2023

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
Copy link
Contributor

moetelo commented Oct 12, 2023

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
Copy link
Owner

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

@tanc
Copy link
Author

tanc commented Oct 14, 2023

@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
Copy link
Author

tanc commented Oct 14, 2023

@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
Copy link
Owner

@tanc How can I reproduce your issue?

@tanc
Copy link
Author

tanc commented Oct 14, 2023

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants