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

Volar crashes quickly using VS Code remote containers on Docker #514

Closed
ddahan opened this issue Sep 21, 2021 · 38 comments
Closed

Volar crashes quickly using VS Code remote containers on Docker #514

ddahan opened this issue Sep 21, 2021 · 38 comments

Comments

@ddahan
Copy link

ddahan commented Sep 21, 2021

Description

I'm using Volar extension is a TS/Vue project, in a devcontainer on VS Code.
When building the container, everything works as expected, but at some point in the time (I can't determine when exactly), the volar extension crashes. This means the extension does not work as expected and I keep getting lots of error for anything.

Here is part of the content of the logs in vs code:

Volar - Document

[Info  - 10:39:57 AM] Connection to server got closed. Server will restart.
[Error - 10:39:57 AM] Request textDocument/documentLink failed.
Error: Connection got disposed.
	at Object.dispose (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-jsonrpc/lib/common/connection.js:1072:27)
	at Object.dispose (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-languageclient/lib/common/client.js:73:35)
	at LanguageClient.handleConnectionClosed (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-languageclient/lib/common/client.js:2492:42)
	at LanguageClient.handleConnectionClosed (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-languageclient/lib/node/main.js:159:15)
	at closeHandler (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-languageclient/lib/common/client.js:2479:18)
	at CallbackList.invoke (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-jsonrpc/lib/common/events.js:55:39)
	at Emitter.fire (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-jsonrpc/lib/common/events.js:117:36)
	at closeHandler (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-jsonrpc/lib/common/connection.js:260:26)
	at CallbackList.invoke (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-jsonrpc/lib/common/events.js:55:39)
	at Emitter.fire (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-jsonrpc/lib/common/events.js:117:36)
	at IPCMessageReader.fireClose (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-jsonrpc/lib/common/messageReader.js:40:27)
	at ChildProcess.<anonymous> (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-jsonrpc/lib/node/main.js:33:45)
	at ChildProcess.emit (events.js:327:22)
	at maybeClose (internal/child_process.js:1048:16)
	at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
(node:1195) UnhandledPromiseRejectionWarning: Error: Unhandled method vue/docVersion
    at handleResponse (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-jsonrpc/lib/common/connection.js:498:48)
    at processMessageQueue (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-jsonrpc/lib/common/connection.js:296:17)
    at Immediate.<anonymous> (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-jsonrpc/lib/common/connection.js:280:13)
    at processImmediate (internal/timers.js:461:21)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1195) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)

Volar - API

[Error - 10:44:53 AM] Connection to server is erroring. Shutting down server.
[Error - 10:44:53 AM] Connection to server is erroring. Shutting down server.
[Error - 10:44:53 AM] Connection to server is erroring. Shutting down server.
[Error - 10:44:53 AM] Connection to server is erroring. Shutting down server.
[Error - 10:44:53 AM] Connection to server is erroring. Shutting down server.
[Error - 10:44:53 AM] Connection to server got closed. Server will not be restarted.
[Error - 10:44:53 AM] Request textDocument/codeAction failed.
Error: Connection got disposed.
	at Object.dispose (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-jsonrpc/lib/common/connection.js:1072:27)
	at Object.dispose (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-languageclient/lib/common/client.js:73:35)
	at LanguageClient.handleConnectionClosed (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-languageclient/lib/common/client.js:2492:42)
	at LanguageClient.handleConnectionClosed (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-languageclient/lib/node/main.js:159:15)
	at closeHandler (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-languageclient/lib/common/client.js:2479:18)
	at CallbackList.invoke (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-jsonrpc/lib/common/events.js:55:39)
	at Emitter.fire (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-jsonrpc/lib/common/events.js:117:36)
	at closeHandler (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-jsonrpc/lib/common/connection.js:260:26)
	at CallbackList.invoke (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-jsonrpc/lib/common/events.js:55:39)
	at Emitter.fire (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-jsonrpc/lib/common/events.js:117:36)
	at IPCMessageReader.fireClose (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-jsonrpc/lib/common/messageReader.js:40:27)
	at ChildProcess.<anonymous> (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-jsonrpc/lib/node/main.js:33:45)
	at ChildProcess.emit (events.js:327:22)
	at maybeClose (internal/child_process.js:1048:16)
	at Socket.<anonymous> (internal/child_process.js:439:11)
	at Socket.emit (events.js:315:20)
	at Pipe.<anonymous> (net.js:673:12)
[Error - 10:44:53 AM] Request textDocument/completion failed.
Error: Connection got disposed.
	at Object.dispose (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-jsonrpc/lib/common/connection.js:1072:27)
	at Object.dispose (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-languageclient/lib/common/client.js:73:35)
	at LanguageClient.handleConnectionClosed (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-languageclient/lib/common/client.js:2492:42)
	at LanguageClient.handleConnectionClosed (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-languageclient/lib/node/main.js:159:15)
	at closeHandler (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-languageclient/lib/common/client.js:2479:18)
	at CallbackList.invoke (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-jsonrpc/lib/common/events.js:55:39)
	at Emitter.fire (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-jsonrpc/lib/common/events.js:117:36)
	at closeHandler (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-jsonrpc/lib/common/connection.js:260:26)
	at CallbackList.invoke (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-jsonrpc/lib/common/events.js:55:39)
	at Emitter.fire (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-jsonrpc/lib/common/events.js:117:36)
	at IPCMessageReader.fireClose (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-jsonrpc/lib/common/messageReader.js:40:27)
	at ChildProcess.<anonymous> (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.23/node_modules/vscode-jsonrpc/lib/node/main.js:33:45)
	at ChildProcess.emit (events.js:327:22)
	at maybeClose (internal/child_process.js:1048:16)
	at Socket.<anonymous> (internal/child_process.js:439:11)
	at Socket.emit (events.js:315:20)
	at Pipe.<anonymous> (net.js:673:12)
[Error - 10:44:53 AM] Stopping server failed

Bug Reproduction:

To be honest, I don't know how to reproduce it, it seems unpredictable. The only things I'm sure is that it does occur after some time, because at the beginning everything is fine.

Versions:

  • volar: v0.27.23
  • node: v16.9.1
  • npm: 7.21.1
  • VS Code: 1.60.1
  • vue-next: 3.1.12
  • vite: 2.5.10
  • typescript: 4.4.2
  • docker: 4.0.1
@2256184693
Copy link

I have similar Problem !!!

Logs in Volar - API

[Error - 4:27:43 PM] Request textDocument/codeAction failed.
  Message: Request textDocument/codeAction failed with message: Cannot read property 'lastIndexOf' of undefined
  Code: -32603 
[Error - 4:27:43 PM] Request textDocument/codeAction failed.
  Message: Request textDocument/codeAction failed with message: Cannot read property 'lastIndexOf' of undefined
  Code: -32603

@2256184693
Copy link

Error on VsCode@1.60.1

But no error on VsCode@1.59.1

@ddahan
Copy link
Author

ddahan commented Sep 22, 2021

Error on VsCode@1.60.1

But no error on VsCode@1.59.1

Thanks for this, I was sure the bug happened after some update, but didn't know which piece of software.

EDIT: I still have crashes after using VS Code 1.59.1

@johnsoncodehk
Copy link
Member

I think @2256184693 has different problem.

@ddahan can you reproduce this problem without docker?

@2256184693
Copy link

My error is because of my own wrong in tsconfig.json. sorry

@776A0A
Copy link

776A0A commented Sep 24, 2021

My error is because of my own wrong in tsconfig.json. sorry

@2256184693 how did you solve it?

@ddahan
Copy link
Author

ddahan commented Oct 5, 2021

I think @2256184693 has different problem.

@ddahan can you reproduce this problem without docker?

Unfortunately I can't try without Docker. This is very annoying because as soon as it crashed, everything is broken and the only workaround is to restart Docker, close and reopen the project in VS Code.
I'm surprised there is no other people complaning about this bug, because my setup seems to be pretty standard, I can't think of something particular I would have made to get this issue.

@johnsoncodehk
Copy link
Member

I think this problem is specific to docker, and almost no people use volar in docker. :S

@ddahan
Copy link
Author

ddahan commented Oct 5, 2021

almost no people use volar in docker. :S

To be more specific, I'm using VS Code dev containers: https://code.visualstudio.com/docs/remote/containers
From what I see, more and more people are using and enjoying this feature as it allows people sandboxing their dev environements.

I think this problem is specific to docker

It could, but there no evidence here :/
I use Docker and dev containers for all my projects and have 0 issue with any extension.
And I used to use Volar on another project with Docker, without any issue too. It suddently happened on all my projects.
That makes me think there is something wrong with a new version of something (which could be Docker, or not).
Or as stated by 2256184693, it could be related to the tsconfig.

But since the crash happens after some time, this is very hard to debug by testing all versions of everything.
Anyway, I understand it's almost impossible for you to debug it, if I can not reproduce it. Let's hope someone else has the same problem and understand better than me what's happening here.

EDIT

I do not need to restart Docker to make it work again, just closing the connection to remote server in vs code.

@johnsoncodehk
Copy link
Member

How long does crashes happen usually?
Are you doing specific operations, or action on specific files when crashes?

@ddahan
Copy link
Author

ddahan commented Oct 5, 2021

How long does crashes happen usually? Are you doing specific operations, or action on specific files when crashes?

Not always the same, but the crashes after a Volar action indeed. If i Do nothing it won't crash.
For example, last time, after 5 to 10 mn, it was on hovering an object in vs code to know its type. Then:

[Info  - 10:22:00 AM] Connection to server got closed. Server will restart.
[Error - 10:22:00 AM] Request textDocument/codeAction failed.
Error: Connection got disposed.
	at Object.dispose (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.28/node_modules/vscode-jsonrpc/lib/common/connection.js:1072:27)
	at Object.dispose (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.28/node_modules/vscode-languageclient/lib/common/client.js:73:35)
	at LanguageClient.handleConnectionClosed (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.28/node_modules/vscode-languageclient/lib/common/client.js:2492:42)
	at LanguageClient.handleConnectionClosed (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.28/node_modules/vscode-languageclient/lib/node/main.js:159:15)
	at closeHandler (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.28/node_modules/vscode-languageclient/lib/common/client.js:2479:18)
	at CallbackList.invoke (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.28/node_modules/vscode-jsonrpc/lib/common/events.js:55:39)
	at Emitter.fire (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.28/node_modules/vscode-jsonrpc/lib/common/events.js:117:36)
	at closeHandler (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.28/node_modules/vscode-jsonrpc/lib/common/connection.js:260:26)
	at CallbackList.invoke (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.28/node_modules/vscode-jsonrpc/lib/common/events.js:55:39)
	at Emitter.fire (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.28/node_modules/vscode-jsonrpc/lib/common/events.js:117:36)
	at IPCMessageReader.fireClose (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.28/node_modules/vscode-jsonrpc/lib/common/messageReader.js:40:27)
	at ChildProcess.<anonymous> (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.28/node_modules/vscode-jsonrpc/lib/node/main.js:33:45)
	at ChildProcess.emit (events.js:327:22)
	at maybeClose (internal/child_process.js:1048:16)
	at Socket.<anonymous> (internal/child_process.js:439:11)
	at Socket.emit (events.js:315:20)
	at Pipe.<anonymous> (net.js:673:12)
[Error - 10:22:00 AM] Request textDocument/hover failed.
Error: Connection got disposed.
	at Object.dispose (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.28/node_modules/vscode-jsonrpc/lib/common/connection.js:1072:27)
	at Object.dispose (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.28/node_modules/vscode-languageclient/lib/common/client.js:73:35)
	at LanguageClient.handleConnectionClosed (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.28/node_modules/vscode-languageclient/lib/common/client.js:2492:42)
	at LanguageClient.handleConnectionClosed (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.28/node_modules/vscode-languageclient/lib/node/main.js:159:15)
	at closeHandler (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.28/node_modules/vscode-languageclient/lib/common/client.js:2479:18)
	at CallbackList.invoke (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.28/node_modules/vscode-jsonrpc/lib/common/events.js:55:39)
	at Emitter.fire (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.28/node_modules/vscode-jsonrpc/lib/common/events.js:117:36)
	at closeHandler (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.28/node_modules/vscode-jsonrpc/lib/common/connection.js:260:26)
	at CallbackList.invoke (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.28/node_modules/vscode-jsonrpc/lib/common/events.js:55:39)
	at Emitter.fire (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.28/node_modules/vscode-jsonrpc/lib/common/events.js:117:36)
	at IPCMessageReader.fireClose (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.28/node_modules/vscode-jsonrpc/lib/common/messageReader.js:40:27)
	at ChildProcess.<anonymous> (/root/.vscode-server/extensions/johnsoncodehk.volar-0.27.28/node_modules/vscode-jsonrpc/lib/node/main.js:33:45)
	at ChildProcess.emit (events.js:327:22)
	at maybeClose (internal/child_process.js:1048:16)
	at Socket.<anonymous> (internal/child_process.js:439:11)
	at Socket.emit (events.js:315:20)
	at Pipe.<anonymous> (net.js:673:12)

And after this, I need to disconect/reconnect vs code remote connection to stop the error flow.

@ovidiuc
Copy link

ovidiuc commented Oct 12, 2021

@ddahan From where are you getting these logs? I have similar behavior.

I think this problem is specific to docker, and almost no people use volar in docker. :S

I'm also in docker with dev containers and I think it's a pretty common setup these days.

The behavior I'm getting is 100% cpu usage until the container becomes unresponsive and all I can do is restart vscode. It happens either on certain intellisense lookups (maybe failed lookups, where it can't find the types) or when I'm trying to save a file. Especially on the file save action.

@ddahan
Copy link
Author

ddahan commented Oct 12, 2021

@ddahan From where are you getting these logs? I have similar behavior.

You can get the logs in the OUTPUT tab in the bottom panel. On the right you can select the type of output. As soon as Volar raises an Error, a new (several actually) Volar options will be available (not before) :

Screenshot 2021-10-12 at 22 03 57

The behavior I'm getting is 100% cpu usage until the container becomes unresponsive and all I can do is restart vscode.

Thanks, I had the same suspicion, because Volar errors seem to appear at the same moment that my container is unstable and slow.

@ovidiuc
Copy link

ovidiuc commented Oct 12, 2021

@ddahan Thanks. That is where I was looking for the logs, but couldn't find anything similar to yours. The only thing that points me to volar is a popup is lower right corner from VSCode saying it's waiting for Volar. I'll keep an eye on it.

@ddahan
Copy link
Author

ddahan commented Oct 12, 2021

@ddahan Thanks. That is where I was looking for the logs, but couldn't find anything similar to yours. The only thing that points me to volar is a popup is lower right corner from VSCode saying it's waiting for Volar. I'll keep an eye on it.

I think your message is that Volar is waiting, so it's not crashing. And as long as you have no crash, there is no Volar section in the right menu, makes sense.

@ovidiuc
Copy link

ovidiuc commented Oct 13, 2021

It crashes eventually:

[Info  - 3:03:11 PM] Connection to server got closed. Server will restart.
(node:29355) UnhandledPromiseRejectionWarning: Error: Unhandled method vue/docVersion
    at handleResponse (/root/.vscode-server/extensions/johnsoncodehk.volar-0.28.3/node_modules/vscode-jsonrpc/lib/common/connection.js:498:48)
    at processMessageQueue (/root/.vscode-server/extensions/johnsoncodehk.volar-0.28.3/node_modules/vscode-jsonrpc/lib/common/connection.js:296:17)
    at Immediate.<anonymous> (/root/.vscode-server/extensions/johnsoncodehk.volar-0.28.3/node_modules/vscode-jsonrpc/lib/common/connection.js:280:13)
    at processImmediate (internal/timers.js:461:21)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:29355) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:29355) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:29355) UnhandledPromiseRejectionWarning: Error: Unhandled method vue/docVersion
    at handleResponse (/root/.vscode-server/extensions/johnsoncodehk.volar-0.28.3/node_modules/vscode-jsonrpc/lib/common/connection.js:498:48)
    at processMessageQueue (/root/.vscode-server/extensions/johnsoncodehk.volar-0.28.3/node_modules/vscode-jsonrpc/lib/common/connection.js:296:17)
    at Immediate.<anonymous> (/root/.vscode-server/extensions/johnsoncodehk.volar-0.28.3/node_modules/vscode-jsonrpc/lib/common/connection.js:280:13)
    at processImmediate (internal/timers.js:461:21)
(node:29355) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:29355) UnhandledPromiseRejectionWarning: Error: Unhandled method vue/docVersion
    at handleResponse (/root/.vscode-server/extensions/johnsoncodehk.volar-0.28.3/node_modules/vscode-jsonrpc/lib/common/connection.js:498:48)
    at processMessageQueue (/root/.vscode-server/extensions/johnsoncodehk.volar-0.28.3/node_modules/vscode-jsonrpc/lib/common/connection.js:296:17)
    at Immediate.<anonymous> (/root/.vscode-server/extensions/johnsoncodehk.volar-0.28.3/node_modules/vscode-jsonrpc/lib/common/connection.js:280:13)
    at processImmediate (internal/timers.js:461:21)

Sometimes I get a similar thing from Eslint as well:

Error: Connection got disposed.
	at Object.dispose (/root/.vscode-server/extensions/dbaeumer.vscode-eslint-2.2.1/client/out/extension.js:1:58683)
	at Object.dispose (/root/.vscode-server/extensions/dbaeumer.vscode-eslint-2.2.1/client/out/extension.js:1:141361)
	at R.handleConnectionClosed (/root/.vscode-server/extensions/dbaeumer.vscode-eslint-2.2.1/client/out/extension.js:1:141549)
	at R.handleConnectionClosed (/root/.vscode-server/extensions/dbaeumer.vscode-eslint-2.2.1/client/out/extension.js:1:215164)
	at t (/root/.vscode-server/extensions/dbaeumer.vscode-eslint-2.2.1/client/out/extension.js:1:139747)
	at r.invoke (/root/.vscode-server/extensions/dbaeumer.vscode-eslint-2.2.1/client/out/extension.js:1:60307)
	at o.fire (/root/.vscode-server/extensions/dbaeumer.vscode-eslint-2.2.1/client/out/extension.js:1:61068)
	at Q (/root/.vscode-server/extensions/dbaeumer.vscode-eslint-2.2.1/client/out/extension.js:1:47239)
	at r.invoke (/root/.vscode-server/extensions/dbaeumer.vscode-eslint-2.2.1/client/out/extension.js:1:60307)
	at o.fire (/root/.vscode-server/extensions/dbaeumer.vscode-eslint-2.2.1/client/out/extension.js:1:61068)
	at d.fireClose (/root/.vscode-server/extensions/dbaeumer.vscode-eslint-2.2.1/client/out/extension.js:1:68954)
	at ChildProcess.<anonymous> (/root/.vscode-server/extensions/dbaeumer.vscode-eslint-2.2.1/client/out/extension.js:1:79928)
	at ChildProcess.emit (events.js:327:22)
	at maybeClose (internal/child_process.js:1048:16)
	at Socket.<anonymous> (internal/child_process.js:439:11)
	at Socket.emit (events.js:315:20)
	at Pipe.<anonymous> (net.js:673:12)
[Error - 3:08:39 PM] Stopping server failed

Maybe there's a conflict between the two.

@johnsoncodehk
Copy link
Member

I think you can open a issue to https://github.com/microsoft/vscode-remote-release/issues, should have more chance of getting some enlightenment.

@ovidiuc
Copy link

ovidiuc commented Oct 21, 2021

I think I've sorted the issue on my side. I have 2 days without crashes so far, and it used to happen multiple times during the day.
The problem was lack of memory for the ts checker. And probably WSL.

  1. I had WSL capped at 6 GB, I've increased it to 12 GB (.wslconfig file).
  2. I've increased the memory for ts checker, fork-ts-checker-webpack-plugin (got help on Quasar's Discord channel):
tsCheckerConfig: {
    eslint: {
        enabled: true,
        files: './src/**/*.{ts,tsx,js,jsx,vue}',
        memoryLimit: 8192 // previously 4096
    },
    typescript: {
        memoryLimit: 8192 // previously the default, 2048
    }
}

The memoryLimit config param is the one passed to node as max-old-space-size:
/usr/local/bin/node --max-old-space-size=8192 /your-project/node_modules/fork-ts-checker-webpack-plugin/lib/typescript-reporter/reporter/TypeScriptReporterRpcService.js

Because I have 2 VSCode instanced attached to containers all the time and a couple of servers running, the memory usage on WSL when doing nothing is around 4.2 GB (free -mh). Which left little memory for when ts checker needed to scan the code.

@ddahan See if increasing these values fixes it for you as well. I think each Vscode instance takes about 1.5 GB.

@ddahan
Copy link
Author

ddahan commented Oct 21, 2021

@ovidiuc Thanks for sharing your solution!
I'm not using Webpack but Vite, I'll try to see if I can do something with Vite.
I'm not sure about what is WSL and where should I find this file thought.

I know it can be a convenient workaround, but I'm not huge fan of raising memory limits of everything just to fix a little piece of my workflow that crashes. Because it's not supposed to crash even if there is not enough memory.

My current solution is to use Vetur instead of Volar, and deactivate experimental template interpolation (that does not work very well, unlike Volar). I'm losing features, but I have 0 crash, without config twistings.

@johnsoncodehk
Copy link
Member

If memory usage is the problem, you can setting "volar.lowPowerMode": true, it will reduce a half memory usage.

@ovidiuc
Copy link

ovidiuc commented Oct 21, 2021

@ddahan WSL is Windows Subsystem for Linux. If you don't have it, no configuration needed. Glad you've found a "solution". But yeah, I agree with you, it should not crash.

@johnsoncodehk Thanks, the setting didn't have much effect. Maybe the problem is not that Volar is using too much memory, but that when the system runs out of memory, Volar doesn't know what to do. Or node, or docker, or eslint. Have no idea which is to blame here, have no experience in extension building. Too many variables and when the container becomes unresponsive, you have no way to run commands on it and see what's going on.

@johnsoncodehk
Copy link
Member

johnsoncodehk commented Oct 23, 2021

@ddahan, @ovidiuc since the problem is memory, is your project a monorepo?

@ddahan and you can also track #577, it just like Vetur with disabled experimental template interpolation, and memory usage should be less.

@ddahan
Copy link
Author

ddahan commented Nov 5, 2021

Hi guys, I'm almost sure the problem is solved now 👍🏻

As you may know, there are two main ways to open a remote dev container in VS code:

  1. Open folder in container -> this uses an existing local folder which is copied to a remote docker container, then synchronised.
  2. Clone Repository in container volume -> this creates no folder in local filesystem, only a folder on the remote container itself, using github repository as the source.

I was using the first solution, and recently noticed that all performances issues were related to this mode, because of obvious I/O throttling, due to the need to permanently synchronise the local and remote folders together.
Using the second mode, everything is faster (looks like local performance), and for now I have no crash with Volar :) :)

More on remote container performance improvement here.

@ddahan ddahan changed the title Volar crashes after some time Volar crashes quickly using VS Code remote containers on Docker Nov 5, 2021
@johnsoncodehk
Copy link
Member

@ddahan good to know! But this does not seem to explain why vetur works but volar does not. 🤔

@ddahan
Copy link
Author

ddahan commented Nov 6, 2021

For me, everything "worked" except Volar. But when I mean "work", I mean "does not crash". I had other extensions which froze, but no crash.
But we now know that it is related to an intensive I/O context or memory usage.
In this tough performance contexte, other extensions seem to have a normal behaviour like freezing, using the swap, and quietly waiting for things become normal again.

Maybe you could stress test Volar to try to reproduce the issue and investigate further, even I'm not sure this is priority.

@smolinari
Copy link

@ovidiuc - Your suggested fix worked for me too. (for Quasar). Thanks!

Scott

@StanzillaManticore
Copy link

[Info  - 11:27:20 PM] Connection to server got closed. Server will restart.
load volar.config.js failed in /home/stan/projects/personal/WeakAurasCompanion
/home/stan/.vscode-server/extensions/johnsoncodehk.volar-0.33.10/dist/node/server.js:2115
                responsePromise.reject(new messages_1.ResponseError(error2.code, error2.message, error2.data));
                                       ^

ResponseError: Unhandled method vue/docVersion
    at handleResponse (/home/stan/.vscode-server/extensions/johnsoncodehk.volar-0.33.10/dist/node/server.js:2115:40)
    at processMessageQueue (/home/stan/.vscode-server/extensions/johnsoncodehk.volar-0.33.10/dist/node/server.js:1940:13)
    at Immediate.<anonymous> (/home/stan/.vscode-server/extensions/johnsoncodehk.volar-0.33.10/dist/node/server.js:1926:11)
    at processImmediate (node:internal/timers:464:21) {
  code: -32601,
  data: undefined
}

@SomeoneIsWorking
Copy link

I get this error on the project I'm working on without Docker or anything remote

@vpiskunov
Copy link

We are experiencing the same error without Docker - but while using Live Share instead (to collaborate together for pair coding sessions). Any ideas or pointers at least at what we should look?

We are all on MacOS and without any docker instances. The repo is indeed a monorepo, but a very small one (recently created with only handful of components shared across 2 apps).

Really appreciate any help or ideas!

@abulka
Copy link

abulka commented May 15, 2022

I'm also getting this Unhandled method vue/docVersion error - no docker, no remote stuff - simple vue3 project with vite. Results in the volar extension turning itself off.

Q1 [Error]: Unhandled method vue/docVersion
    at ee (/Users/andy/.vscode/extensions/vue.volar-0.34.14-darwin-arm64/dist/node/server.js:4:241)
    at H (/Users/andy/.vscode/extensions/vue.volar-0.34.14-darwin-arm64/dist/node/server.js:3:6734)
    at Immediate.<anonymous> (/Users/andy/.vscode/extensions/vue.volar-0.34.14-darwin-arm64/dist/node/server.js:3:6577)
    at processImmediate (node:internal/timers:464:21) {
  code: -32601,
  data: undefined
}
[Info  - 9:56:44 AM] Connection to server got closed. Server will restart.
/Users/andy/.vscode/extensions/vue.volar-0.34.14-darwin-arm64/dist/node/server.js:4
${JSON.stringify(ae.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.")

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

Request textDocument/documentLink failed.

Request completionItem/resolve failed.

@yoyo837
Copy link

yoyo837 commented May 21, 2022

Same here.

@horanchikk
Copy link

same problem on code-server v.4.5.1 (vscode 1.68.1)

X1 [Error]: Unhandled method vue/docVersion
    at te (/home/horanchikk/.local/share/code-server/extensions/lukashass.volar-0.34.13/dist/node/server.js:4:241)
    at se (/home/horanchikk/.local/share/code-server/extensions/lukashass.volar-0.34.13/dist/node/server.js:3:6735)
    at Immediate.<anonymous> (/home/horanchikk/.local/share/code-server/extensions/lukashass.volar-0.34.13/dist/node/server.js:3:6576)
    at processImmediate (node:internal/timers:466:21) {
  code: -32601,
  data: undefined
}

vue3 + vite
the error is caused by changing name of components

@samwillis
Copy link

I have been seeing this, its just running out of memory, see this screenshot each "sawtooth" is Volar crashing:

image

Doubling the available memory seems to fix it:

image

@johnsoncodehk
Copy link
Member

@samwillis thanks for the information! Could you try v1.0.0-beta.0 and check does it reduces memory usage?

@samwillis
Copy link

samwillis commented Sep 25, 2022

@johnsoncodehk I have given that a go. For anyone else testing you have to follow these instructions to install in the remote VM/Container: https://github.com/microsoft/vscode-jupyter/wiki/How-to-install-from-VSIX-on-VS-Code-when-using-Remote-SSH

Unfortunately not seeing any reduction in memory usage, the drop and then ramp up in the graph is when I installed and reloaded:

image

I have killed it and restarted a couple of time to check.

@johnsoncodehk
Copy link
Member

@samwillis I found that template codegen may take a lot of memory usage, could you try setting vueCompilerOptions.skipTemplateCodegen: true in tsconfig and see if it reduces memory usage?

@jaulz
Copy link

jaulz commented Apr 22, 2023

@johnsoncodehk I fought with performance issues for a long time and finally found this thread and especially your response. Before, I could not even really work because it was sooo slow but it seems that this was they key 😊 Does it come with any downsides? I noticed that I cannot click anything within the templates so I assume it's related to that?

@johnsoncodehk
Copy link
Member

Do you mean enabling skipTemplateCodegen solves your project's slow performance? Anyway please open a new issue to avoid discussion on unrelated issues.

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

No branches or pull requests