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.

`terraform-ls: cannot execute binary file`

See original GitHub issue

Versions

This bug is reproducible in:

  • the latest version of the extension (below)
  • the latest version of the language server (below) (Not sure how to answer this one, see workarounds below)

Extension

v2.20.1

Language Server

I’m not sure what version of terraform-ls is being shipped with the inspection because the binary is not able to be executed.

VS Code

Version: 1.67.1
Commit: da15b6fd3ef856477bf6f4fb29ba1b7af717770d
Date: 2022-05-10T21:35:59.370Z
Electron: 17.4.3
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.13-electron.0
OS: Linux x64 5.17.5-arch1-1

Operating System

➜  ~ uname -a
Linux saras-laptop 5.17.5-arch1-1 #1 SMP PREEMPT Wed, 27 Apr 2022 20:56:11 +0000 x86_64 GNU/Linux

Terraform Version

➜  ~ terraform version
Terraform v1.1.9
on linux_amd64

Steps To Reproduce

terraform-ls should be an executable binary.

Note, running chmod +x on the binary file did not help.

Actual Behavior

The binary is not executable.

Additional context

The workaround I’m using currently (which is working great, BTW, amazing work on the extension, the experience with and without it is night and day) is to install terraform-ls from the AUR and update my VSCode settings with the following:

    "terraform.languageServer": {
        "external": true,
        "pathToBinary": "/usr/bin/terraform-ls",
        "args": [
            "serve"
        ],
        "maxNumberOfProblems": 100,
        "trace.server": "off"
    }

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
radeksimkocommented, May 11, 2022

FWIW in the meantime you may be able to downgrade to 2.19.0 which was the last version built as universal (rather than platform specific) - but of course managing LS on your own like you mentioned is also a good workaround.

As mentioned in the linked issue we are currently blocked by https://github.com/eclipse/openvsx/issues/450

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

cannot execute binary file error : r/Terraform - Reddit
You have the wrong binary for your architecture.
Read more >
Terraform binary issue - Google Groups
terraform : cannot execute binary file. I have changed t chmod +x terraform. Currently the version is. terraform -version. Terraform v0.7.13.
Read more >
How can I resolve the error "cannot execute binary file"?
The problem is running a binary for a different processor architecture. You can use objdump (from binutils) to check architecture of binaries. ...
Read more >
How to install Terraform in Linux - Fit-DevOps
After downloading terraform package, unzip the package. ... Final step is to make sure terraform binary file is on the correct path. ......
Read more >
How to fix Cannot execute binary file: exec format error?
How to fix Cannot execute binary file: exec format error? · Check the architecture · Check the file · Install GCC and Gfortran...
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