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

Unable to launch language server: Error: ENOENT: no such file or directory, stat '/root/.vscode-server/data/User/globalStorage/hashicorp.terraform/bin/terraform-ls' #1853

Open
1 task
idkman23 opened this issue Sep 25, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@idkman23
Copy link

Extension Version

v2.19.0

VS Code Version

Version: 1.93.1 (Universal)
Commit: 38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40
Date: 2024-09-11T17:20:05.685Z (2 wks ago)
Electron: 30.4.0
ElectronBuildId: 10073054
Chromium: 124.0.6367.243
Node.js: 20.15.1
V8: 12.4.254.20-electron.0
OS: Darwin x64 23.6.0

Operating System

14.6.1 (23G93)

Terraform Version

Terraform v1.3.9

Steps to Reproduce

use remote explorer extension to open us an SSH window inside a container

Expected Behavior

terraform extension is loaded

Actual Behavior

Unable to launch language server: Error: ENOENT: no such file or directory, stat '/root/.vscode-server/data/User/globalStorage/hashicorp.terraform/bin/terraform-ls'

Terraform Configuration

No response

Project Structure

No response

Gist

No response

Anything Else?

No response

Workarounds

No response

References

No response

Help Wanted

  • I'm interested in contributing a fix myself

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@idkman23 idkman23 added the bug Something isn't working label Sep 25, 2024
@jpogran
Copy link
Contributor

jpogran commented Sep 26, 2024

Hi @idkman23, thanks for reaching out. Extension v2.19.0 is around 2 years old at this point and there have been significant updates since then. I strongly recommend updating to the latest version, as it comes with significant performance improvements. Is there a reason you are using such an old version?

Towards this issue, that error usually happens using the WSL/SSH extension. I see you are on macOS, so I assume it's the Remote SSH Extension, but the same advice applies to the WSL extension. This usually happens form either not installing the Terraform extension 'locally' or it was unsuccessful. You can follow https://code.visualstudio.com/docs/remote/ssh#_managing-extensions for more information and some troubleshooting steps.

@idkman23
Copy link
Author

idkman23 commented Sep 27, 2024

Hmm... I don't what's wrong with my vscode. On the host the extension version is v2.32.3 but when I try to install the extension when Remote SSHing inside the container, the extension version is v2.19.0. I've tried reinstalling on both the host and inside the container but with same results.

@jpogran
Copy link
Contributor

jpogran commented Sep 27, 2024

So v2.19.0 is still when the extension downloaded terraform-ls from releases.hashicorp.com at runtime. In v2.20.0 we transitioned to bundling terraform-ls inside the extension. It is likely you aren't able to reach the internet inside the container to download terraform-ls, thus the path being empty. It's also possible the extension doesn't have permissions to write to /root/.vscode-server/data/User/globalStorage/hashicorp.terraform/bin, but that is unlikely.

I feel your pain in figuring out how to configure the Remote Extensions, especially the devcontainer one, they are not straightforward. I know you said you uninstalled/reinstalled, but with devcontainers there are two locations for the extension: local (your computer) and remote (the container/host/etc). Reinstalling will reinstall the local side, but not the remote side. Typically I have to rebuild the container in order for it to redeploy the extension to the remote side. You should see a .vscode-server/extensions and .vscode-server/data/User/globalStorage/hashicorp.terraform folders there.

Another thing to look at is that often devcontainers are customized with certain versions of tooling. It's possible the devcontainer may have something configured to use the older version.

Last thing I can think of is that there are several levels of settings. If you open the VS Code settings pane, there should be User. Workspace, Folder and Machine (if you have the devcontainer open). It's possible the devcontainer is providing something in the Machine config that is restricting the version.

@idkman23
Copy link
Author

idkman23 commented Oct 4, 2024

@jpogran It kept defaulting to the 2.19.0. I deleted the ~/.vscode-server. Now I'm getting "Extension is not signed." message when installing the extension in a remote container. I am able to install other extensions.

saw this message in the logs every time I try to install the extension:
[384041 ms] [16:04:07] [network] #24: https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery - error POST unable to get local issuer certificate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants