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

Infracost v0.10.33 being Killed #2882

Open
mapperCoderZ opened this issue Feb 15, 2024 · 17 comments
Open

Infracost v0.10.33 being Killed #2882

mapperCoderZ opened this issue Feb 15, 2024 · 17 comments
Labels
azure Issue relates to Microsoft Azure bug Something isn't working

Comments

@mapperCoderZ
Copy link

mapperCoderZ commented Feb 15, 2024

Hello.

I have an infracost command failing on v0.10.33 but not failing with v0.10.31.
We try to validate our terraform base cost on last version of terraform inside a docker container ARM64 and AMD64. We use azure rm provider.

here is my pipeline logs:

rm -f /tmp/infracost-base.json && infracost breakdown --path /wspace/az-tf/infra/zones/azure/mkp-int1 --terraform-var-file /wspace/az-tf/mkp-hpr/azure/mkp-int1/terraform.tfvars
2024-02-15T16:37:32Z INF Evaluating Terraform directory at /builds/infra-cloud/april-gitops-env-mkp-hpr/infra/zones/azure/mkp-int1
2024-02-15T16:37:32Z INF Starting: Downloading Terraform modules
...
2024-02-15T16:39:04Z WRN Using eastus for resource module.application_gateway.azurerm_private_dns_a_record.private_dns_zone_record_application_digital["asp-conn"] as its 'location' property could not be found.
❌ Command "infracost breakdown --path /builds/infra-cloud/april-gitops-env-mkp-hpr/infra/zones/azure/mkp-int1 --terraform-var-file /builds/infra-cloud/april-gitops-env-mkp-hpr/mkp-hpr/azure/mkp-int1/terraform.tfvars --format=json --out-file /tmp/infracost-base.json > /dev/null" failed

Locally, I have this error without other message:
Killed

Can you have a look ?

@vdmgolub
Copy link
Contributor

Hi! Thanks for creating the issue.

Unfortunately, it's pretty hard to debug such issues without the code. Could you please try rerunning it with --log-level=debug or the INFRACOST_LOG_LEVEL=debug env var to see if it provides more info? You can also join our community Slack and find us on the #help channel if you're not comfortable sharing the logs here.

@vdmgolub vdmgolub added the azure Issue relates to Microsoft Azure label Feb 15, 2024
@mapperCoderZ
Copy link
Author

t's really painfull to debug such things in our enterprise environment. The debug logs are very long and I need to relaunch. Code base is large, the default stderr output should be improved

@mapperCoderZ
Copy link
Author

Maybe the process takes too much memory ?

@vdmgolub
Copy link
Contributor

This is possible if you have a huge repo. Maybe you'll be able to run this command tree -P '*.hcl|*.tf|*.tfvars|*.tfvars.json|*.json' --prune and send us the tree output, so we can see the repo structure?

@vdmgolub
Copy link
Contributor

@mapperCoderZ If it makes things easier, we could screenshare. Please drop a message to [email protected] and we'll send a Calendly link to set it up. Thanks!

@alikhajeh1
Copy link
Member

@mapperCoderZ just adding to what @vdmgolub mentioned, I think you're already an Infracost Cloud customer - email us and we'll arrange a quick debugging session and get you to success 🚀

@matthieupetite
Copy link
Contributor

Hello I have reproduce the case and indeed revert to v31 is a good workaround and we also revert the infracost vscode extension to v20. I try to send to you the whole debug script

@matthieupetite
Copy link
Contributor

here is the command I launched
image

here is the content of my configuration file:

`version: 0.1
projects:

  • path: /wspace/az-tf/infra/zones/azure/mkp-int1
    name: mkp-int1
    usage_file: /wspace/az-tf/mkp-hpr/azure/mkp-int1/infracost-usage.yml
    terraform_var_files:
    • /wspace/az-tf/mkp-hpr/azure/mkp-int1//terraform.tfvars
  • path: /wspace/az-tf/infra/zones/azure/mkp-int2
    name: mkp-int2
    usage_file: /wspace/az-tf/mkp-hpr/azure/mkp-int2/infracost-usage.yml
    terraform_var_files:
    • /wspace/az-tf/mkp-hpr/azure/mkp-int2/terraform.tfvars
  • path: /wspace/az-tf/infra/zones/azure/mkp-rec1
    name: mkp-rec1
    usage_file: /wspace/az-tf/mkp-hpr/azure/mkp-rec1/infracost-usage.yml
    terraform_var_files:
    • /wspace/az-tf/mkp-hpr/azure/mkp-rec1/terraform.tfvars
  • path: /wspace/az-tf/infra/zones/azure/mkp-rec2
    name: mkp-rec2
    usage_file: /wspace/az-tf/mkp-hpr/azure/mkp-rec2/infracost-usage.yml
    terraform_var_files:
    • /wspace/az-tf/mkp-hpr/azure/mkp-rec2/terraform.tfvars
  • path: /wspace/az-tf/infra/zones/azure/mkp-ppr
    name: mkp-ppr
    usage_file: /wspace/az-tf/mkp-ppr/azure/mkp-ppr/infracost-usage.yml
    terraform_var_files:
    • /wspace/az-tf/mkp-ppr/azure/mkp-ppr/terraform.tfvars
  • path: /wspace/az-tf/infra/zones/azure/mkp-pro
    name: mkp-pro
    usage_file: /wspace/az-tf/mkp-pro/azure/mkp-pro/infracost-usage.yml
    terraform_var_files:
    • /wspace/az-tf/mkp-pro/azure/mkp-pro/terraform.tfvars
      `

you will find the log file attached in this post
infracost.log.gz

@matthieupetite
Copy link
Contributor

I noticed the same sort of issue in the vscode tasks

@hugorut hugorut added the bug Something isn't working label Feb 20, 2024
@hugorut
Copy link
Contributor

hugorut commented Feb 20, 2024

Thanks @matthieupetite, what happens if you run the infracost breakdown on v31 with the following env variable: INFRACOST_GRAPH_EVALUATOR=true? Do you still see killed?

@matthieupetite
Copy link
Contributor

image

I don't have any issue with that configuration the command runs successfully

image

@hugorut
Copy link
Contributor

hugorut commented Feb 21, 2024

Thanks @matthieupetite, ok a follow up with two questions:

  1. if you modify your config file and add the key skip_autodetect: true to each defined project, then rerun the breakdown (without the INFRACOST_GRAPH_EVALUATOR env), does this work?
  2. What happens if you run infracost breakdown --path /wspace/az-tf (again without the INFRACOST_GRAPH_EVALUATOR env)

🙏

@matthieupetite
Copy link
Contributor

Hi Hugo thanks for your support. I will be able to make that test Monday and I will share the result here

@matthieupetite
Copy link
Contributor

Hi Hugo, I have test your procedure and with the new version of Infracost and It is failling now

@matthieupetite
Copy link
Contributor

Hi all, any news on that subject ?

@aliscott
Copy link
Member

@matthieupetite we've not got to the bottom of it yet, but it's on our current sprint to investigate further so I will reach out to you sometime in the next 2 weeks.

@matthieupetite
Copy link
Contributor

@matthieupetite we've not got to the bottom of it yet, but it's on our current sprint to investigate further so I will reach out to you sometime in the next 2 weeks.

thanks a lot

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

No branches or pull requests

6 participants