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

No schema found for ... Functionality may be limited. You may need to run terraform init. Initialization failed: no exec path provided for terraform #398

Closed
burck1 opened this issue Feb 7, 2021 · 2 comments · Fixed by #401
Labels
enhancement New feature or request

Comments

@burck1
Copy link

burck1 commented Feb 7, 2021

I've also filed this as a bug for the vscode-terraform repo: hashicorp/vscode-terraform#552

Server Version

0.13.0

Terraform Version

0.12.30

Client Version

VS Code: 1.53.0
VS Code Terraform Extension: v2.5.0

Terraform Configuration Files

main.tf

terraform {
  required_version = ">= 0.12.26"

  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 3.0"
    }
  }
}

provider "aws" {
  region = "us-east-1"
}

File Tree

$ find . -print
.
./main.tf
./.terraform
./.terraform/plugins
./.terraform/plugins/darwin_amd64
./.terraform/plugins/darwin_amd64/terraform-provider-aws_v3.27.0_x5
./.terraform/plugins/darwin_amd64/lock.json

Log Output

This is the terraform-ls logs output for the terraform VSCode extension. For this output:

  1. I opened VSCode to my test folder
  2. I opened main.tf which gave me the message in the first screenshot
  3. I clicked the terraform init button in the popup message
Launching language server: /Users/aburck/.vscode/extensions/hashicorp.terraform-2.5.0/lsp/terraform-ls serve for folder: file:///Users/aburck/code/local/test/
2021/02/07 02:15:06 serve_command.go:137: Starting terraform-ls 0.13.0
2021/02/07 02:15:06 service.go:71: Preparing new session ...
2021/02/07 02:15:06 watcher.go:215: watching for changes ...
2021/02/07 02:15:06 langserver.go:69: Starting server (pid 81470) ...
2021/02/07 02:15:06 server.go:573: Received 1 new requests
2021/02/07 02:15:06 server.go:174: Processing 1 requests
2021/02/07 02:15:06 server.go:265: Checking request for "initialize": {"processId":81445,"clientInfo":{"name":"vscode","version":"1.53.0"},"rootPath":"/Users/aburck/code/local/test","rootUri":"file:///Users/aburck/code/local/test","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional"},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"tagSupport":{"valueSet":[1]}},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true,"semanticTokens":{"refreshSupport":true}},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]},"codeDescriptionSupport":true,"dataSupport":true},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]},"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]}},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true},"activeParameterSupport":true},"contextSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true,"tagSupport":{"valueSet":[1]},"labelSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"disabledSupport":true,"dataSupport":true,"resolveSupport":{"properties":["edit"]},"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true,"prepareSupportDefaultBehavior":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"selectionRange":{"dynamicRegistration":true},"callHierarchy":{"dynamicRegistration":true},"semanticTokens":{"dynamicRegistration":true,"tokenTypes":["namespace","type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","event","function","member","macro","keyword","modifier","comment","string","number","regexp","operator"],"tokenModifiers":["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"],"formats":["relative"],"requests":{"range":true,"full":{"delta":true}}}},"window":{"workDoneProgress":true}},"initializationOptions":{"commandPrefix":"6","experimentalFeatures":{}},"trace":"off","workspaceFolders":[{"uri":"file:///Users/aburck/code/local/test","name":"test"}]}
2021/02/07 02:15:06 rpc_logger.go:29: Incoming request for "initialize" (ID 0): {"processId":81445,"clientInfo":{"name":"vscode","version":"1.53.0"},"rootPath":"/Users/aburck/code/local/test","rootUri":"file:///Users/aburck/code/local/test","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional"},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"tagSupport":{"valueSet":[1]}},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true,"semanticTokens":{"refreshSupport":true}},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]},"codeDescriptionSupport":true,"dataSupport":true},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]},"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]}},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true},"activeParameterSupport":true},"contextSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true,"tagSupport":{"valueSet":[1]},"labelSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"disabledSupport":true,"dataSupport":true,"resolveSupport":{"properties":["edit"]},"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true,"prepareSupportDefaultBehavior":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"selectionRange":{"dynamicRegistration":true},"callHierarchy":{"dynamicRegistration":true},"semanticTokens":{"dynamicRegistration":true,"tokenTypes":["namespace","type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","event","function","member","macro","keyword","modifier","comment","string","number","regexp","operator"],"tokenModifiers":["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"],"formats":["relative"],"requests":{"range":true,"full":{"delta":true}}}},"window":{"workDoneProgress":true}},"initializationOptions":{"commandPrefix":"6","experimentalFeatures":{}},"trace":"off","workspaceFolders":[{"uri":"file:///Users/aburck/code/local/test","name":"test"}]}
2021/02/07 02:15:06 walker.go:102: asynchronously walking through /Users/aburck/code/local/test
2021/02/07 02:15:06 rpc_logger.go:50: Response to "initialize" (ID 0): {"capabilities":{"textDocumentSync":{"openClose":true,"change":2,"save":{}},"completionProvider":{},"hoverProvider":true,"signatureHelpProvider":{},"documentSymbolProvider":true,"codeLensProvider":{},"documentLinkProvider":{},"documentFormattingProvider":true,"documentOnTypeFormattingProvider":{"firstTriggerCharacter":""},"executeCommandProvider":{"commands":["6.terraform-ls.rootmodules","6.terraform-ls.terraform.init","6.terraform-ls.terraform.validate"],"workDoneProgress":true},"semanticTokensProvider":{"legend":{"tokenTypes":["type","string","property"],"tokenModifiers":["deprecated","modification"]},"full":true},"workspace":{"workspaceFolders":{}}},"serverInfo":{"name":"terraform-ls","version":"0.13.0"}}
2021/02/07 02:15:06 walker.go:150: found module /Users/aburck/code/local/test
2021/02/07 02:15:06 server.go:246: Completed 1 requests [2.831693ms elapsed]
2021/02/07 02:15:06 module_manager.go:67: MM: adding new module: /Users/aburck/code/local/test
2021/02/07 02:15:06 module_loader.go:164: ML: enqueing "OpTypeGetTerraformVersion" module operation: /Users/aburck/code/local/test
2021/02/07 02:15:06 module_loader.go:164: ML: enqueing "OpTypeObtainSchema" module operation: /Users/aburck/code/local/test
2021/02/07 02:15:06 walker.go:202: walking of /Users/aburck/code/local/test finished
2021/02/07 02:15:06 walker.go:75: stopping walker
2021/02/07 02:15:06 walker.go:108: async walking through /Users/aburck/code/local/test finished
2021/02/07 02:15:06 module_loader.go:136: executing "OpTypeGetTerraformVersion" for /Users/aburck/code/local/test
2021/02/07 02:15:06 module_ops.go:83: getting executor failed: no exec path provided for terraform
2021/02/07 02:15:06 module_loader.go:144: finished "OpTypeGetTerraformVersion" for /Users/aburck/code/local/test
2021/02/07 02:15:06 module_loader.go:136: executing "OpTypeObtainSchema" for /Users/aburck/code/local/test
2021/02/07 02:15:06 module_ops.go:108: getting executor failed: no exec path provided for terraform
2021/02/07 02:15:06 module_loader.go:147: finished "OpTypeObtainSchema" for /Users/aburck/code/local/test
2021/02/07 02:15:06 server.go:573: Received 1 new requests
2021/02/07 02:15:06 server.go:174: Processing 1 requests
2021/02/07 02:15:06 server.go:265: Checking request for "initialized": {}
2021/02/07 02:15:06 rpc_logger.go:29: Incoming notification for "initialized": {}
2021/02/07 02:15:32 server.go:573: Received 1 new requests
2021/02/07 02:15:32 server.go:174: Processing 1 requests
2021/02/07 02:15:32 server.go:265: Checking request for "textDocument/didOpen": {"textDocument":{"uri":"file:///Users/aburck/code/local/test/main.tf","languageId":"terraform","version":1,"text":"terraform {\n  required_version = \">= 0.12.26\"\n\n  required_providers {\n    aws = {\n      source  = \"hashicorp/aws\"\n      version = \"~> 3.0\"\n    }\n  }\n}\n\nprovider \"aws\" {\n  region = \"us-east-1\"\n}\n"}}
2021/02/07 02:15:32 server.go:573: Received 1 new requests
2021/02/07 02:15:32 rpc_logger.go:29: Incoming notification for "textDocument/didOpen": {"textDocument":{"uri":"file:///Users/aburck/code/local/test/main.tf","languageId":"terraform","version":1,"text":"terraform {\n  required_version = \">= 0.12.26\"\n\n  required_providers {\n    aws = {\n      source  = \"hashicorp/aws\"\n      version = \"~> 3.0\"\n    }\n  }\n}\n\nprovider \"aws\" {\n  region = \"us-east-1\"\n}\n"}}
2021/02/07 02:15:32 server.go:573: Received 1 new requests
2021/02/07 02:15:32 server.go:573: Received 1 new requests
2021/02/07 02:15:32 server.go:174: Processing 1 requests
2021/02/07 02:15:32 server.go:265: Checking request for "textDocument/documentLink": {"textDocument":{"uri":"file:///Users/aburck/code/local/test/main.tf"}}
2021/02/07 02:15:32 server.go:297: Task error: [-32601] no such method "textDocument/documentLink"
2021/02/07 02:15:32 did_open.go:58: opened module: /Users/aburck/code/local/test
2021/02/07 02:15:32 module_loader.go:164: ML: enqueing "OpTypeParseConfiguration" module operation: /Users/aburck/code/local/test
2021/02/07 02:15:32 module_loader.go:136: executing "OpTypeParseConfiguration" for /Users/aburck/code/local/test
2021/02/07 02:15:32 module_loader.go:150: finished "OpTypeParseConfiguration" for /Users/aburck/code/local/test
2021/02/07 02:15:32 watcher.go:73: adding module for watching: /Users/aburck/code/local/test
2021/02/07 02:15:32 server.go:174: Processing 1 requests
2021/02/07 02:15:32 server.go:265: Checking request for "workspace/executeCommand": {"command":"6.terraform-ls.rootmodules","arguments":["uri=file:///Users/aburck/code/local/test/main.tf"]}
2021/02/07 02:15:32 server.go:174: Processing 1 requests
2021/02/07 02:15:32 server.go:265: Checking request for "textDocument/documentSymbol": {"textDocument":{"uri":"file:///Users/aburck/code/local/test/main.tf"}}
2021/02/07 02:15:32 rpc_logger.go:29: Incoming request for "textDocument/documentSymbol" (ID 3): {"textDocument":{"uri":"file:///Users/aburck/code/local/test/main.tf"}}
2021/02/07 02:15:32 rpc_logger.go:50: Response to "textDocument/documentSymbol" (ID 3): [{"name":"terraform","kind":5,"location":{"uri":"file:///Users/aburck/code/local/test/main.tf","range":{"start":{"line":0,"character":0},"end":{"line":9,"character":1}}}},{"name":"provider \"aws\"","kind":5,"location":{"uri":"file:///Users/aburck/code/local/test/main.tf","range":{"start":{"line":11,"character":0},"end":{"line":13,"character":1}}}}]
2021/02/07 02:15:32 server.go:246: Completed 1 requests [207.198µs elapsed]
2021/02/07 02:15:32 server.go:443: Posting server notification "textDocument/publishDiagnostics" {"uri":"file:///Users/aburck/code/local/test/main.tf","diagnostics":[]}
2021/02/07 02:15:32 server.go:443: Posting server call "window/showMessageRequest" {"type":3,"message":"No schema found for \"test\". Functionality may be limited. You may need to run terraform init.","actions":[{"title":"terraform init"}]}
2021/02/07 02:15:32 rpc_logger.go:45: Error for "textDocument/documentLink" (ID 1): [-32601] no such method "textDocument/documentLink"
2021/02/07 02:15:32 server.go:246: Completed 1 requests [3.41341ms elapsed]
2021/02/07 02:15:32 rpc_logger.go:29: Incoming request for "workspace/executeCommand" (ID 2): {"command":"6.terraform-ls.rootmodules","arguments":["uri=file:///Users/aburck/code/local/test/main.tf"]}
2021/02/07 02:15:32 rpc_logger.go:50: Response to "workspace/executeCommand" (ID 2): {"responseVersion":0,"doneLoading":true,"rootModules":[]}
2021/02/07 02:15:32 server.go:246: Completed 1 requests [592.448µs elapsed]
2021/02/07 02:15:32 server.go:573: Received 1 new requests
2021/02/07 02:15:32 server.go:174: Processing 1 requests
2021/02/07 02:15:32 server.go:265: Checking request for "textDocument/semanticTokens/full": {"textDocument":{"uri":"file:///Users/aburck/code/local/test/main.tf"}}
2021/02/07 02:15:32 rpc_logger.go:29: Incoming request for "textDocument/semanticTokens/full" (ID 4): {"textDocument":{"uri":"file:///Users/aburck/code/local/test/main.tf"}}
2021/02/07 02:15:32 module_manager.go:140: falling back to preloaded schema for /Users/aburck/code/local/test...
[Error - 2:15:32 AM] Request textDocument/documentLink failed.
  Message: no such method "textDocument/documentLink"
  Code: -32601 
2021/02/07 02:15:32 server.go:573: Received 1 new requests
2021/02/07 02:15:32 server.go:174: Processing 1 requests
2021/02/07 02:15:32 server.go:265: Checking request for "textDocument/documentSymbol": {"textDocument":{"uri":"file:///Users/aburck/code/local/test/main.tf"}}
2021/02/07 02:15:32 server.go:573: Received 1 new requests
2021/02/07 02:15:32 server.go:174: Processing 1 requests
2021/02/07 02:15:32 server.go:265: Checking request for "textDocument/codeLens": {"textDocument":{"uri":"file:///Users/aburck/code/local/test/main.tf"}}
2021/02/07 02:15:32 server.go:297: Task error: [-32601] no such method "textDocument/codeLens"
2021/02/07 02:15:32 rpc_logger.go:45: Error for "textDocument/codeLens" (ID 6): [-32601] no such method "textDocument/codeLens"
2021/02/07 02:15:32 server.go:246: Completed 1 requests [76.85µs elapsed]
[Error - 2:15:32 AM] Request textDocument/codeLens failed.
  Message: no such method "textDocument/codeLens"
  Code: -32601 
2021/02/07 02:15:32 server.go:573: Received 1 new requests
2021/02/07 02:15:32 server.go:174: Processing 1 requests
2021/02/07 02:15:32 server.go:265: Checking request for "textDocument/codeLens": {"textDocument":{"uri":"file:///Users/aburck/code/local/test/main.tf"}}
2021/02/07 02:15:32 server.go:297: Task error: [-32601] no such method "textDocument/codeLens"
2021/02/07 02:15:32 rpc_logger.go:45: Error for "textDocument/codeLens" (ID 7): [-32601] no such method "textDocument/codeLens"
2021/02/07 02:15:32 server.go:246: Completed 1 requests [77.992µs elapsed]
[Error - 2:15:32 AM] Request textDocument/codeLens failed.
  Message: no such method "textDocument/codeLens"
  Code: -32601 
2021/02/07 02:15:33 module_manager.go:149: preloaded provider schema (134 providers) set for /Users/aburck/code/local/test
2021/02/07 02:15:33 rpc_logger.go:50: Response to "textDocument/semanticTokens/full" (ID 4): {"data":[0,0,9,0,0,1,2,16,2,0,2,2,18,0,0,1,4,3,2,0,7,0,8,0,0,0,9,5,1,2,1,2,6,2,2]}
2021/02/07 02:15:33 server.go:246: Completed 1 requests [895.307323ms elapsed]
2021/02/07 02:15:33 rpc_logger.go:29: Incoming request for "textDocument/documentSymbol" (ID 5): {"textDocument":{"uri":"file:///Users/aburck/code/local/test/main.tf"}}
2021/02/07 02:15:33 rpc_logger.go:50: Response to "textDocument/documentSymbol" (ID 5): [{"name":"terraform","kind":5,"location":{"uri":"file:///Users/aburck/code/local/test/main.tf","range":{"start":{"line":0,"character":0},"end":{"line":9,"character":1}}}},{"name":"provider \"aws\"","kind":5,"location":{"uri":"file:///Users/aburck/code/local/test/main.tf","range":{"start":{"line":11,"character":0},"end":{"line":13,"character":1}}}}]
2021/02/07 02:15:33 server.go:246: Completed 1 requests [808.004139ms elapsed]
2021/02/07 02:15:36 server.go:573: Received 1 new requests
2021/02/07 02:15:36 server.go:174: Processing 1 requests
2021/02/07 02:15:36 server.go:265: Checking request for "": 
2021/02/07 02:15:36 server.go:443: Posting server call "window/workDoneProgress/create" {"token":"a824b024-691c-11eb-889c-acde48001122"}
2021/02/07 02:15:36 server.go:573: Received 1 new requests
2021/02/07 02:15:36 server.go:174: Processing 1 requests
2021/02/07 02:15:36 server.go:265: Checking request for "": 
2021/02/07 02:15:36 server.go:443: Posting server notification "window/showMessage" {"type":1,"message":"Initialization failed: no exec path provided for terraform"}
2021/02/07 02:15:36 server.go:573: Received 1 new requests
2021/02/07 02:15:36 server.go:174: Processing 1 requests
2021/02/07 02:15:36 server.go:265: Checking request for "textDocument/codeLens": {"textDocument":{"uri":"file:///Users/aburck/code/local/test/main.tf"}}
2021/02/07 02:15:36 server.go:297: Task error: [-32601] no such method "textDocument/codeLens"
2021/02/07 02:15:36 rpc_logger.go:45: Error for "textDocument/codeLens" (ID 8): [-32601] no such method "textDocument/codeLens"
2021/02/07 02:15:36 server.go:246: Completed 1 requests [64.883µs elapsed]
[Error - 2:15:36 AM] Request textDocument/codeLens failed.
  Message: no such method "textDocument/codeLens"
  Code: -32601 
2021/02/07 02:15:36 server.go:573: Received 1 new requests
2021/02/07 02:15:36 server.go:174: Processing 1 requests
2021/02/07 02:15:36 server.go:265: Checking request for "textDocument/codeLens": {"textDocument":{"uri":"file:///Users/aburck/code/local/test/main.tf"}}
2021/02/07 02:15:36 server.go:297: Task error: [-32601] no such method "textDocument/codeLens"
2021/02/07 02:15:36 rpc_logger.go:45: Error for "textDocument/codeLens" (ID 9): [-32601] no such method "textDocument/codeLens"
2021/02/07 02:15:36 server.go:246: Completed 1 requests [43.055µs elapsed]
[Error - 2:15:36 AM] Request textDocument/codeLens failed.
  Message: no such method "textDocument/codeLens"
  Code: -32601 

Actual Behavior

The VS Code Terraform extension always gives me the following message whenever I open any .tf file.

image

Then although I have already run terraform init, when I click the terraform init button I get the following message.

image

Steps to Reproduce

  1. Run terraform init in your test folder with a single main.tf and with the code found in the Terraform Configuration Files section above.
  2. Open VS Code to your test folder
  3. Open main.tf
  4. In the popup message, click the terraform init button

Terraform Install

$ which terraform
/Users/aburck/.local/bin/terraform

$ echo $PATH
/Users/aburck/.local/bin:...

I simply downloaded and extracted the terraform executable to ~/.local/bin. Then I added ~/.local/bin to my PATH via my ~/.zshrc using export PATH="$HOME/.local/bin:$PATH"

@radeksimko radeksimko added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Feb 7, 2021
@radeksimko
Copy link
Member

Aside from improving the error message here a bit (as per hashicorp/vscode-terraform#552 ) I think we should also replace the first popup with a red one in this particular case, indicating that Terraform needs to be installed and available in $PATH.

There is no point in prompting users for init when we have no exec path to Terraform.

@ghost
Copy link

ghost commented Mar 11, 2021

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 context necessary to investigate further.

@ghost ghost locked as resolved and limited conversation to collaborators Mar 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants