hashicorp / terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
https://www.terraform.io/
Other
42.66k stars 9.55k forks source link

crash during plan #30662

Closed hickmant6 closed 2 years ago

hickmant6 commented 2 years ago

Terraform Version

...
Terraform v0.15.5
on windows_amd64
+ provider registry.terraform.io/hashicorp/aws v4.5.0
+ provider registry.terraform.io/hashicorp/external v2.2.0
+ provider registry.terraform.io/hashicorp/random v3.1.0
+ provider registry.terraform.io/venafi/venafi v0.14.0

Your version of Terraform is out of date! The latest version
is 1.1.7. You can update by downloading from https://www.terraform.io/downloads.html

Terraform Configuration Files

...
[terraform-module-venafi-certificate.zip](https://github.com/hashicorp/terraform/files/8236763/terraform-module-venafi-certificate.zip)

Debug Output

crash.814906698.log

Expected Behavior

successful plan

Actual Behavior

>tf15 plan -var-file=.\example\example.tfvars  
panic: dots are not allowed

goroutine 261 [running]:
github.com/hashicorp/terraform/internal/addrs.MustParseProviderPart(0xc00012e588, 0x8, 0x2a682f717d8, 0x10)
        /home/circleci/project/project/internal/addrs/provider.go:449 +0xae
github.com/hashicorp/terraform/internal/addrs.NewDefaultProvider(...)
        /home/circleci/project/project/internal/addrs/provider.go:122
github.com/hashicorp/terraform/internal/addrs.ImpliedProviderForUnqualifiedType(0xc00012e588, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /home/circleci/project/project/internal/addrs/provider.go:114 +0x9d
github.com/hashicorp/terraform/internal/terraform.(*NodeAbstractResourceInstance).Provider(0xc0001ff180, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /home/circleci/project/project/internal/terraform/node_resource_abstract_instance.go:139 +0x10f
github.com/hashicorp/terraform/internal/terraform.(*MissingProviderTransformer).Transform(0xc0017bf860, 0xc0006c6400, 0xc0026dfa30, 0x1)
        /home/circleci/project/project/internal/terraform/transform_provider.go:329 +0x142
github.com/hashicorp/terraform/internal/terraform.(*graphTransformerMulti).Transform(0xc0003fe900, 0xc0006c6400, 0xc0026dfb58, 0x1)
        /home/circleci/project/project/internal/terraform/transform.go:34 +0x112
github.com/hashicorp/terraform/internal/terraform.(*BasicGraphBuilder).Build(0xc0026dfbd8, 0x0, 0x0, 0x0, 0xc000746cf0, 0xc0026dfc08, 0xc000080800, 0x0)
        /home/circleci/project/project/internal/terraform/graph_builder.go:41 +0x372
github.com/hashicorp/terraform/internal/terraform.(*PlanGraphBuilder).Build(0xc000746cf0, 0x0, 0x0, 0x0, 0x1, 0x30005, 0x0, 0x2030001)
        /home/circleci/project/project/internal/terraform/graph_builder_plan.go:77 +0xc5
github.com/hashicorp/terraform/internal/terraform.(*Context).Graph(0xc000d00300, 0x27aa801, 0xc0026dfc5e, 0x0, 0x2a6aa35edd8, 0x10, 0x10)
        /home/circleci/project/project/internal/terraform/context.go:410 +0x531
github.com/hashicorp/terraform/internal/terraform.(*Context).plan(0xc000d00300, 0xc0017bf710, 0x4, 0xc002730360, 0xc0001af830)
        /home/circleci/project/project/internal/terraform/context.go:658 +0x55
github.com/hashicorp/terraform/internal/terraform.(*Context).Plan(0xc000d00300, 0x0, 0x0, 0x0, 0x0)
        /home/circleci/project/project/internal/terraform/context.go:615 +0x777
github.com/hashicorp/terraform/internal/backend/local.(*Local).opPlan.func2(0xc000d18240, 0xc000d00300, 0xc000158bf0, 0xc0003fe888)
        /home/circleci/project/project/internal/backend/local/backend_plan.go:82 +0x88
created by github.com/hashicorp/terraform/internal/backend/local.(*Local).opPlan
        /home/circleci/project/project/internal/backend/local/backend_plan.go:79 +0x309

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

Terraform crashed! This is always indicative of a bug within Terraform.
A crash log has been placed at "crash.814906698.log" relative to your current
working directory. It would be immensely helpful if you could please
report the crash with Terraform[1] so that we can fix this.

When reporting bugs, please include your terraform version. That
information is available on the first line of crash.log. You can also
get it by running 'terraform --version' on the command line.

SECURITY WARNING: the "crash.814906698.log" file that was created may contain
sensitive information that must be redacted before it is safe to share
on the issue tracker.

[1]: https://github.com/hashicorp/terraform/issues

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

Steps to Reproduce

terraform init terraform fmt -recursive .\ terraform plan -var-file=.\example\example.tfvars

Additional Context

no

References

not sure

jbardin commented 2 years ago

Hi @hickmant6,

Thanks for filing the issue. The example you've provided does not cause the crash shown with current versions of terraform. Since there have been numerous bug fixes released since v0.15.5, I would first suggest trying a current release. If that does not resolve the issue we can investigate further. I'm not sure how an invalid provider name could be arising from the configuration, so it may be stored in your current state.

Thanks!

amraside commented 2 years ago

Terraform CRASH while using terraform plan

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

Terraform crashed! This is always indicative of a bug within Terraform. Please report the crash with Terraform1 so that we can fix this.

When reporting bugs, please include your terraform version, the stack trace shown below, and any additional information which may help replicate the issue.

!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!

called IsLegacy() on zero-value addrs.Provider goroutine 13 [running]: runtime/debug.Stack() /usr/local/go/src/runtime/debug/stack.go:24 +0x83 runtime/debug.PrintStack() /usr/local/go/src/runtime/debug/stack.go:16 +0x1a github.com/hashicorp/terraform/internal/logging.PanicHandler() /home/circleci/project/project/internal/logging/panic.go:55 +0x147 panic({0x2bb6ce0, 0x340b4f0}) /usr/local/go/src/runtime/panic.go:1038 +0x1bc github.com/hashicorp/terraform/internal/addrs.Provider.IsLegacy(...) /home/circleci/project/project/internal/addrs/provider.go:204 github.com/hashicorp/terraform/internal/depsfile.ProviderIsLockable(...) /home/circleci/project/project/internal/depsfile/locks.go:218 github.com/hashicorp/terraform/internal/configs.(Config).VerifyDependencySelections(0x15a96380, 0x159458f0) /home/circleci/project/project/internal/configs/config.go:230 +0xecc github.com/hashicorp/terraform/internal/backend/local.(Local).localRunDirect(0x15c14000, 0x15c1a240, 0x15862930, 0x15abbe40, {0x3492c1c, 0x15852a00}) /home/circleci/project/project/internal/backend/local/backend_local.go:142 +0x169 github.com/hashicorp/terraform/internal/backend/local.(Local).localRun(0x15c14000, 0x15c1a240) /home/circleci/project/project/internal/backend/local/backend_local.go:98 +0x91e github.com/hashicorp/terraform/internal/backend/local.(Local).opPlan(0x15c14000, {0x345dff4, 0x15c18ff0}, {0x345dff4, 0x15c19020}, 0x15c1a240, 0x15bf3520) /home/circleci/project/project/internal/backend/local/backend_plan.go:58 +0x11e github.com/hashicorp/terraform/internal/backend/local.(Local).Operation.func1(0x15562e10, 0x15562e50, 0x15562e90, 0x15c14000, 0x15562dd0, {0x345dff4, 0x15c18ff0}, {0x345dff4, 0x15c19020}, 0x15c1a240, ...) /home/circleci/project/project/internal/backend/local/backend.go:323 +0xb5 created by github.com/hashicorp/terraform/internal/backend/local.(Local).Operation /home/circleci/project/project/internal/backend/local/backend.go:316 +0x358

amraside commented 2 years ago

Version is terraform_1.1.7_windows_386

crw commented 2 years ago

Hi @amraside, can you please open a new issue, following the new issue template, for your crash? It does not appear the same crash, we would like to keep the conversations separate for separate issues. Thanks!

jbardin commented 2 years ago

Closing since we have not heard back with a reproduction case for a current Terraform release. If you can reproduce this with the current release, please file a new issue with the requested information.

Thanks!

github-actions[bot] commented 2 years ago

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.