Vscode-terraform: couldn't start client language server (Windows)

Created on 21 Oct 2020  Â·  4Comments  Â·  Source: hashicorp/vscode-terraform

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/[email protected]
$ 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!

bug

Most helpful comment

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.0node_modules\vscode-languageclient\libnode\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.

All 4 comments

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.

The last update seems to make it much more stable.

If it stays like this I shall retract review and give it 5 stars.

Cheers

On Wed, 16 Dec 2020 at 20:33, Audrey Eschright notifications@github.com
wrote:

Hi @sugarraysam https://github.com/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.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/hashicorp/vscode-terraform/issues/504#issuecomment-746888264,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AORZKG465NEGCUM6I4S66YLSVEDQ7ANCNFSM4SZ5R3IQ
.

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.0node_modules\vscode-languageclient\libnode\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.

I'm getting the same error :/

Launching language server: c:\Users\user.vscode\extensions\hashicorp.terraform-2.12.1\lspterraform-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.1node_modules\vscode-languageclient\libnode\main.js:383:40

Was this page helpful?
0 / 5 - 0 ratings

Related issues

okgolove picture okgolove  Â·  4Comments

kagarlickij picture kagarlickij  Â·  5Comments

LogicNinja picture LogicNinja  Â·  3Comments

vfab picture vfab  Â·  4Comments

tillig picture tillig  Â·  4Comments