Skip to content

Terraform crash when planning a new resource containing a SingleNestedAttribute #29388

@ewbankkit

Description

@ewbankkit

Terraform Version

% terraform version
Terraform v1.0.4
on darwin_amd64

Terraform Configuration Files

resource "aws_xray_group" "test" {}

Debug Output

Crash Output

% terraform plan
╷
│ Warning: Provider development overrides are in effect
│ 
│ The following provider development overrides are set in the CLI configuration:
│  - hashicorp/aws-xxxxxxxx in /Users/ewbankkit/go/bin
│  - hashicorp/aws in /Users/ewbankkit/go/bin
│ 
│ The behavior may therefore not match any released version of the provider and applying changes may cause the state to become incompatible with published releases.
╵
panic: interface conversion: interface {} is nil, not map[string]interface {}

goroutine 102 [running]:
github.com/zclconf/go-cty/cty.Value.GetAttr(0x37490f8, 0xc000d7ee00, 0x0, 0x0, 0xc0005a5ad0, 0x10, 0x3749018, 0xc0001a836b, 0x0, 0x0)
	/Users/distiller/go/pkg/mod/github.com/zclconf/go-cty@v1.9.0/cty/value_ops.go:760 +0x416
github.com/hashicorp/terraform/internal/plans/objchange.proposedNewAttributes(0xc00118b830, 0x37490f8, 0xc000d23bc0, 0x2f418e0, 0xc0006247b0, 0x37490f8, 0xc000d7ee00, 0x0, 0x0, 0x1)
	/Users/distiller/project/project/internal/plans/objchange/objchange.go:267 +0x26f
github.com/hashicorp/terraform/internal/plans/objchange.proposedNewNestedType(0xc000ac6420, 0x37490f8, 0xc000d23ba0, 0x0, 0x0, 0x37490f8, 0xc000d7ee00, 0x0, 0x0, 0x0, ...)
	/Users/distiller/project/project/internal/plans/objchange/objchange.go:314 +0x813
github.com/hashicorp/terraform/internal/plans/objchange.proposedNewAttributes(0xc00118b6e0, 0x37490f8, 0xc000d23bb0, 0x2f418e0, 0xc0006244e0, 0x37490f8, 0xc000d23b80, 0x2f418e0, 0xc000624180, 0xc0001a836a)
	/Users/distiller/project/project/internal/plans/objchange/objchange.go:295 +0x49a
github.com/hashicorp/terraform/internal/plans/objchange.proposedNew(0xc00118b740, 0x37490f8, 0xc000d23bb0, 0x2f418e0, 0xc0006244e0, 0x37490f8, 0xc000d23b80, 0x2f418e0, 0xc000624180, 0x20, ...)
	/Users/distiller/project/project/internal/plans/objchange/objchange.go:80 +0x165
github.com/hashicorp/terraform/internal/plans/objchange.ProposedNew(0xc00118b740, 0x37490f8, 0xc000d236d0, 0x0, 0x0, 0x37490f8, 0xc000d23b80, 0x2f418e0, 0xc000624180, 0x0, ...)
	/Users/distiller/project/project/internal/plans/objchange/objchange.go:42 +0x11f
github.com/hashicorp/terraform/internal/terraform.(*NodeAbstractResourceInstance).plan(0xc000034380, 0x3779820, 0xc0001508c0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/Users/distiller/project/project/internal/terraform/node_resource_abstract_instance.go:732 +0xdab
github.com/hashicorp/terraform/internal/terraform.(*NodePlannableResourceInstance).managedResourceExecute(0xc001226840, 0x3779820, 0xc0001508c0, 0x100c408, 0x32a3600, 0xc001721c50)
	/Users/distiller/project/project/internal/terraform/node_resource_plan_instance.go:196 +0x8cb
github.com/hashicorp/terraform/internal/terraform.(*NodePlannableResourceInstance).Execute(0xc001226840, 0x3779820, 0xc0001508c0, 0x6710902, 0xc001721ce8, 0x100d305, 0x2f8ae40)
	/Users/distiller/project/project/internal/terraform/node_resource_plan_instance.go:54 +0xb3
github.com/hashicorp/terraform/internal/terraform.(*ContextGraphWalker).Execute(0xc0016c0410, 0x3779820, 0xc0001508c0, 0x6710920, 0xc001226840, 0x0, 0x0, 0x0)
	/Users/distiller/project/project/internal/terraform/graph_walk_context.go:129 +0xbf
github.com/hashicorp/terraform/internal/terraform.(*Graph).walk.func1(0x32a3600, 0xc001226840, 0x0, 0x0, 0x0)
	/Users/distiller/project/project/internal/terraform/graph.go:59 +0xbd3
github.com/hashicorp/terraform/internal/dag.(*Walker).walkVertex(0xc0015c6300, 0x32a3600, 0xc001226840, 0xc0015bc3c0)
	/Users/distiller/project/project/internal/dag/walk.go:381 +0x288
created by github.com/hashicorp/terraform/internal/dag.(*Walker).Update
	/Users/distiller/project/project/internal/dag/walk.go:304 +0x1246




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

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

crash.688954863.log

Expected Behavior

Actual Behavior

Steps to Reproduce

Additional Context

N.B. This is not the usual AWS Provider but is an under-development version using https://github.com/hashicorp/terraform-plugin-framework (and hence protocol v6).

The resource's schema includes a SingleNestedAttribute:

		"insights_configuration": {
			Attributes: schema.SingleNestedAttributes(
				map[string]schema.Attribute{
					"insights_enabled": {
						// Property: InsightsEnabled
						Description: "Set the InsightsEnabled value to true to enable insights or false to disable insights.",
						Type:        types.BoolType,
						Optional:    true,
					},
					"notifications_enabled": {
						// Property: NotificationsEnabled
						Description: "Set the NotificationsEnabled value to true to enable insights notifications. Notifications can only be enabled on a group with InsightsEnabled set to true.",
						Type:        types.BoolType,
						Optional:    true,
					},
				},
			),
			Optional: true,
		},

References

Metadata

Metadata

Assignees

Labels

bugcrashnewnew issue not yet triaged

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions