Troubleshooting
Please try the following troubleshooting steps and if they don't help, either create an issue or join our community Slack channel - we'll help you very quickly ๐๐
1. Enable additional loggingโ
If the Infracost CLI fails, re-run it with --log-level=debug
or the INFRACOST_LOG_LEVEL=debug
environment variable in case that provides helpful details.
If the Terraform CLI fails, check their debugging page for help. Likewise, if the Terragrunt CLI fails, check their debugging page for help.
2. Generating plan JSON filesโ
By default, the Infracost CLI parses Terraform HCL code to estimate costs. If that does not work for your use-case, Infracost can also parse the Terraform/Terragrunt plan JSON file.
If you have multiple Terraform plan JSON files, you can
- run
infracost breakdown
with--path plan-1.json --format json --out-file infracost-1.json
to generate an Infracost JSON file for each. - run
infracost output
with--path "infracost-*.json" --format diff
(glob patterns need quotes) to combine the Infracost JSON files into one output format then use that file withinfracost comment
. Theinfracost output --help
command shows the other options.
3. Check supported versionsโ
Check the Terraform version matches what you expect. Infracost works with Terraform v0.12 and above.
Use ls -lah
in the CI build to check for any .terraform*
files/folders that might be confusing Terraform running in CI vs previous runs that were used to create them. Removing those files might help.
4. Posting commentsโ
If you're having issues posting pull request comments, please review the troubleshooting section for your version control system:
- GitHub
- GitLab
- Azure Repos
- Bitbucket > see the Troubleshooting section
5. Infracost Cloud dashboardโ
Try the following troubleshooting steps and join our community Slack channel - we'll help you very quickly ๐๐
If Infracost is erroring or running too slow, email us at hello@infracost.io so we can arrange a debugging session with you quickly.
If your pull requests comments are being posted but they are not showing in the dashboard, ensure that the:
- In Infracost Cloud's Org settings page, the cost estimate dashboard is enabled.
- Infracost CLI version (
infracost --version
) being used is latest patch version of v0.10. - Required environment variables are set before theย
infracost breakdown
andinfracost diff
ย commands are run. You can verify this by runningยcat infracost.json | jq .metadata
orinfracost breakdown --path /code --format json | jq .metadata
and checking the Infracost JSON block shows your pull request metadata. - Either
infracost comment
orinfracost upload
is used in your CI/CD integration. If Infracost Cloud is enabled (step 1 above), these commands send the Infracost JSON data to your organization in Infracost Cloud.