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

couldn't start client language server (Windows) #504

Closed
sugarraysam opened this issue Oct 21, 2020 · 12 comments
Closed

couldn't start client language server (Windows) #504

sugarraysam opened this issue Oct 21, 2020 · 12 comments
Labels
bug Something isn't working

Comments

@sugarraysam
Copy link

I am working from an airgapped environment so having the extension manage the language server is not a possibility. The only thing I can do is pull down go repositories basically.

I installed the latest version of terraform-ls using:

$ go get github.com/hashicorp/terraform-ls
$ terraform-ls --version
0.0.0-dev

The language server starts fine, and is in $GOBIN. ($GOBIN is also in $PATH)

$ echo $GOBIN # c:\Users\<user>\.go\bin
$ cd $GOBIN
$ terraform-ls.exe serve 
# ...
# langserver.go:69: Starting server (pid <pid>) ...

In my project, I initialize stuff with terraform init. And here is my vscode settings:

"terraform.languageServer": {
  "trace.server": "verbose",
  "external": true,
  "pathToBinary": "C:\\Users\\<user>\\.go\\bin\\terraform-ls.exe",
  "args": [
    "server"
  ],
},

And the errors I get are seen in this screenshot:
image

Other information

  • I'm using git bash as my shell in vscode.
  • I'm getting my go pkgs from gocenter.io through artifactory
$ terraform version
Terraform version: v0.13.4
+ provider <hostname>/rancher/rancher2 v1.9.0

$ terraform-ls version
0.0.0-dev
# Even if I try pinning the terraform-ls version, it still outputs `0.0.0-dev`
$ go get github.com/hashicorp/terraform-ls@v0.5.4
$ terraform-ls
0.0.0-dev

Questions
How can I see more verbose output for these errors? I enabled "trace.server": "verbose" but have no idea how to use it.

Thanks for your help!

@aeschright
Copy link
Contributor

Hi @sugarraysam – Sorry you're running into a problem there! You can see the full language server logs by opening the output panel and choosing the one that says "terraform-ls".

If you need to install the language server manually, the best option is to download it from https://releases.hashicorp.com/terraform-ls/
It doesn't need to be in your path as long as you have that pathToBinary setting.

if you want to share the logs from the output panel, we can look into why it might be failing to start.

@BasBerk
Copy link

BasBerk commented Dec 17, 2020 via email

@wirdatrd
Copy link

wirdatrd commented Mar 5, 2021

I'm running into this problem too. Here is the output from the terraform-ls panel:
Launching language server: c:\Users*.vscode\extensions\hashicorp.terraform-2.7.0/lsp/terraform-ls serve for folder: file:///c%3A/Users/*****/projects/
[Error - 8:38:18 AM] Starting client failed
Error: spawn EBUSY
at ChildProcess.spawn (internal/child_process.js:407:11)
at Object.spawn (child_process.js:557:9)
at c:\Users*
.vscode\extensions\hashicorp.terraform-2.7.0\node_modules\vscode-languageclient\lib\node\main.js:383:40

I have tried uninstalling and upgrading/reinstalling the Terraform extension, uninstalling and upgrading/reinstalling VSCode with no joy. I've tried starting VSCode with normal perms as well as with elevated Administrator perms.

@ghost ghost removed the waiting-response label Mar 5, 2021
@aeschright aeschright added the bug Something isn't working label May 3, 2021
@pabloportillo-ti
Copy link

I'm getting the same error :/

Launching language server: c:\Users\user.vscode\extensions\hashicorp.terraform-2.12.1\lsp\terraform-ls serve for folder: file:///c%3A/Users/user/Documents/Terraform/
[Error - 7:50:46 AM] Starting client failed
Error: spawn EBUSY
at ChildProcess.spawn (internal/child_process.js:403:11)
at Object.spawn (child_process.js:562:9)
at c:\Users\user.vscode\extensions\hashicorp.terraform-2.12.1\node_modules\vscode-languageclient\lib\node\main.js:383:40

@chudytom
Copy link

I'm getting the same error

Launching language server: c:\Users\tochu.vscode\extensions\hashicorp.terraform-2.12.1\lsp\terraform-ls serve for folder: file:///
[Error - 11:55:27] Starting client failed
Error: spawn EBUSY
at ChildProcess.spawn (internal/child_process.js:403:11)
at Object.spawn (child_process.js:562:9)
at c:<user>\hashicorp.terraform-2.12.1\node_modules\vscode-languageclient\lib\node\main.js:383:40

@vitskr
Copy link

vitskr commented Jun 23, 2021

I have found workaround for this issue.

In vscode settings file specify path to terraform-ls.exe. Or simply put terraform-ls.exe if it is in your path.

"terraform.languageServer": {        
    "external": true,
    "pathToBinary": "terraform-ls.exe",

@radeksimko
Copy link
Member

#694 (released as part of 2.14.0 recently) fixed a bug where paths with escapable characters (such as spaces, which are common in usernames on Windows) were causing server to fail to start.

With that I'm going to close this issue, but please let us know by opening a new issue if you continue having (any similar or different) issues. The LS installation should work out of the box now on all platforms, without any additional configuration.

@vitskr Can you try removing that settings and confirm that it works now (on >= 2.14.0)?

Thanks.

@Gladskih
Copy link

Gladskih commented Aug 5, 2021

I get "Couldn't start client Terraform LS" so it's not fixed.
hashicorp.terraform v2.14.0
VS Code 1.58.2

P. S. In terrafrorm-ls.exe log I have found: "Editing a single file is not yet supported. Please open a directory."

@radeksimko
Copy link
Member

@Gladskih We are tracking that particular issue under #707 - feel free to subscribe

@TylerHaigh
Copy link

TylerHaigh commented Aug 6, 2021

Hi @radeksimko
Seems to still be occurring. Any tips? Let me know if you need more details to dig further

Launching language server: c:\Users\tyler\.vscode\extensions\hashicorp.terraform-2.14.0\lsp\terraform-ls.exe serve
[Error - 9:11:30 AM] Starting client failed
Error: spawn EBUSY
	at ChildProcess.spawn (internal/child_process.js:403:11)
	at Object.spawn (child_process.js:562:9)
	at c:\Users\tyler\.vscode\extensions\hashicorp.terraform-2.14.0\node_modules\vscode-languageclient\lib\node\main.js:383:40

I'll note that after a VSCode restart, it seems to start fine

@herrmadbeef
Copy link

I just started ti face the issue today
it was working yesterday but something change and I do not know what to do
vscode versionL

Version: 1.59.1 (user setup)
Commit: 3866c3553be8b268c8a7f8c0482c0c0177aa8bfa
Date: 2021-08-19T11:56:46.957Z
Electron: 13.1.7
Chrome: 91.0.4472.124
Node.js: 14.16.0
V8: 9.1.269.36-electron.0
OS: Windows_NT x64 10.0.19043

terraform-ls.exe location:
C:\Users\<uid>\.vscode\extensions\hashicorp.terraform-2.14.0\lsp

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests