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

the extension should allow workspaces with no tf scripts on the root level #355

Closed
junior opened this issue Jun 9, 2020 · 2 comments
Closed

Comments

@junior
Copy link

junior commented Jun 9, 2020

Currently the 2.0.0-rc.2 returns an error if there's no terraform scripts on the root level.

It's common to open the vscode, and the terraform scripts residing on sub-folders.

e.g.:

/
|---/images
|---/terraform
|---/somethingelse

Even if the sub-folder with terraform scripts being previously terraform init, the error occurs.

A VSCode Notification with the message:

"❌ Workspace not initialized. Please run 'terraform ini' in /...".

And, of course, if you try to terraform init on the root level says that is terraform empty.

Error:

2020/06/09 12:50:25 exec.go:142: Waiting for command to finish ...
[Error - 12:50:25 PM] Server initialization failed.
  Message: Workspace not initialized. Please run `terraform init` in /Users/xxx/terraform-Playground
  Code: -32098 
2020/06/09 12:50:25 server.go:469: Received 1 new requests
2020/06/09 12:50:25 server.go:165: Processing 1 requests
2020/06/09 12:50:25 server.go:223: Checking request for "shutdown": 
2020/06/09 12:50:25 rpc_logger.go:29: Incoming request for "shutdown" (ID 1): 
2020/06/09 12:50:25 rpc_logger.go:50: Response to "shutdown" (ID 1): null
2020/06/09 12:50:25 server.go:204: Completed 1 requests [214.997µs elapsed]
2020/06/09 12:50:25 server.go:469: Received 1 new requests
2020/06/09 12:50:25 server.go:165: Processing 1 requests
2020/06/09 12:50:25 server.go:223: Checking request for "exit": 
2020/06/09 12:50:25 rpc_logger.go:29: Incoming notification for "exit": 
2020/06/09 12:50:25 schema_storage.go:116: error obtaining schemas: Unable to retrieve schemas: failed to get schemas: Execution of ["terraform" "providers" "schema" "-json"] canceled.
signal: killed

Steps to replicate:

  • create a folders with files that are not terraform scripts
  • create a sub-folder test/terraform with the terraform scripts
  • run terraform init on the terraform sub-folder
  • open vscode with the vscode-terraform extension enabled
@junior junior changed the title the extension should allow workspaces with scripts on the root level the extension should allow workspaces with no tf scripts on the root level Jun 9, 2020
@radeksimko
Copy link
Member

Hi @junior
Thank you for trying out the new release candidate and providing that early feedback!

You are absolutely right that we should support the setup you described without errors. There are existing issues tracking the work towards solving this:

Generally speaking this is something we need to solve on the server side, rather than in the extension and I would encourage you to subscribe to the linked issues until we do so.

With that in mind I'm going to close this issue.

@ghost
Copy link

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