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

language server crash when starting extension #945

Closed
WinPlay02 opened this issue Mar 7, 2024 · 2 comments · Fixed by #947
Closed

language server crash when starting extension #945

WinPlay02 opened this issue Mar 7, 2024 · 2 comments · Fixed by #947
Assignees
Labels
bug 🪲 Something isn't working released Included in a release
Milestone

Comments

@WinPlay02
Copy link
Contributor

Describe the bug

The language server sometimes crashes at startup. This causes the language-specific features to no longer work.
The wrong access seems to happen in the following file: // ../../node_modules/langium/lib/lsp/document-update-handler.js.
The stacktrace is attached below.

2024-03-07 11:57:43.889 [info] c:\-\DSL\packages\safe-ds-vscode\dist\extension\mainServer.cjs:38139
  const connection = services.lsp.Connection;
                              ^

TypeError: Cannot read properties of undefined (reading 'lsp')
    at startLanguageServer (c:\-\DSL\packages\safe-ds-vscode\dist\extension\mainServer.cjs:38139:31)
    at startLanguageServer2 (c:\-\DSL\packages\safe-ds-vscode\dist\extension\mainServer.cjs:67460:3)
    at Object.<anonymous> (c:\-\DSL\packages\safe-ds-vscode\dist\extension\mainServer.cjs:67464:1)
    at Module._compile (node:internal/modules/cjs/loader:1271:14)
    at Object..js (node:internal/modules/cjs/loader:1326:10)
    at Module.load (node:internal/modules/cjs/loader:1126:32)
    at node:internal/modules/cjs/loader:967:12
    at Function._load (node:electron/js2c/node_init:2:13357)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:96:12)
    at node:internal/main/run_main_module:23:47

Node.js v18.17.1

2024-03-07 11:57:43.899 [info] [LanguageClient] [Error - 11:57:43] Server process exited with code 1.
2024-03-07 11:57:43.900 [info] [LanguageClient] [Error - 11:57:43] Server initialization failed.
2024-03-07 11:57:43.900 [info] [LanguageClient]   Message: Pending response rejected since connection got disposed
  Code: -32097 
2024-03-07 11:57:43.901 [info] [LanguageClient] [Info  - 11:57:43] Connection to server got closed. Server will restart.
2024-03-07 11:57:43.901 [info] [LanguageClient] true
2024-03-07 11:57:43.901 [info] [LanguageClient] [Error - 11:57:43] Safe-DS client: couldn't create connection to server.
2024-03-07 11:57:43.901 [info] [LanguageClient]   Message: Pending response rejected since connection got disposed
  Code: -32097 
2024-03-07 11:57:43.902 [info] [LanguageClient] [Error - 11:57:43] Restarting server failed
2024-03-07 11:57:43.902 [info] [LanguageClient]   Message: Pending response rejected since connection got disposed

To Reproduce

  1. Start extension (in debug mode from existing visual code instance)
  2. Observe crash (including the final message)
    The Safe-DS server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

Expected behavior

Language features working and language server not crashing.

Screenshots (optional)

No response

Additional Context (optional)

It may be related to the langium upgrade to version 3 / 3 rc, but the commit ranges were not bisected

@WinPlay02 WinPlay02 added the bug 🪲 Something isn't working label Mar 7, 2024
@lars-reimann lars-reimann added this to DSL Mar 7, 2024
@github-project-automation github-project-automation bot moved this to Backlog in DSL Mar 7, 2024
@lars-reimann lars-reimann self-assigned this Mar 7, 2024
@lars-reimann lars-reimann moved this from Backlog to In Progress in DSL Mar 7, 2024
@lars-reimann lars-reimann added this to the v0.9.0 milestone Mar 7, 2024
@lars-reimann lars-reimann linked a pull request Mar 7, 2024 that will close this issue
@lars-reimann
Copy link
Member

Thanks for the report. Could you verify whether #947 fixes the issue?

lars-reimann added a commit that referenced this issue Mar 7, 2024
Closes #945

### Summary of Changes

Add a missing `await` to fix a crash when starting the language server.
@github-project-automation github-project-automation bot moved this from In Progress to ✔️ Done in DSL Mar 7, 2024
lars-reimann pushed a commit that referenced this issue Apr 1, 2024
## [0.9.0](v0.8.0...v0.9.0) (2024-04-01)

### Features

* `unknown` default value of stub parameters ([#952](#952)) ([78103e3](78103e3)), closes [#951](#951)
* `unknown` type ([#973](#973)) ([4638249](4638249)), closes [#967](#967)
* add constraints to stubs ([#953](#953)) ([dc5bf3b](dc5bf3b))
* allow any widening/narrowing type cast ([#948](#948)) ([ce01628](ce01628))
* checking of parameter bounds ([#925](#925)) ([610604f](610604f)), closes [#18](#18)
* Markdown documentation generator ([#963](#963)) ([77d04de](77d04de)), closes [#663](#663)
* stubs for `safe-ds` library ([#950](#950)) ([155b1c0](155b1c0)), closes [#926](#926)
* VS Code command to dump diagnostics into a JSON file ([#928](#928)) ([34fa884](34fa884)), closes [#927](#927)

### Bug Fixes

* do not memoize calls containing lambdas calling segments ([#944](#944)) ([114fee6](114fee6))
* language server crash on startup ([#947](#947)) ([9923074](9923074)), closes [#945](#945)
* type checking of two union types ([#949](#949)) ([21fc485](21fc485))
@lars-reimann
Copy link
Member

🎉 This issue has been resolved in version 0.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lars-reimann lars-reimann added the released Included in a release label Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working released Included in a release
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants