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

Workspace not initialized #175

Closed
yerzhant opened this issue Jun 20, 2020 · 4 comments
Closed

Workspace not initialized #175

yerzhant opened this issue Jun 20, 2020 · 4 comments

Comments

@yerzhant
Copy link

Server Version

0.3.2

Terraform Version

Terraform v0.12.26

Client Version

Terraform Visual Studio Code Extension v2.0.1

Terraform Configuration Files

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

Log Output

Launching language server: /home/yerzhan/.vscode/extensions/hashicorp.terraform-2.0.1/lsp/terraform-ls serve
2020/06/12 06:30:46 service.go:63: Preparing new session ...
2020/06/12 06:30:46 langserver.go:79: Starting server (pid 20873) ...
2020/06/12 06:30:46 server.go:469: Received 1 new requests
2020/06/12 06:30:46 server.go:165: Processing 1 requests
2020/06/12 06:30:46 server.go:223: Checking request for "initialize": {"processId":20615,"rootPath":"/home/yerzhan/projects/nurbus/nurbus-infra","rootUri":"file:///home/yerzhan/projects/nurbus/nurbus-infra","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/yerzhan/projects/nurbus/nurbus-infra","name":"nurbus-infra"}]}
2020/06/12 06:30:46 rpc_logger.go:29: Incoming request for "initialize" (ID 0): {"processId":20615,"rootPath":"/home/yerzhan/projects/nurbus/nurbus-infra","rootUri":"file:///home/yerzhan/projects/nurbus/nurbus-infra","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/yerzhan/projects/nurbus/nurbus-infra","name":"nurbus-infra"}]}
2020/06/12 06:30:46 exec.go:176: Starting /home/yerzhan/bin/terraform ["terraform" "version"] in "/tmp"...
2020/06/12 06:30:46 exec.go:142: Waiting for command to finish ...
2020/06/12 06:30:46 exec.go:168: terraform run (/home/yerzhan/bin/terraform ["terraform" "version"], in "/tmp", pid 20882) finished with exit code 0
2020/06/12 06:30:46 initialize.go:90: Found compatible Terraform version (0.12.26) at /home/yerzhan/bin/terraform
2020/06/12 06:30:46 schema_storage.go:334: Adding workspace for watching: "/home/yerzhan/projects/nurbus/nurbus-infra"
2020/06/12 06:30:46 watcher.go:88: Adding "/home/yerzhan/projects/nurbus/nurbus-infra/.terraform/plugins/linux_amd64/lock.json" for watching...
2020/06/12 06:30:46 rpc_logger.go:45: Error for "initialize" (ID 0): [-32098] Workspace not initialized. Please run `terraform init` in /home/yerzhan/projects/nurbus/nurbus-infra
2020/06/12 06:30:46 server.go:204: Completed 1 requests [27.802121ms elapsed]
2020/06/12 06:30:46 schema_storage.go:124: Acquiring semaphore before retrieving schema for "/home/yerzhan/projects/nurbus/nurbus-infra" ...
2020/06/12 06:30:46 schema_storage.go:133: Retrieving schemas for "/home/yerzhan/projects/nurbus/nurbus-infra" ...
2020/06/12 06:30:46 exec.go:176: Starting /home/yerzhan/bin/terraform ["terraform" "providers" "schema" "-json"] in "/home/yerzhan/projects/nurbus/nurbus-infra"...
[Error - 06:30:46] Server initialization failed.
  Message: Workspace not initialized. Please run `terraform init` in /home/yerzhan/projects/nurbus/nurbus-infra
  Code: -32098 
2020/06/12 06:30:46 exec.go:142: Waiting for command to finish ...
2020/06/12 06:30:46 server.go:469: Received 1 new requests
2020/06/12 06:30:46 server.go:165: Processing 1 requests
2020/06/12 06:30:46 server.go:223: Checking request for "shutdown": 
2020/06/12 06:30:46 rpc_logger.go:29: Incoming request for "shutdown" (ID 1): 
2020/06/12 06:30:46 rpc_logger.go:50: Response to "shutdown" (ID 1): null
2020/06/12 06:30:46 server.go:204: Completed 1 requests [79.298µs elapsed]
2020/06/12 06:30:46 server.go:469: Received 1 new requests
2020/06/12 06:30:46 server.go:165: Processing 1 requests
2020/06/12 06:30:46 server.go:223: Checking request for "exit": 
2020/06/12 06:30:46 rpc_logger.go:29: Incoming notification for "exit": 
2020/06/12 06:30:46 schema_storage.go:116: error obtaining schemas: Unable to retrieve schemas: failed to get schemas: Execution of ["terraform" "providers" "schema" "-json"] canceled.
signal: killed

Expected Behavior

No such errors and working auto completion.

Actual Behavior

There's no auto completion and on VSCode startup constantly pops up Output pane with error logs as pointed out above.

Steps to Reproduce

Upgrade terraform to v0.12.26.

@yerzhant
Copy link
Author

@yerzhant
Copy link
Author

@radeksimko
Copy link
Member

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

With that in mind I'm going to close this issue, but I recommend following #32 for updates.

@ghost
Copy link

ghost commented Jul 20, 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 20, 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