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

v2.0.0rc1 "error obtaining schemas" won't retry #144

Closed
pgreda opened this issue Jun 5, 2020 · 3 comments
Closed

v2.0.0rc1 "error obtaining schemas" won't retry #144

pgreda opened this issue Jun 5, 2020 · 3 comments
Labels
question Further information is requested

Comments

@pgreda
Copy link

pgreda commented Jun 5, 2020

Server Version

/home/pgreda/.vscode-server/extensions/hashicorp.terraform-2.0.0-rc.1/lsp/terraform-ls --version
0.3.2

Terraform Version

pgreda@pgreda:~/terraform/k8s-calico-testdrive$ terraform --version
Terraform v0.12.26
+ provider.aws v2.65.0

Client Version

Version: 1.45.1 (user setup)
Commit: 5763d909d5f12fe19f215cbfdd29a91c0fa9208a
Date: 2020-05-14T08:27:35.169Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.19041

Running on WSL2

Terraform Configuration Files

  "[terraform]": {},
  "terraform.languageServer": {
  
    "external": true,
    "args": [
      "serve"
    ]
  },

Log Output

Launching language server: /home/pgreda/.vscode-server/extensions/hashicorp.terraform-2.0.0-rc.1/lsp/terraform-ls serve
2020/06/05 20:17:19 service.go:63: Preparing new session ...
2020/06/05 20:17:19 langserver.go:79: Starting server (pid 4255) ...
2020/06/05 20:17:19 server.go:469: Received 1 new requests
2020/06/05 20:17:19 server.go:165: Processing 1 requests
2020/06/05 20:17:19 server.go:223: Checking request for "initialize": {"processId":4209,"rootPath":"/home/pgreda/terraform/k8s-calico-testdrive","rootUri":"file:///home/pgreda/terraform/k8s-calico-testdrive","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]}},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true},"textDocument":{"publishDiagnostics":{"relatedInformation":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},"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}}},"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},"codeAction":{"dynamicRegistration":true,"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},"documentLink":{"dynamicRegistration":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}}},"trace":"off","workspaceFolders":[{"uri":"file:///home/pgreda/terraform/k8s-calico-testdrive","name":"k8s-calico-testdrive"}]}
2020/06/05 20:17:19 rpc_logger.go:29: Incoming request for "initialize" (ID 0): {"processId":4209,"rootPath":"/home/pgreda/terraform/k8s-calico-testdrive","rootUri":"file:///home/pgreda/terraform/k8s-calico-testdrive","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]}},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true},"textDocument":{"publishDiagnostics":{"relatedInformation":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},"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}}},"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},"codeAction":{"dynamicRegistration":true,"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},"documentLink":{"dynamicRegistration":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}}},"trace":"off","workspaceFolders":[{"uri":"file:///home/pgreda/terraform/k8s-calico-testdrive","name":"k8s-calico-testdrive"}]}
2020/06/05 20:17:19 exec.go:176: Starting /usr/local/bin/terraform ["terraform" "version"] in "/tmp"...
2020/06/05 20:17:19 exec.go:142: Waiting for command to finish ...
2020/06/05 20:17:19 exec.go:168: terraform run (/usr/local/bin/terraform ["terraform" "version"], in "/tmp", pid 4263) finished with exit code 0
2020/06/05 20:17:19 initialize.go:90: Found compatible Terraform version (0.12.26) at /usr/local/bin/terraform
2020/06/05 20:17:19 schema_storage.go:334: Adding workspace for watching: "/home/pgreda/terraform/k8s-calico-testdrive"
2020/06/05 20:17:19 watcher.go:88: Adding "/home/pgreda/terraform/k8s-calico-testdrive/.terraform/plugins/linux_amd64/lock.json" for watching...
2020/06/05 20:17:19 schema_storage.go:310: Watching for plugin changes ...
2020/06/05 20:17:19 schema_storage.go:124: Acquiring semaphore before retrieving schema for "/home/pgreda/terraform/k8s-calico-testdrive" ...
2020/06/05 20:17:19 schema_storage.go:133: Retrieving schemas for "/home/pgreda/terraform/k8s-calico-testdrive" ...
2020/06/05 20:17:19 exec.go:176: Starting /usr/local/bin/terraform ["terraform" "providers" "schema" "-json"] in "/home/pgreda/terraform/k8s-calico-testdrive"...
2020/06/05 20:17:19 rpc_logger.go:50: Response to "initialize" (ID 0): {"capabilities":{"textDocumentSync":{"openClose":true,"change":2},"completionProvider":{},"documentFormattingProvider":true}}
2020/06/05 20:17:19 server.go:204: Completed 1 requests [63.4189ms elapsed]
2020/06/05 20:17:19 exec.go:142: Waiting for command to finish ...
2020/06/05 20:17:19 server.go:469: Received 1 new requests
2020/06/05 20:17:19 server.go:165: Processing 1 requests
2020/06/05 20:17:19 server.go:223: Checking request for "initialized": {}
2020/06/05 20:17:19 rpc_logger.go:29: Incoming notification for "initialized": {}
2020/06/05 20:17:19 server.go:469: Received 1 new requests
2020/06/05 20:17:19 server.go:165: Processing 1 requests
2020/06/05 20:17:19 server.go:223: Checking request for "textDocument/didOpen": {"textDocument":{"uri":"file:///home/pgreda/terraform/k8s-calico-testdrive/test.tf","languageId":"terraform","version":1,"text":"terraform {\n  required_version = \">=0.12.0\"\n}\n\nprovider \"aws\" {\n  profile = \"default\"\n  region  = var.region\n  \n}\n\nmr-typo\n\n"}}
2020/06/05 20:17:19 rpc_logger.go:29: Incoming notification for "textDocument/didOpen": {"textDocument":{"uri":"file:///home/pgreda/terraform/k8s-calico-testdrive/test.tf","languageId":"terraform","version":1,"text":"terraform {\n  required_version = \">=0.12.0\"\n}\n\nprovider \"aws\" {\n  profile = \"default\"\n  region  = var.region\n  \n}\n\nmr-typo\n\n"}}
2020/06/05 20:17:19 schema_storage.go:116: error obtaining schemas: Unable to retrieve schemas: failed to get schemas: terraform (pid 4287) exited (code 1): exit status 1
stdout: ""
stderr: "\x1b[31m\n\x1b[1m\x1b[31mError: \x1b[0m\x1b[0m\x1b[1mArgument or block definition required\x1b[0m\n\n\x1b[0m  on test.tf line 11:\n  11: \x1b[4mmr-typo\x1b[0m\n\x1b[0m\nAn argument or block definition is required here. To set an argument, use the\nequals sign \"=\" to introduce the argument value.\n\x1b[0m\x1b[0m\n"
2020/06/05 20:17:27 server.go:469: Received 1 new requests
2020/06/05 20:17:27 server.go:165: Processing 1 requests
2020/06/05 20:17:27 server.go:223: Checking request for "textDocument/completion": {"textDocument":{"uri":"file:///home/pgreda/terraform/k8s-calico-testdrive/test.tf"},"position":{"line":7,"character":2},"context":{"triggerKind":1}}
2020/06/05 20:17:27 rpc_logger.go:29: Incoming request for "textDocument/completion" (ID 1): {"textDocument":{"uri":"file:///home/pgreda/terraform/k8s-calico-testdrive/test.tf"},"position":{"line":7,"character":2},"context":{"triggerKind":1}}
2020/06/05 20:17:27 complete.go:37: Finding block at position lsp.TextDocumentPositionParams{TextDocument:lsp.TextDocumentIdentifier{URI:"file:///home/pgreda/terraform/k8s-calico-testdrive/test.tf"}, Position:lsp.Position{Line:7, Character:2}}
2020/06/05 20:17:27 parser.go:191: Parsed block type: "provider"
2020/06/05 20:17:27 schema_storage.go:159: Reading "aws" provider schema
2020/06/05 20:17:27 schema_storage.go:145: Acquiring semaphore before reading schema
2020/06/05 20:17:27 rpc_logger.go:45: Error for "textDocument/completion" (ID 1): [-32098] finding completion items failed: no schema available
2020/06/05 20:17:27 server.go:204: Completed 1 requests [855.9µs elapsed]
[Error - 8:17:27 PM] Request textDocument/completion failed.
  Message: finding completion items failed: no schema available
  Code: -32098 
