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.

Crashing language server (terraform-ls)

See original GitHub issue

After an update to the latest version (v2.12.1) my Terraform language server does not work anymore. As a consequence, I do not have auto-completion like I used to just over a week ago. Also, the following error message appears:

The Language Server: 
file:///<path-pointing-to-my-terraform-project> server crashed 5 times in the last 3 minutes. 
The server will not be restarted.

These are the VSCode settings I specified in the settings.json file:

...
"terraform.languageServer": {
        "external": true,
        "pathToBinary": "C:\\Portable\\terraform\\terraform.exe",
        "args": [
            "serve"
        ],
        "maxNumberOfProblems": 100,
        "trace.server": "off"
    },
...

Is it normal that the path displayed in the error message and the one I set in the settings.json file are different? Can you help me troubleshoot the error?

I’m using a Win10 x64 workstation.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
radeksimkocommented, Jun 18, 2021

I have created https://github.com/hashicorp/vscode-terraform/issues/667 to address the proxy related issues.

terraform-ls is its own thing, separate from terraform binary

The field is under terraform.languageServer section and the description already mentions this, so I’m not sure what more can be done in this area? 🤔

https://github.com/hashicorp/vscode-terraform/blob/ab57089375e2c5f989bf854ca47e45335e3ac1d6/package.json#L101

1reaction
radeksimkocommented, Jun 18, 2021

I’m starting to think that terraform.exe and terraform-ls are two different things.

Yes - these are two different things. We do not bundle the language server with Terraform itself, at least not at this point.

No need to apologize - I’m just curious what motived you to set this config option? The extension should just install the LS automatically after first activation and it should not need any manual configuration at all.

Is there any piece of documentation that needs updating, or adding somewhere?

I tried to re-install the extension without specifying the path but I get this error:

I’m assuming that’s the (unfortunately vague) message from a popup. I haven’t quite figured out where that one comes from and how to make it more useful, but I’ve seen it before.

I wonder if this could be related to the way you run VS Code or the network you’re on?

Generally the extension needs to:

  • be able to reach releases.hashicorp.com - if you’re behind any kind of restrictive corporate firewall that blocks requests to that domain then I imagine that might confuse the updater.
  • be able to create a new lsp directory within the extension dir (i.e. $HOME/.vscode/extensions/hashicorp.terraform-2.12.1) and be able to write files into that directory
Read more comments on GitHub >

github_iconTop Results From Across the Web

Terraform Language Server v.0.16.0 keeps crashing ... - GitHub
0.16.0 keeps crashing, and auto-completion stopped working,. Workaround while the new language server is fixed: Revert back to v.0.15.0.
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 >
terraform-ls - Homebrew Formulae
terraform -ls. Install command: brew install terraform-ls. Terraform Language Server. https://github.com/hashicorp/terraform-ls. License: MPL-2.0.
Read more >
Language Server Protocol Support in BBEdit 14
Warning: customizing server initialization or workspace configurations can cause the language server to crash or otherwise behave unexpectedly. We cannot ...
Read more >
HashiCorp Terraform (Preview) - Visual Studio Marketplace
The HashiCorp Terraform Extension for Visual Studio Code (VS Code) with the Terraform Language Server adds editing features for Terraform ...
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