mtxr / vscode-sqltools

Database management for VSCode
https://vscode-sqltools.mteixeira.dev?utm_source=github&utm_medium=homepage-link
MIT License
1.52k stars 306 forks source link

The SQLTools Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. #1108

Closed bennaa closed 1 year ago

bennaa commented 1 year ago

Describe the bug When I try to run the extension it crashes and report the following error:

The SQLTools Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. This is the log of the error: [1676459773607] INFO (ext): SQLTools is starting [1676459773610] INFO (ext): initializing language client... [1676459773610] INFO (ext): Detecting node path (if this stalls check Terminal view for the stuck session and kill it)... ns: "lc" [1676459775600] INFO (ext): Node runtime auto-detected. Using /usr/bin/node. ns: "lc" [1676459775600] INFO (ext): Registering client for languages [{"scheme":"sqltools"},{"language":"sql","scheme":"untitled"},{"language":"sql","scheme":"file"},{"language":"sql","scheme":"sqltools"}] ns: "lc" [1676459775602] INFO (ext): loading plugins... [1676459775602] INFO (ext): registering Formatter Plugin. plugin: { "name": "Formatter Plugin" } [1676459775603] INFO (ext): registering Connection Manager Plugin. plugin: { "name": "Connection Manager Plugin" } [1676459775603] INFO (ext): registering CodeLens Plugin. plugin: { "name": "CodeLens Plugin", "registeredLanguages": [] } [1676459775604] INFO (ext): registering Dependency Manager Plugin. plugin: { "name": "Dependency Manager Plugin", "installingDrivers": [] } [1676459775605] INFO (ext): Connection explorer changed. Will be updated. ns: "conn-man:explorer" [1676459775606] INFO (ext): registering History Manager Plugin. plugin: { "name": "History Manager Plugin" } [1676459775606] INFO (ext): registering Bookmarks Manager Plugin. plugin: { "name": "Bookmarks Manager Plugin" } [1676459775607] INFO (ext): registering Authentication Provider Plugin. plugin: { "name": "Authentication Provider Plugin", "isRegistered": false } [1676459775607] INFO (ext): SQLTools activation completed. 2000.041763 ms [1676459775608] INFO (ext): Formatter Plugin registered! [1676459775608] INFO (ext): CodeLens Plugin registered! [1676459775608] INFO (ext): Dependency Manager Plugin registered! [1676459775608] INFO (ext): Connection Manager Plugin registered! [1676459775608] INFO (ext): History Manager Plugin registered! [1676459775608] INFO (ext): Bookmarks Manager Plugin registered! [1676459775608] INFO (ext): Authentication Provider Plugin registered! [1676459775697] INFO (ext): registering SQLite Plugin (driver). plugin: { "extensionId": "mtxr.sqltools-driver-sqlite", "name": "SQLite Plugin", "type": "driver" } /home/andrea/.vscode/extensions/mtxr.sqltools-0.27.1/dist/languageserver.js:1 ... SyntaxError: Unexpected token '.' at wrapSafe (internal/modules/cjs/loader.js:915:16) at Module._compile (internal/modules/cjs/loader.js:963:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) at internal/main/run_main_module.js:17:47 [Error - 12:16:16 PM] Connection to server got closed. Server will not be restarted.

Expected behavior It was working before an update of VSCode, I don't know if it related to the update.

Desktop:

bennaa commented 1 year ago

I tried to downgrade SQLTools to version 0.26 and before and it works, maybe it's a problem with the latest release

tlil commented 1 year ago

@bennaa what version of Node are you running? I had the same issue on the latest version of the extension, but realised I was running v10'ish of Node on the host I was remoting into. Upgrading Node to v19 fixed the issue. cc @gjsjohnmurray

bennaa commented 1 year ago

I was running the default apt node 12, with the update to node 18 also the latest release of SQLTools works. Thanks!

tlil commented 1 year ago

@bennaa Good to hear!

@gjsjohnmurray Perhaps worth adding a warning/notification if too low a version of Node is detected?

gjsjohnmurray commented 1 year ago

@tlil thanks for helping @bennaa resolve this. SQLite doc update is in progress, and I have opened a separate issue for an enhancement to detect and warn about this situation.