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.

Failure to start terraform-ls using Dev Containers Extensions

See original GitHub issue

Versions

v2.24.3

Extension

hashicorp.terraform

VS Code

Version: 1.73.0 (user setup)
Commit: 8fa188b2b301d36553cbc9ce1b0a146ccb93351f
Date: 2022-11-01T15:34:06.111Z
Electron: 19.0.17
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Windows_NT x64 10.0.22000
Sandboxed: No

Operating System

DevContainer in VSCode. Dockerfile is included
Docker file Docker file ``` # You can pick any Debian/Ubuntu-based image. 😊 FROM mcr.microsoft.com/devcontainers/base:bullseye
COPY library-scripts/*.sh /tmp/library-scripts/

# [Option] Install zsh
ARG INSTALL_ZSH="true"
# [Option] Upgrade OS packages to their latest versions
ARG UPGRADE_PACKAGES="false"

# Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies.
ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
    && bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" "true" "true" \ 
    && apt-get install -y graphviz \
    && apt-get clean -y && rm -rf /var/lib/apt/lists/*

# [Option] Install Azure CLI
ARG INSTALL_AZURE_CLI="true"
# [Option] Install Docker CLI
ARG INSTALL_DOCKER="false"
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
ARG NODE_VERSION="lts/*"
ENV NVM_DIR=/usr/local/share/nvm
ENV NVM_SYMLINK_CURRENT=true \
    PATH=${NVM_DIR}/current/bin:${PATH}
RUN if [ "${INSTALL_AZURE_CLI}" = "true" ]; then bash /tmp/library-scripts/azcli-debian.sh; fi \
    && if [ "${NODE_VERSION}" != "none" ]; then bash /tmp/library-scripts/node-debian.sh "${NVM_DIR}" "${NODE_VERSION}" "${USERNAME}"; fi \
    && if [ "${INSTALL_DOCKER}" = "true" ]; then \
        bash /tmp/library-scripts/docker-debian.sh "true" "/var/run/docker-host.sock" "/var/run/docker.sock" "${USERNAME}"; \
    else \
        echo '#!/bin/bash\n"$@"' > /usr/local/share/docker-init.sh && chmod +x /usr/local/share/docker-init.sh; \
    fi \
    && rm -rf /var/lib/apt/lists/*

# Install Terraform, tflint, Terragrunt
ARG TERRAFORM_VERSION=0.12.16
ARG TFLINT_VERSION=0.8.2
ARG TERRAGRUNT_VERSION=0.28.1
RUN bash /tmp/library-scripts/terraform-debian.sh "${TERRAFORM_VERSION}" "${TFLINT_VERSION}" "${TERRAGRUNT_VERSION}" \
    && rm -rf /tmp/library-scripts

ENV SHELL /bin/zsh

ENTRYPOINT [ "/usr/local/share/docker-init.sh" ]
CMD [ "sleep", "infinity" ]

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
#     && apt-get -y install --no-install-recommends <your-package-list-here>
```

Terraform Version

Terraform v0.14.5

Your version of Terraform is out of date! The latest version
is 1.3.4. You can update by downloading from https://www.terraform.io/downloads.html

Expected Behavior

Terraform ls server should start

Actual Behavior

Terraform ls server does not start

Additional context

image

Launching language server: /home/vscode/.vscode-server/extensions/hashicorp.terraform-2.24.3-linux-x64/bin/terraform-ls 
Failure to start terraform-ls. Please check your configuration settings and reload this window
[Error - 1:43:32 PM] Connection to server got closed. Server will not be restarted.

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jpograncommented, Nov 22, 2022

@richardsimko I’m going to open a new issue with your comment, as it doesn’t relate to the Dev Container extension it deserves its own investigation.

0reactions
github-actions[bot]commented, Dec 25, 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

"Couldn't start client Terraform LS" error despite installing ...
Steps to reproduce the problem (?). Install extension; Open a .tf file (?); Accept prompt to install 0.20.0 version of Terraform language server ......
Read more >
Enabling VS Code Terraform extension code completion on ...
Basically I've been writing Terraform definitions in VS Code on Windows 10, but I've left some unfamiliar errors appearing, and I felt it...
Read more >
Attach to a running container - Visual Studio Code
Once attached, you can install extensions, edit, and debug like you can when you open a folder in a container using devcontainer.json.
Read more >
Remote-Containers VS Code extension doesn't recognize a ...
I can connect to the instance with VS Code via ssh and open the repository remotely. There is a dev container image on...
Read more >
Your Open Source Project Needs a devcontainer - Here's Why
A devcontainer is used by the VS Code Remote Containers extension and works by creating a Docker container to do your development in....
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