2020/06/05 20:17:36 server.go:469: Received 1 new requests
2020/06/05 20:17:36 server.go:165: Processing 1 requests
2020/06/05 20:17:36 server.go:223: Checking request for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/terraform/k8s-calico-testdrive/test.tf","version":2},"contentChanges":[{"range":{"start":{"line":9,"character":0},"end":{"line":12,"character":0}},"rangeLength":10,"text":""}]}
2020/06/05 20:17:36 rpc_logger.go:29: Incoming notification for "textDocument/didChange": {"textDocument":{"uri":"file:///home/pgreda/terraform/k8s-calico-testdrive/test.tf","version":2},"contentChanges":[{"range":{"start":{"line":9,"character":0},"end":{"line":12,"character":0}},"rangeLength":10,"text":""}]}
2020/06/05 20:17:38 server.go:469: Received 1 new requests
2020/06/05 20:17:38 server.go:165: Processing 1 requests
2020/06/05 20:17:38 server.go:223: Checking request for "workspace/didChangeWatchedFiles": {"changes":[{"uri":"file:///home/pgreda/terraform/k8s-calico-testdrive/test.tf","type":2}]}
2020/06/05 20:17:38 server.go:245: Task error: [-32601] no such method "workspace/didChangeWatchedFiles"
2020/06/05 20:17:49 server.go:469: Received 1 new requests
2020/06/05 20:17:49 server.go:165: Processing 1 requests
2020/06/05 20:17:49 server.go:223: Checking request for "textDocument/completion": {"textDocument":{"uri":"file:///home/pgreda/terraform/k8s-calico-testdrive/test.tf"},"position":{"line":7,"character":2},"context":{"triggerKind":1}}
2020/06/05 20:17:49 rpc_logger.go:29: Incoming request for "textDocument/completion" (ID 2): {"textDocument":{"uri":"file:///home/pgreda/terraform/k8s-calico-testdrive/test.tf"},"position":{"line":7,"character":2},"context":{"triggerKind":1}}
2020/06/05 20:17:49 complete.go:37: Finding block at position lsp.TextDocumentPositionParams{TextDocument:lsp.TextDocumentIdentifier{URI:"file:///home/pgreda/terraform/k8s-calico-testdrive/test.tf"}, Position:lsp.Position{Line:7, Character:2}}
2020/06/05 20:17:49 parser.go:191: Parsed block type: "provider"
2020/06/05 20:17:49 schema_storage.go:159: Reading "aws" provider schema
2020/06/05 20:17:49 schema_storage.go:145: Acquiring semaphore before reading schema
2020/06/05 20:17:49 rpc_logger.go:45: Error for "textDocument/completion" (ID 2): [-32098] finding completion items failed: no schema available
2020/06/05 20:17:49 server.go:204: Completed 1 requests [1.2205ms elapsed]
[Error - 8:17:49 PM] Request textDocument/completion failed.
  Message: finding completion items failed: no schema available
  Code: -32098 

The output has been created by launching VSCode with following tf file:

terraform {
  required_version = ">=0.12.0"
}

provider "aws" {
  profile = "default"
  region  = var.region
  
}

mr-typo

Behavior

When loading a broken tf file the language server won't obtain schema. It won't attempt to retry even if the file is corrected. Restart of VSCode is required to restore proper functioning of the plugin.

Use case:
Sysops is in the middle of creating a tf file. He must interrupt what he is doing/his battery runs out of juice/something crashes. When he opens the VSCode the plugin is broken, autocompletion doesn't work, etc. She/He must find the error, correct it and restart VSCode to get everything working again.

@radeksimko
Copy link
Member

Hi @pgreda
Thank you for taking the time to try out the early release candidate of the extension and the LS!

I believe that what you described is covered in the following two issues:

With that in mind, are you happy for me to close this issue and keep the conversation in the above two issues?

@radeksimko radeksimko added the question Further information is requested label Jun 5, 2020
@pgreda
Copy link
Author

pgreda commented Jun 6, 2020

Sure. That's ok.

@pgreda pgreda closed this as completed Jun 6, 2020
@ghost
Copy link

ghost commented Jul 6, 2020

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 and limited conversation to collaborators Jul 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants