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

Panic: not a collection type #26120

Closed
bgmonroe opened this issue Sep 3, 2020 · 2 comments
Closed

Panic: not a collection type #26120

bgmonroe opened this issue Sep 3, 2020 · 2 comments
Labels
bug duplicate issue closed because another issue already tracks this problem

Comments

@bgmonroe
Copy link

bgmonroe commented Sep 3, 2020

Terraform Version

v0.13.1

Terraform Configuration Files

This was directly from the https://www.terraform.io/docs/providers/azurerm/d/subscription.html page

provider "azurerm" {
    features {}
}

data "azurerm_subscription" "current" {
}

output "current_subscription_display_name" {
  value = data.azurerm_subscription.current.display_name
}

Debug Output

Crash Output

https://gist.github.com/bgmonroe/3d6eeb951152c3bef8190f93f1d56543

Expected Behavior

This was the plan stage so I expected either an error or the plan to succeed.

Actual Behavior

Got the following output upon running 'terraform plan'

Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

data.azurerm_subscription.current: Refreshing state...

------------------------------------------------------------------------
panic: not a collection type

goroutine 69 [running]:
github.com/zclconf/go-cty/cty.Type.ElementType(0x38e45e0, 0xc00000e868, 0xc00069f638, 0x8)
	github.com/zclconf/[email protected]/cty/collection.go:25 +0xba
github.com/hashicorp/terraform/terraform.createEmptyBlocks(0xc00075a300, 0x38e45e0, 0xc00000e878, 0x2efeb80, 0xc00143ab70, 0x38e45e0, 0xc00000e978, 0x2efeb80, 0xc00149cd20)
	github.com/hashicorp/terraform/terraform/eval_read_data_plan.go:242 +0x202
github.com/hashicorp/terraform/terraform.dataObjectHasChanges(0xc00075a300, 0x38e45e0, 0xc00000e878, 0x2efeb80, 0xc00143ab70, 0x38e45e0, 0xc00000e978, 0x2efeb80, 0xc00149cd20, 0x0, ...)
	github.com/hashicorp/terraform/terraform/eval_read_data_plan.go:211 +0x19e
github.com/hashicorp/terraform/terraform.(*evalReadDataPlan).Eval(0xc000a24000, 0x3926080, 0xc000899930, 0x1, 0x1, 0x0, 0x0)
	github.com/hashicorp/terraform/terraform/eval_read_data_plan.go:107 +0x1238
github.com/hashicorp/terraform/terraform.EvalRaw(0x387c8c0, 0xc000a24000, 0x3926080, 0xc000899930, 0x0, 0x0, 0x0, 0x0)
	github.com/hashicorp/terraform/terraform/eval.go:49 +0xc7
github.com/hashicorp/terraform/terraform.(*EvalSequence).Eval(0xc000880b20, 0x3926080, 0xc000899930, 0x1, 0x1, 0x6, 0xc000796a70)
	github.com/hashicorp/terraform/terraform/eval_sequence.go:20 +0xfd
github.com/hashicorp/terraform/terraform.EvalRaw(0x387c320, 0xc000880b20, 0x3926080, 0xc000899930, 0x2eb3460, 0x4b98942, 0x2e12f00, 0xc0006dea60)
	github.com/hashicorp/terraform/terraform/eval.go:49 +0xc7
github.com/hashicorp/terraform/terraform.Eval(0x387c320, 0xc000880b20, 0x3926080, 0xc000899930, 0xc000880b20, 0x387c320, 0xc000880b20, 0x0)
	github.com/hashicorp/terraform/terraform/eval.go:35 +0x4d
github.com/hashicorp/terraform/terraform.(*Graph).walk.func1(0x32443e0, 0xc0006de380, 0x0, 0x0, 0x0)
	github.com/hashicorp/terraform/terraform/graph.go:73 +0xc77
github.com/hashicorp/terraform/dag.(*Walker).walkVertex(0xc000796960, 0x32443e0, 0xc0006de380, 0xc0008ea240)
	github.com/hashicorp/terraform/dag/walk.go:387 +0x357
created by github.com/hashicorp/terraform/dag.(*Walker).Update
	github.com/hashicorp/terraform/dag/walk.go:309 +0x11d7



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

Terraform crashed! This is always indicative of a bug within Terraform.
A crash log has been placed at "crash.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.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

Using just the above main.tf, I ran:
terraform init
terraform plan

Additional Context

References

@bgmonroe bgmonroe added bug new new issue not yet triaged labels Sep 3, 2020
@alisdair
Copy link
Contributor

alisdair commented Sep 3, 2020

Thanks for the report! This looks like a duplicate of #26011, which is fixed in Terraform 0.13.2, released yesterday.

@alisdair alisdair closed this as completed Sep 3, 2020
@alisdair alisdair added duplicate issue closed because another issue already tracks this problem and removed new new issue not yet triaged labels Sep 3, 2020
@ghost
Copy link

ghost commented Oct 13, 2020

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.

@ghost ghost locked as resolved and limited conversation to collaborators Oct 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug duplicate issue closed because another issue already tracks this problem
Projects
None yet
Development

No branches or pull requests

2 participants