Closed Bryce-L closed 1 year ago
Duplicate of #34041
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.
Terraform Version
Terraform Configuration Files
main.tf
partitions.tf
Debug Output
runtime error: invalid memory address or nil pointer dereference goroutine 1 [running]: runtime/debug.Stack() /opt/hostedtoolcache/go/1.21.1/x64/src/runtime/debug/stack.go:24 +0x5e runtime/debug.PrintStack() /opt/hostedtoolcache/go/1.21.1/x64/src/runtime/debug/stack.go:16 +0x13 github.com/hashicorp/terraform/internal/logging.PanicHandler() /home/runner/work/terraform/terraform/internal/logging/panic.go:58 +0x13b panic({0x32dcb60?, 0x56cd1d0?}) /opt/hostedtoolcache/go/1.21.1/x64/src/runtime/panic.go:920 +0x270 github.com/hashicorp/terraform/internal/addrs.(MoveEndpoint).String(...) /home/runner/work/terraform/terraform/internal/addrs/move_endpoint.go:54 github.com/hashicorp/terraform/internal/configs.(Module).appendFile(0xc0007fde10, 0xc000630c00) /home/runner/work/terraform/terraform/internal/configs/module.go:456 +0x3d75 github.com/hashicorp/terraform/internal/configs.NewModule({0xc0007c0e80, 0x3, 0x0?}, {0x0, 0x0, 0x1?}) /home/runner/work/terraform/terraform/internal/configs/module.go:167 +0x4d5 github.com/hashicorp/terraform/internal/configs.(Parser).LoadConfigDir(0xc0006fe380?, {0x3ecd758, 0x1}) /home/runner/work/terraform/terraform/internal/configs/parser_config_dir.go:50 +0x27f github.com/hashicorp/terraform/internal/command.(Meta).loadSingleModule(0x0?, {0x3ecd758?, 0x16?}) /home/runner/work/terraform/terraform/internal/command/meta_config.go:91 +0x90 github.com/hashicorp/terraform/internal/command.(Meta).loadBackendConfig(0x0?, {0x3ecd758?, 0x0?}) /home/runner/work/terraform/terraform/internal/command/meta_config.go:145 +0x1c github.com/hashicorp/terraform/internal/command.(PlanCommand).PrepareBackend(0xc0006fe380, 0x0?, 0x48) /home/runner/work/terraform/terraform/internal/command/plan.go:123 +0xe5 github.com/hashicorp/terraform/internal/command.(PlanCommand).Run(0xc0006fe380, {0xc00007e0a0, 0x1, 0x2}) /home/runner/work/terraform/terraform/internal/command/plan.go:70 +0x46e github.com/mitchellh/cli.(CLI).Run(0xc0007a2c80) /home/runner/go/pkg/mod/github.com/mitchellh/cli@v1.1.5/cli.go:262 +0x5b8 main.realMain() /home/runner/work/terraform/terraform/main.go:339 +0x1eab main.main() /home/runner/work/terraform/terraform/main.go:64 +0x13
Expected Behavior
Terraform plan should have told me the plan.
Actual Behavior
Terraform crashed, providing a stacktrace.
Steps to Reproduce
Additional Context
I had two sumologic_partitions created as two resources. I wanted to try merging them into one resource and leverage
for_each
. Terraform plan said it was going to destroy the two resource and create new ones, so I decided to try adding a couple ofmoved
blocks. That's when my plan started failing. If I comment out themoved
blocks, plan succeeds. If I put them back, it crashes every time I runplan
.References
No response