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 suppress "not inited workspace error" #170

Closed
EPinci opened this issue Jun 18, 2020 · 2 comments
Closed

Unable to suppress "not inited workspace error" #170

EPinci opened this issue Jun 18, 2020 · 2 comments

Comments

@EPinci
Copy link

EPinci commented Jun 18, 2020

Server Version

0.3.2

Terraform Version

0.12.26

Client Version

VS Code 1.46.0

Terraform Configuration Files

Not relevant.

Log Output

Launching language server: c:\Users\EPinci\.vscode\extensions\hashicorp.terraform-2.0.1/lsp/terraform-ls serve
2020/06/18 16:15:29 service.go:63: Preparing new session ...
2020/06/18 16:15:29 langserver.go:79: Starting server (pid 16764) ...
2020/06/18 16:15:29 server.go:469: Received 1 new requests
2020/06/18 16:15:29 server.go:165: Processing 1 requests
2020/06/18 16:15:29 server.go:223: Checking request for "initialize": {"processId":15672,"rootPath":"d:\\K\\code","rootUri":"file:///d%3A/K/code","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:///d%3A/K/code","name":"code"}]}
2020/06/18 16:15:29 rpc_logger.go:29: Incoming request for "initialize" (ID 0): {"processId":15672,"rootPath":"d:\\K\\code","rootUri":"file:///d%3A/K/code","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:///d%3A/K/code","name":"code"}]}
2020/06/18 16:15:29 exec.go:176: Starting D:\K\bin\terraform.exe ["terraform" "version"] in "C:\\Users\\EPinci\\AppData\\Local\\Temp"...
2020/06/18 16:15:29 exec.go:142: Waiting for command to finish ...
2020/06/18 16:15:30 exec.go:168: terraform run (D:\K\bin\terraform.exe ["terraform" "version"], in "C:\\Users\\EPinci\\AppData\\Local\\Temp", pid 20564) finished with exit code 0
2020/06/18 16:15:30 initialize.go:90: Found compatible Terraform version (0.12.26) at D:\K\bin\terraform.exe
2020/06/18 16:15:30 schema_storage.go:334: Adding workspace for watching: "d:\\K\\code"
2020/06/18 16:15:30 watcher.go:88: Adding "d:\\K\\code\\.terraform\\plugins\\windows_amd64\\lock.json" for watching...
2020/06/18 16:15:30 rpc_logger.go:45: Error for "initialize" (ID 0): [-32098] Workspace not initialized. Please run `terraform init` in d:\K\code
2020/06/18 16:15:30 server.go:204: Completed 1 requests [1.7119987s elapsed]
[Error - 16:15:30] Server initialization failed.
  Message: Workspace not initialized. Please run `terraform init` in d:\K\code
  Code: -32098 
2020/06/18 16:15:30 schema_storage.go:124: Acquiring semaphore before retrieving schema for "d:\\K\\code" ...
2020/06/18 16:15:30 schema_storage.go:133: Retrieving schemas for "d:\\K\\code" ...
2020/06/18 16:15:30 exec.go:176: Starting D:\K\bin\terraform.exe ["terraform" "providers" "schema" "-json"] in "d:\\K\\code"...
2020/06/18 16:15:30 exec.go:142: Waiting for command to finish ...
2020/06/18 16:15:30 server.go:469: Received 1 new requests
2020/06/18 16:15:30 server.go:165: Processing 1 requests
2020/06/18 16:15:30 server.go:223: Checking request for "shutdown": 
2020/06/18 16:15:30 rpc_logger.go:29: Incoming request for "shutdown" (ID 1): 
2020/06/18 16:15:30 rpc_logger.go:50: Response to "shutdown" (ID 1): null
2020/06/18 16:15:30 server.go:204: Completed 1 requests [997.3µs elapsed]
2020/06/18 16:15:30 server.go:469: Received 1 new requests
2020/06/18 16:15:30 server.go:165: Processing 1 requests
2020/06/18 16:15:30 server.go:223: Checking request for "exit": 
2020/06/18 16:15:30 rpc_logger.go:29: Incoming notification for "exit": 
2020/06/18 16:15:30 schema_storage.go:116: error obtaining schemas: Unable to retrieve schemas: failed to get schemas: Execution of ["terraform" "providers" "schema" "-json"] canceled.
exit status 1

Issue

Issue is that whenever you edit a folder with a non inited workspace such as:

  • a root folder of a code structure that contains a subfolder with terraform manifest
  • a folder with terraform manifest that are not supposed to be inited, at lease in the machine where they are being edited
    the error is raised with no way of suppressing it and is brought to the front of the active code window.
@radeksimko
Copy link
Member

radeksimko commented Jun 18, 2020

Hi @EPinci
The problem you are experiencing has two folded solution:

With that in mind I'm going to close this issue, but I recommend following #83 and/or #32

@ghost
Copy link

ghost commented Jul 18, 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 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants