Open iamlorax opened 1 year ago
Hi @iamlorax, can you post the Terraform config section in your settings? Also, what scope (user, workspace, etc) your settings are in? I think there is a configuration error that is preventing the extension from starting successfully
@jpogran defaultSettings.json = { "terraform.languageServer.args": [ "serve" ], "terraform.languageServer.enable": true, "terraform.languageServer.ignoreSingleFileWarning": false, "terraform.languageServer.indexing.ignoreDirectoryNames": [], "terraform.languageServer.indexing.ignorePaths": [], "terraform.languageServer.path": "", "terraform.languageServer.tcp.port": null, } settings.json(User) = { "terraform.languageServer.enable": true, }
There are not terraform configs in the workspace settings.
@iamlorax Just for clarity, would you mind clarifying what OS are you running this on? Ideally if you could take a screenshot of the System
details, that would be great!
I see the for VS Code you mention Windows_NT x64 10.0.19045
, i.e. Windows 10 x64 (64bit), but then I also see you have installed Terraform 1.3.6 for windows_386
(i.e. 32bit).
Similarly, can you also obtain version of the LS using the command below?
> c:\Users\radeksimko\.vscode\extensions\hashicorp.terraform-2.25.2-win32-x64\bin\terraform-ls.exe version
0.30.1
platform: windows/amd64
go: go1.19.3
compiler: gc
I am not super familiar with the compatibility constraints between the two architectures on Windows, but this stands out to me at the least. That said, you seem to have the default settings in place, and so if architecture mismatch (between your OS and terraform-ls
) is a problem, then we need to understand how did the wrong terraform-ls
binary end up there. There could be a bug in our packaging logic.
I do not have access to 32bit Windows myself unfortunately. If you could reproduce this on a different platform and/or architecture, e.g. Linux/x64, that would help confirm or reject the theory.
System Information Processor Intel(R) Core(TM) i5-10310U CPU @ 1.70GHz 2.21 GHz Installed RAM 16.0 GB (15.8 GB usable) System type 64-bit operating system, x64-based processor
I must have downloaded the incorrect Terraform by mistake. I now have the 64-bit version but that did not resolve the issue. Terraform terraform -version Terraform v1.3.6 on windows_amd64
Terraform-ls c:\Users------.vscode\extensions\hashicorp.terraform-2.25.2-win32-x64\bin\terraform-ls.exe version 0.30.1 platform: windows/amd64 go: go1.19.3
Thank you for providing this promptly, that means we can basically rule out architecture mismatch as root cause.
If you're able to run LS manually from PowerShell, then there must be some differences between how it runs through VS Code, but presumably not the arguments - as the log suggests the serve
argument is the only one being passed, as expected.
One possibility that comes to mind is permissions, but when I tried to reproduce that, I received the following in the log:
Launching language server: c:\Users\radeksimko\.vscode\extensions\hashicorp.terraform-2.25.2-win32-x64\bin\terraform-ls.exe serve
[Error - 5:10:47 PM] Starting client failed
Error: spawn EPERM
at ChildProcess.spawn (node:internal/child_process:413:11)
at Object.spawn (node:child_process:720:9)
at c:\Users\radeksimko\.vscode\extensions\hashicorp.terraform-2.25.2-win32-x64\out\extension.js:1:556996
where EPERM
clearly indicates the permissions as issue - and this doesn't match the log output you provided.
Just for avoidance of doubt - can you do integrity check on the LS binary? i.e. confirm that the SHA256 hash matches the following?
PS C:\Users\radeksimko> Get-FileHash c:\Users\...\.vscode\extensions\hashicorp.terraform-2.25.2-win32-x64\bin\terraform-ls.exe
Algorithm Hash Path
--------- ---- ----
SHA256 18CD480A2A0BDDC8C7D853C2B03E6A3CF09EF7948EE798845FFAAC6B3435E6C2 C:\Users\radeksimko\.vscode\e...
If the output matches - i.e. you have the exact same binary, then the only possible next step I can think of is on us - to try to log some more details in the error message about the circumstances of the failure, if the NodeJS/Windows API provides us any. 🤔
Output Get-FileHash c:\Users....vscode\extensions\hashicorp.terraform-2.25.2-win32-x64\bin\terraform-ls.exe Algorithm: SHA256 Hash: 18CD480A2A0BDDC8C7D853C2B03E6A3CF09EF7948EE798845FFAAC6B3435E6C2 Path: C:\Users....vscode\exte...
Looks like the hash does match.
Marking this issue as stale due to inactivity over the last 30 days. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.
Thank you for understanding.
Issue Description
I am unable to run the extension after a fresh install and am getting the error listed below: Connection to server got closed. Server will not be restarted.
Running the same command in powershell works as intended: c:\Users******.vscode\extensions\hashicorp.terraform-2.25.1-win32-x64\bin\terraform-ls.exe serve 2022/12/14 14:51:37 serve_command.go:101: Starting terraform-ls 0.30.1 2022/12/14 14:51:37 service.go:99: Preparing new session ... 2022/12/14 14:51:37 langserver.go:94: Starting server (pid 2488; concurrency: 4) ...
Environment Information
Terraform Information
Version: Not found (Terraform v1.3.6) Platform: Not found (windows_386) Outdated: false
Visual Studio Code
Visual Studio Code Extensions
Visual Studio Code Extensions(Click to Expand)
|Extension|Author|Version| |---|---|---| |autodocstring|njpwerner|0.6.1| |better-comments|aaron-bond|3.0.2| |Bookmarks|alefragnani|13.3.1| |code-spell-checker|streetsidesoftware|2.12.0| |git-graph|mhutchie|1.30.0| |githistory|donjayamanne|0.6.19| |gitlens|eamodio|13.1.1| |isort|ms-python|2022.8.0| |markdown-preview-enhanced|shd101wyy|0.6.5| |powershell|ms-vscode|2022.11.0| |python|ms-python|2022.20.1| |terraform|hashicorp|2.25.1| |trailing-spaces|shardulm94|0.4.1| |vscode-icons|vscode-icons-team|12.0.1| |vscode-pull-request-github|GitHub|0.56.0| |vscode-pylance|ms-python|2022.12.20| |xml|DotJoshJohnson|2.5.1|Extension Logs
Launching language server: c:\Users******.vscode\extensions\hashicorp.terraform-2.25.1-win32-x64\bin\terraform-ls.exe serve Failure to start terraform-ls. Please check your configuration settings and reload this window [Error - 2:39:06 PM] Connection to server got closed. Server will not be restarted.