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

Extension errors and does not show cost analysis above resources in editor #166

Open
dennislaf opened this issue Jun 28, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@dennislaf
Copy link

Having trouble with the vscode extension. the left sidebar is showing all my directories and their associated costs, but in the editor i am not getting any real time update info, it’s just the normal text editor. i get no pop ups or “total monthly cost” line to click to break down.

Screen Shot 2023-06-28 at 11 43 03 AM

vscode version: 1.79.2
infracost extension: v0.2.13
terraform extension v2.26.1
macos 12.6.2

I am seeing errors in the extension debug logs from the terraform extension every time infracost runs an update after I save

errors I am seeing:
2023-06-28 11:57:29.234 [error] [hashicorp.terraform] provider FAILED
2023-06-28 11:57:29.234 [error] Error: main.tf (49,25): position outside of any attribute name, value or block
at /Users/xxx/.vscode/extensions/hashicorp.terraform-2.26.1-darwin-x64/out/extension.js:1:387194
at re (/Users/xxx/.vscode/extensions/hashicorp.terraform-2.26.1-darwin-x64/out/extension.js:1:387488)
at /Users/xxx/.vscode/extensions/hashicorp.terraform-2.26.1-darwin-x64/out/extension.js:1:382272
at Immediate. (/Users/xxx/.vscode/extensions/hashicorp.terraform-2.26.1-darwin-x64/out/extension.js:1:382292)
at process.processImmediate (node:internal/timers:466:21)

after uninstall and reinstall of both infracost and terraform extensions, i am seeing a new error:
2023-06-28 12:05:55.059 [error] [hashicorp.terraform] provider FAILED
2023-06-28 12:05:55.059 [error] Error: no reference origin found
at /Users/xxx/.vscode/extensions/hashicorp.terraform-2.26.1-darwin-x64/out/extension.js:1:387194
at re (/Users/xxx/.vscode/extensions/hashicorp.terraform-2.26.1-darwin-x64/out/extension.js:1:387488)
at /Users/xxx/.vscode/extensions/hashicorp.terraform-2.26.1-darwin-x64/out/extension.js:1:382272
at Immediate. (/Users/xxx/.vscode/extensions/hashicorp.terraform-2.26.1-darwin-x64/out/extension.js:1:382292)
at process.processImmediate (node:internal/timers:466:21)

@hugorut hugorut added the bug Something isn't working label Jun 29, 2023
@hugorut
Copy link
Collaborator

hugorut commented Jun 29, 2023

Thanks @dennislaf, as mentioned on our slack conversation this looks like something going wrong with the Terraform extension which we use to get the file symbols so that we can show the code lens. Give me some time to replicate this and work out possible solutions. Just for further context, what does the Infracost error logs show?

@dennislaf
Copy link
Author

debug: found project <directory> 
debug: adding file: <directory> to project: <directory> (several of these logs)
debug: setting context infracost:error to undefined

@alikhajeh1
Copy link
Member

A user reported an issue that might be related?

image

debug: running "infracost breakdown --config-file d:\xxx\xxx\GLOBAL-INFRA\infracost.yml"
debug: found project GLOB - Dev - AU
...
debug: adding file: d:\xxx\xxx\GLOBAL-INFRA\env\.modules\applications\xxx\main.tf to project: d:\xxx\xxx\GLOBAL-INFRA\env
debug: rebuilding Infracost tree view after project run
debug: setting context infracost:error to undefined
Infracost Extension version: 0.2.17
Hashicorp Terraform Extension version: v2.27.2
Edition	Windows 11 Enterprise
Version	22H2
Installed on	‎29/‎06/‎2023
OS build	22621.2134
Experience	Windows Feature Experience Pack 1000.22659.1000.0

@hugorut
Copy link
Collaborator

hugorut commented Sep 27, 2023

hi @dennislaf, we've released a fix in v0.2.18 for the issue @alikhajeh1 mentioned. It might solve your issue, if you could download it and give it a whirl that would be much appreciated. Otherwise I'm working on dropping the hashicorp extension dependency, which should hopefully fix this issue for good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants