question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Couldn't start client Terraform LS" error despite installing language server via extension/brew

See original GitHub issue

Extension version:

2.14.0

My Environment

  • macOS Big Sur 11.5.1
  • VSCode 1.58.2 (Universal)

Expected Behavior

  • When I run the command Terraform: Enable Language Server, the command should validate open .tf files.

Actual Behavior

  • When I run the command Terraform: Enable Language Server, I get an error message “Couldn’t start client Terraform LS”.

Steps to reproduce the problem (?)

  • Install extension
  • Open a .tf file (?)
  • Accept prompt to install 0.20.0 version of Terraform language server. Reload VSCode

OR

  • Install Language Server via brew with brew install hashicorp/tap/terraform-ls
  • Install extension
  • Configure settings.json as follows:
    "terraform.languageServer": {
         "external": true,
         "pathToBinary": "/usr/local/bin/terraform-ls",
         "args": [
             "serve"
         ],
         "maxNumberOfProblems": 100,
         "trace.server": "off"
     },
  • Open a .tf file (?)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
radeksimkocommented, May 18, 2022

Based on the file paths, it looks like you installed the extension into VS Codium or similar build of VS Code, which generally doesn’t install from the MS Marketplace. The latest builds on OpenVSX - which you likely used - are currently broken, because of an older version of ovsx was used which doesn’t support multi-platform extensions. We are currently blocked by https://github.com/eclipse/openvsx/issues/450

Since v2.20.0 we embed the LS binary in the extension itself (within vsix), so folks who consume the extension via official VS Code builds and MS Marketplace should no longer face this error.

We track OpenVSX publishing under https://github.com/hashicorp/vscode-terraform/pull/1064

@AllAwesome497 We also provide terraform-ls package for various Linux distributions, so you don’t have to build LS yourself: https://www.hashicorp.com/official-packaging-guide (terraform-ls is the package name).

0reactions
github-actions[bot]commented, Jun 18, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VS Code terraform extension error :Couldn't start client ...
You have to run terraform init so that the language server knows which schema to use. The extension itself doesn't seem to tell...
Read more >
VSCode: Terraform Module Calls not working
and it now exists in /usr/local/bin/terraform-ls , as does the Terraform executable itself. So I rewrite the Terraform config in settings.
Read more >
How to Install, Update, Enable and Disable Language Server ...
So in this quick post, I will help you to Install, Update, Enable and Disable Language Server.
Read more >
VS Code Terraform Language Server crash. - Reddit
I just realized that the Terraform-ls server is crashing all the time. First I was wondering, why doesn't autocomplete and snippets work?
Read more >
Enabling VS Code Terraform extension code completion on ...
As I'm writing more and more Terraform definitions, I've decided to make Terraform definition input c... Tagged with terraform, vscode, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found