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

Language server crashes when using azure storage account blob container in vscode workspace #959

Closed
TeamDman opened this issue Jun 19, 2022 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@TeamDman
Copy link

Server Version

0.28.1

Terraform Version

Terraform v1.2.3
on windows_amd64

Client Version

VSCode

image

Azure Storage extension
v0.14.1

Terraform Configuration Files

an empty "a.tf" file can reproduce

Log Output

https://gist.github.com/TeamDman/3d8684494d05b2a3f098410da395ee6c

Expected Behavior

no crash

Actual Behavior

crash

Steps to Reproduce

  1. Add azure storage extension
  2. use azure tab in vscode to find a storage account blob container and add it to your workspace so you have a local folder open with an empty .tf file and you also have the storage account blob container open
  3. Terraform language server stops working
@radeksimko radeksimko added the bug Something isn't working label Jun 19, 2022
@radeksimko
Copy link
Member

I managed to reproduce this by following the steps attached. Thank you for the report.

I can also confirm that this is indeed related to the Azure Storage extension, which for some reason seems to produce invalid URIs (it's missing one extra /).

{
	"uri": "azurestorage:/%24web?resourceId%3D%2Fsubscriptions%2F134ae9a1-7bc2-41f7-a2c7-a1e55f54ed04%2Fmicrosoft.storage%2Fstorageaccounts%2Fsubscriptions%2F134ae9a1-7bc2-41f7-a2c7-a1e55f54ed04%2FresourceGroups%2Fca.teamdman%2Fproviders%2FMicrosoft.Storage%2FstorageAccounts%2Fsite502022%2FBlob%20Containers%2F%24web",
	"name": "$web"
}

We could avoid the crash by ignoring any workspace which has invalid URI, but I think we should still raise it as a visible warning to the user.

Relatedly I think that the Azure Storage extension should generate valid URIs - i.e. I would treat that as a bug on their side.


The follow-up question - assuming the workspace has a valid URI, is whether we could/should somehow support editing of Terraform files within such a workspace. I will create a separate issue for that as I believe this is not related just to Azure Storage, but other kinds of remote workspaces.

@radeksimko
Copy link
Member

radeksimko commented Jul 1, 2022

We have fixed the crash as part of #969 - so the next LS release (0.29.0) should only raise warnings, but more importantly the next release of the VS Code extension (v2.24.0) and latest preview version should not be sending URIs like these to the language server at all. This was addressed as part of hashicorp/vscode-terraform#1163

You can either wait for these next releases, or try out the preview in the meantime:
https://marketplace.visualstudio.com/items?itemName=HashiCorp.terraform-preview

@radeksimko radeksimko added this to the v0.29.0 milestone Jul 1, 2022
@github-actions
Copy link

github-actions bot commented Aug 1, 2022

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

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants
@radeksimko @TeamDman and others