Closed myfreax closed 3 years ago
@huangyanxiong01 Are you still getting this bug with version 2.6.0?
Can confirm in the latest version. The output shows this:
[Info - 4:01:21 pm] Default version of Prisma binary 'prisma-fmt': e6c9b4b2b7fa162d0d459d1863321f547498fcfe
[Info - 4:01:21 pm] Extension name @prisma/language-server with version 2.8.0
[Info - 4:01:21 pm] Prisma CLI version: 2.8.0
[Info - 4:01:21 pm] Connection to server got closed. Server will restart.
[Info - 4:01:21 pm] Default version of Prisma binary 'prisma-fmt': e6c9b4b2b7fa162d0d459d1863321f547498fcfe
[Info - 4:01:21 pm] Extension name @prisma/language-server with version 2.8.0
[Info - 4:01:21 pm] Prisma CLI version: 2.8.0
[Info - 4:01:21 pm] Connection to server got closed. Server will restart.
[Info - 4:01:22 pm] Default version of Prisma binary 'prisma-fmt': e6c9b4b2b7fa162d0d459d1863321f547498fcfe
[Info - 4:01:22 pm] Extension name @prisma/language-server with version 2.8.0
[Info - 4:01:22 pm] Prisma CLI version: 2.8.0
[Error - 4:01:22 pm] Connection to server got closed. Server will not be restarted.
Same here. I can confirm with the latest version too.
[Info - 12:38:14 PM] Connection to server got closed. Server will restart.
[Info - 12:38:22 PM] Default version of Prisma binary 'prisma-fmt': e6c9b4b2b7fa162d0d459d1863321f547498fcfe
[Info - 12:38:22 PM] Extension name @prisma/language-server with version 2.8.0
[Info - 12:38:22 PM] Prisma CLI version: 2.8.0
[Info - 12:38:23 PM] Connection to server got closed. Server will restart.
[Info - 12:38:23 PM] Default version of Prisma binary 'prisma-fmt': e6c9b4b2b7fa162d0d459d1863321f547498fcfe
[Info - 12:38:23 PM] Extension name @prisma/language-server with version 2.8.0
[Info - 12:38:23 PM] Prisma CLI version: 2.8.0
[Info - 12:38:23 PM] Connection to server got closed. Server will restart.
[Info - 12:38:23 PM] Default version of Prisma binary 'prisma-fmt': e6c9b4b2b7fa162d0d459d1863321f547498fcfe
[Info - 12:38:23 PM] Extension name @prisma/language-server with version 2.8.0
[Info - 12:38:23 PM] Prisma CLI version: 2.8.0
[Info - 12:38:23 PM] Connection to server got closed. Server will restart.
[Info - 12:38:24 PM] Default version of Prisma binary 'prisma-fmt': e6c9b4b2b7fa162d0d459d1863321f547498fcfe
[Info - 12:38:24 PM] Extension name @prisma/language-server with version 2.8.0
[Info - 12:38:24 PM] Prisma CLI version: 2.8.0
[Error - 12:38:24 PM] Connection to server got closed. Server will not be restarted.
I'm getting the same error with Prisma 2.8.1
and VS Code 1.50.0
.
[Info - 8:10:49 PM] Default version of Prisma binary 'prisma-fmt': 439da16b2f8314c6faca7d2dad2cdcf0732e8a9c
[Info - 8:10:49 PM] Extension name @prisma/language-server with version 2.8.2
[Info - 8:10:49 PM] Prisma CLI version: 2.8.1
[Info - 8:10:49 PM] Connection to server got closed. Server will restart.
[Info - 8:10:49 PM] Default version of Prisma binary 'prisma-fmt': 439da16b2f8314c6faca7d2dad2cdcf0732e8a9c
[Info - 8:10:49 PM] Extension name @prisma/language-server with version 2.8.2
[Info - 8:10:49 PM] Prisma CLI version: 2.8.1
[Info - 8:10:49 PM] Connection to server got closed. Server will restart.
[Info - 8:10:49 PM] Default version of Prisma binary 'prisma-fmt': 439da16b2f8314c6faca7d2dad2cdcf0732e8a9c
[Info - 8:10:49 PM] Extension name @prisma/language-server with version 2.8.2
[Info - 8:10:49 PM] Prisma CLI version: 2.8.1
[Info - 8:10:49 PM] Connection to server got closed. Server will restart.
[Info - 8:10:50 PM] Default version of Prisma binary 'prisma-fmt': 439da16b2f8314c6faca7d2dad2cdcf0732e8a9c
[Info - 8:10:50 PM] Extension name @prisma/language-server with version 2.8.2
[Info - 8:10:50 PM] Prisma CLI version: 2.8.1
[Info - 8:10:50 PM] Connection to server got closed. Server will restart.
[Info - 8:10:50 PM] Default version of Prisma binary 'prisma-fmt': 439da16b2f8314c6faca7d2dad2cdcf0732e8a9c
[Info - 8:10:50 PM] Extension name @prisma/language-server with version 2.8.2
[Info - 8:10:50 PM] Prisma CLI version: 2.8.1
[Error - 8:10:50 PM] Connection to server got closed. Server will not be restarted.
This should be fixed with version 2.8.2 caused by a broken dependency update from 'vsce'.
Is 2.8.2 available? If so, what do I need to upgrade?
The VS Code extension is already on v2.8.2
@skidding Ah sorry then you are using 2.8.2 already. When you open the Log(Extension Host)
in VSCode, can you see any errors after this line:
ExtensionService#_doActivateExtension Prisma.prisma {"startup":false,"extensionId":{"value":"Prisma.prisma","_lower":"prisma.prisma"},"activationEvent":"onLanguage:prisma"}
?
No problem. No, I don't see any errors. The log ends with this (and similar lines from other extensions):
[2020-10-12 15:22:36.424] [exthost] [info] ExtensionService#_doActivateExtension Prisma.prisma {"startup":false,"extensionId":{"value":"Prisma.prisma","_lower":"prisma.prisma"},"activationEvent":"onLanguage:prisma"}
[2020-10-12 15:22:36.424] [exthost] [info] ExtensionService#loadCommonJSModule file:///Users/***/.vscode/extensions/prisma.prisma-2.8.2/dist/src/extension.js
Getting the same error on 2.9.0 under WSL2 (haven't tested on other platforms). Syntax highlighting works but everything else, including autocomplete, does not.
[Info - 6:20:01 PM] Default version of Prisma binary 'prisma-fmt': 369b3694b7edb869fad14827a33ad3f3f49bbc20
[Info - 6:20:01 PM] Extension name @prisma/language-server with version 2.9.0
[Info - 6:20:01 PM] Prisma CLI version: 2.9.0
events.js:200
throw er; // Unhandled 'error' event
^
Error: spawn /home/dev/.vscode-server/extensions/prisma.prisma-2.9.0/node_modules/@prisma/language-server/dist/src/prisma-fmt.369b3694b7edb869fad14827a33ad3f3f49bbc20 EACCES
I get the same as @xddz9 under wsl2
This should be fixed with 2.11.0. Please leave a comment in case you are still getting this error. π
Still crashing for me on WSL2:
[Info - 2:43:30 AM] Default version of Prisma binary 'prisma-fmt': 58369335532e47bdcec77a2f1e7c1fb83a463918
[Info - 2:43:30 AM] Extension name @prisma/language-server with version 2.11.0
[Info - 2:43:30 AM] Prisma CLI version: 2.11.0
events.js:200
throw er; // Unhandled 'error' event
^
Still crashing for me too:
[Info - 12:06:08] Default version of Prisma binary 'prisma-fmt': 58369335532e47bdcec77a2f1e7c1fb83a463918
[Info - 12:06:08] Extension name @prisma/language-server with version 2.11.0
[Info - 12:06:08] Prisma CLI version: 2.11.0
[Info - 12:06:08] Local prisma-fmt path: /home/minhnguyen/.vscode/extensions/prisma.prisma-2.11.0/node_modules/@prisma/language-server/dist/src/prisma-fmt.58369335532e47bdcec77a2f1e7c1fb83a463918
[Info - 12:06:09] Downloading prisma-fmt from https://binaries.prisma.sh/all_commits/58369335532e47bdcec77a2f1e7c1fb83a463918/debian-openssl-1.1.x/prisma-fmt.gz
[Info - 12:06:12] Local prisma-fmt path: /home/minhnguyen/.vscode/extensions/prisma.prisma-2.11.0/node_modules/@prisma/language-server/dist/src/prisma-fmt.58369335532e47bdcec77a2f1e7c1fb83a463918
[Info - 12:06:12] Connection to server got closed. Server will restart.
[Info - 12:06:13] Default version of Prisma binary 'prisma-fmt': 58369335532e47bdcec77a2f1e7c1fb83a463918
[Info - 12:06:14] Extension name @prisma/language-server with version 2.11.0
[Info - 12:06:14] Prisma CLI version: 2.11.0
[Info - 12:06:14] Local prisma-fmt path: /home/minhnguyen/.vscode/extensions/prisma.prisma-2.11.0/node_modules/@prisma/language-server/dist/src/prisma-fmt.58369335532e47bdcec77a2f1e7c1fb83a463918
[Info - 12:06:14] Connection to server got closed. Server will restart.
[Info - 12:06:14] Default version of Prisma binary 'prisma-fmt': 58369335532e47bdcec77a2f1e7c1fb83a463918
[Info - 12:06:14] Extension name @prisma/language-server with version 2.11.0
[Info - 12:06:15] Prisma CLI version: 2.11.0
[Info - 12:06:15] Local prisma-fmt path: /home/minhnguyen/.vscode/extensions/prisma.prisma-2.11.0/node_modules/@prisma/language-server/dist/src/prisma-fmt.58369335532e47bdcec77a2f1e7c1fb83a463918
[Info - 12:06:15] Connection to server got closed. Server will restart.
[Info - 12:06:15] Default version of Prisma binary 'prisma-fmt': 58369335532e47bdcec77a2f1e7c1fb83a463918
[Info - 12:06:15] Extension name @prisma/language-server with version 2.11.0
[Info - 12:06:15] Prisma CLI version: 2.11.0
[Info - 12:06:15] Local prisma-fmt path: /home/minhnguyen/.vscode/extensions/prisma.prisma-2.11.0/node_modules/@prisma/language-server/dist/src/prisma-fmt.58369335532e47bdcec77a2f1e7c1fb83a463918
[Info - 12:06:15] Connection to server got closed. Server will restart.
[Info - 12:06:15] Default version of Prisma binary 'prisma-fmt': 58369335532e47bdcec77a2f1e7c1fb83a463918
[Info - 12:06:15] Extension name @prisma/language-server with version 2.11.0
[Info - 12:06:15] Prisma CLI version: 2.11.0
[Info - 12:06:16] Local prisma-fmt path: /home/minhnguyen/.vscode/extensions/prisma.prisma-2.11.0/node_modules/@prisma/language-server/dist/src/prisma-fmt.58369335532e47bdcec77a2f1e7c1fb83a463918
[Error - 12:06:16] Connection to server got closed. Server will not be restarted.
@NMinhNguyen are you using WSL2 as well?
@NMinhNguyen are you using WSL2 as well?
Ubuntu 18.04.
thanks, I'll try to get a reproduction.
thanks, I'll try to get a reproduction.
Let me know if I can get you some more detailed logs or whatever, I'm happy to help you debug this!
Hi @NMinhNguyen, we recently added a trace setting for the language server. Can you please use the Insider Prisma extension (from 12.0.47), set prisma.trace.server
to verbose
and send me your logs again? (they should now provide more helpful information to get to the bottom of this bug).
According to https://marketplace.visualstudio.com/items?itemName=Prisma.prisma-insider (and my VS Code), the latest version is still 12.0.46, do you want me to wait a little before 12.0.47 is published?
ah yes, the publishing process takes a bit, it will probably take about 10 more minutes. I'll post again once it's available :)
12.0.47 is available now.
I had to remove the contents of prisma.schema
from the logs, but let me know if you need it and I'll try to provide it in full.
Thank you!
It seems like the server fails after trying to download the prisma-fmt
binary, since there should have been a log saying it got installed successfully. I'm looking into it.
If it helps, I'm doing this at work where for external internet stuff we need to use proxies. Maybe the code that's trying to download prisma-fmt
isn't taking into account environment variables like HTTP_PROXY
? VS Code also lets you set a proxy in settings (where it also inherits from http_proxy
and https_proxy
if not set):
Ah yes that helps.
Let's try one more thing to double check: Can you please download and uncompress the archive file from here: https://binaries.prisma.sh/all_commits/a4ef806349a7b17c41f45735ce4a36322e01c250/debian-openssl-1.1.x/prisma-fmt.gz.
You can then set the path in prisma.prismaFmtBinPath
and restart the Prisma Language Server. If the error does not occur again, then the downloading is the problem.
I still can not reproduce this unfortunately. I did add some more logs to the Insider extension though.
Also can you please check if everything works when downloading the binary and moving it to the extension folder here: $HOME/.vscode/extensions/prisma.prisma-insider-12.0.53/node_modules/@prisma/language-server/dist/src/
Hm, for some reason the OS warns me about there being a folder named prisma-fmt
and me copying a file called prisma-fmt
would overwrite the folder. Should I proceed with overwriting it?
This is what happens when overwriting:
Ah, no the folder should not be overwritten, the file should be in the folder src
, where there is also a folder called prisma-fmt
. Better rename the file to prisma-fmt.a4ef806349a7b17c41f45735ce4a36322e01c250
.
Ah so I actually already had a file with the exact same name. Here's the latest logs (I've unset prismaBinPath
as well):
So that means the downloading was not the problem, if you do have the file there. Which also means we're back to the beginning without an idea what's causing the issue unfortunately..
Is there any other way I can help you debug this? Is there some additional logging we can add to find out what leads to it closing the server connection?
Thank you so much for your time and help by the way!
I'm trying to think about where it could crash, let's check if the crash is related to the schema file. So can you try this schema:
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
model User {
hi Int @id
test String
hdi Test @relation(fields: [testId], references: [id])
testId Int
}
model Test {
id Int @id
User User[]
}
Thank you for trying out lots of things as well!
Have you always experienced this or was there an earlier version where this did not occur?
Have you always experienced this or was there an earlier version where this did not occur?
I only started using at work about 2 months ago? But I think I've always had issues with it at work. Works fine on my personal Mac.
I'm trying to think about where it could crash, let's check if the crash is related to the schema file. So can you try this schema:
datasource db { provider = "mysql" url = env("DATABASE_URL") } generator client { provider = "prisma-client-js" } model User { hi Int @id test String hdi Test @relation(fields: [testId], references: [id]) testId Int } model Test { id Int @id User User[] }
Thank you for trying out lots of things as well!
Happened with this schema as well. Using a newly started VS Code.
Happened with this schema as well. Using a newly started VS Code.
Same here. Perhaps this will help though: I have no problems at all editing a schema.prisma file on Windows, it only crashes when using WSL. @carmenberndt Can you replicate this environment perhaps? Windows 10, WSL2 (Ubuntu), and VSCode connected to WSL with the prisma language server running on WSL instead of on Windows.
I tried to reproduce this using WSL 2, with the extension only installed on WSL: Ubuntu-20.04 and VSCode connected to WSL. I unfortunately could not reproduce the issue this way.
try to delete $HOME/.vscode/extensions/prisma.prisma-${version}/ and reinstall prisma extension
@ueclick that's what I did before trying to reproduce this.
I tried to reproduce this using WSL 2, with the extension only installed on WSL: Ubuntu-20.04 and VSCode connected to WSL. I unfortunately could not reproduce the issue this way.
Is there any way I can help you with this?
If you can find exact steps (aka a reproduction) that will lead to this issue every time you follow those, this will help a lot. π
I also asked @martzoukos to reproduce this on WSL, but he could not reproduce this either. (Using https://github.com/prisma/prisma-examples/tree/latest/javascript/rest-nextjs and 2.11.1)
If you can find exact steps (aka a reproduction) that will lead to this issue every time you follow those, this will help a lot. π
I also asked @martzoukos to reproduce this on WSL, but he could not reproduce this either. (Using https://github.com/prisma/prisma-examples/tree/latest/javascript/rest-nextjs and 2.11.1)
Would you be willing to do like a screenshare session on Zoom or something?
Hey @NMinhNguyen , that sounds like a good idea. Would you be available for a quick Zoom call in 10 minutes?
Hey @NMinhNguyen , that sounds like a good idea. Would you be available for a quick Zoom call in 10 minutes?
Unfortunately not today as I'm in training but how about any time tomorrow?
@NMinhNguyen can you please ping me at berndt@prisma.io
so I can set up a meeting for tomorrow?
This issue should be fixed with #640. If you still experience problems when using a Proxy, please comment below, otherwise please create a new issue.