Skip to content

Terraform Show fails if plan has no changes #29042

@dnascimento

Description

@dnascimento

Terraform Version

Terraform v1.0.1 (not in v1.0.0)

Crash Output

2021-06-26T14:40:49.232+1000 [TRACE] provider.stdio: waiting for stdio data
2021-06-26T14:40:49.303+1000 [TRACE] GRPCProvider: Close
2021-06-26T14:40:49.304+1000 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-06-26T14:40:49.306+1000 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/aws/3.47.0/darwin_amd64/terraform-provider-aws_v3.47.0_x5 pid=20348
2021-06-26T14:40:49.306+1000 [DEBUG] provider: plugin exited
2021-06-26T14:40:49.306+1000 [TRACE] terraform.NewContext: complete
2021-06-26T14:40:49.307+1000 [TRACE] backend/local: finished building terraform.Context

panic: value is marked, so must be unmarked first

goroutine 1 [running]:
github.com/zclconf/go-cty/cty.Value.assertUnmarked(...)
	github.com/zclconf/go-cty@v1.8.4/cty/marks.go:141
github.com/zclconf/go-cty/cty.Value.LengthInt(0x38c2e30, 0xc0005e4000, 0x3159ee0, 0xc0004587e0, 0x38c2e01)
	github.com/zclconf/go-cty@v1.8.4/cty/value_ops.go:1050 +0x4f
github.com/zclconf/go-cty/cty.transform(0xc0005e4960, 0x1, 0x1, 0x38c2e30, 0xc0005e4000, 0x3159ee0, 0xc0004587e0, 0x388c048, 0xc000458b10, 0xc0004587e0, ...)
	github.com/zclconf/go-cty@v1.8.4/cty/walk.go:144 +0x2e8
github.com/zclconf/go-cty/cty.transform(0x0, 0x0, 0x0, 0x38c2df8, 0xc0005e4240, 0x3065f60, 0xc001a9d380, 0x388c048, 0xc000458b10, 0xc0005e48b0, ...)
	github.com/zclconf/go-cty@v1.8.4/cty/walk.go:209 +0x10ed
github.com/zclconf/go-cty/cty.TransformWithTransformer(...)
	github.com/zclconf/go-cty@v1.8.4/cty/walk.go:125
github.com/zclconf/go-cty/cty.Value.MarkWithPaths(0x38c2df8, 0xc0005e4240, 0x3065f60, 0xc001a9d380, 0xc000fc4660, 0x1, 0x1, 0x38221c0, 0x1, 0xc001929640, ...)
	github.com/zclconf/go-cty@v1.8.4/cty/marks.go:236 +0xc5
github.com/hashicorp/terraform/internal/command/jsonstate.marshalResources(0xc001b0d4d0, 0x0, 0x0, 0x0, 0xc00063efd0, 0x0, 0xc00108f410, 0x13dc26c, 0xc00108f4a0, 0x34366ba)
	github.com/hashicorp/terraform/internal/command/jsonstate/state.go:333 +0xe07
github.com/hashicorp/terraform/internal/command/jsonstate.marshalRootModule(0xc000eec0a0, 0xc00063efd0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	github.com/hashicorp/terraform/internal/command/jsonstate/state.go:200 +0x12d
github.com/hashicorp/terraform/internal/command/jsonstate.(*state).marshalStateValues(0xc001a9c1e0, 0xc000eec0a0, 0xc00063efd0, 0x0, 0x0)
	github.com/hashicorp/terraform/internal/command/jsonstate/state.go:166 +0x14a
github.com/hashicorp/terraform/internal/command/jsonstate.Marshal(0xc001b0d3e0, 0xc00063efd0, 0x0, 0x0, 0x0, 0x0, 0x2da4e55)
	github.com/hashicorp/terraform/internal/command/jsonstate/state.go:146 +0xf8
github.com/hashicorp/terraform/internal/command/jsonplan.Marshal(0xc0005ca000, 0xc000dd3a40, 0xc001b0d3e0, 0xc00063efd0, 0x0, 0x0, 0x0, 0x0, 0x0)
	github.com/hashicorp/terraform/internal/command/jsonplan/plan.go:152 +0x633
github.com/hashicorp/terraform/internal/command.(*ShowCommand).Run(0xc00048b6c0, 0xc00004e0e0, 0x1, 0x2, 0xc00058e590)
	github.com/hashicorp/terraform/internal/command/show.go:152 +0x966
github.com/mitchellh/cli.(*CLI).Run(0xc000837400, 0xc00049c060, 0x3435241, 0x4)
	github.com/mitchellh/cli@v1.1.2/cli.go:262 +0x41a
main.wrappedMain(0x0)
	github.com/hashicorp/terraform/main.go:384 +0x1112
main.realMain(0x0)
	github.com/hashicorp/terraform/main.go:115 +0x554
main.main()
	github.com/hashicorp/terraform/main.go:58 +0x25

Steps to Reproduce

terraform plan -out=plan.out
terraform show -json plan.out

Regression introduced by v1.0.1

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions