Closed jlenuffgsoi closed 1 month ago
Intead, this command ends successfully :
terraform import module.composer.google_composer_environment.composer_env projects/my-project/locations/europe-west1/environments/composer-prod
Then, a simple plan with the import
block throws the same error, after the manual import by CLI.
Hi @jlenuffgsoi, can you please add the output from the error message so we can see where the panic started? Thanks!
Hi @jbardin,
I've provided a gist in my issue : https://gist.github.com/jlenuffgsoi/7f7c8960d2cbf6959d1b47cea6ced2ef.js
After reviewing my input settings for the terraform-google-modules/composer/google//modules/create_environment_v2
module, the issue is gone.
That's strange, all my settings are strings with simple letters, numbers and well-placed hypens.
I think it'related to the module's provider. Should I close my issue ?
Hi @jlenuffgsoi, the gist does not contain any of the error output, that would have been written to stderr immediately after the TERRAFORM CRASH
banner and is required to know what the crash actually was.
There may be an error in the configuration, but configuration errors still should not result in a panic like this, so it would be nice to pinpoint and fix so it can be handled more gracefully.
Sorry, I didn't provide the correct link.
I've updated my issue. Here is the user-friendly output. The error message is at the end. https://gist.githubusercontent.com/jlenuffgsoi/7f7c8960d2cbf6959d1b47cea6ced2ef/raw/0917cee250585be0e606cd39d6a704d0ba907b0b/debug_output
Faster :
!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!
Terraform crashed! This is always indicative of a bug within Terraform.
Please report the crash with Terraform[1] 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.
[1]: https://github.com/hashicorp/terraform/issues
!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!
panic: interface conversion: interface {} is float64, not string
goroutine 22 [running]:
runtime/debug.Stack()
runtime/debug/stack.go:24 +0x5e
github.com/hashicorp/terraform/internal/logging.PanicHandler()
github.com/hashicorp/terraform/internal/logging/panic.go:84 +0x18b
panic({0x302fcc0?, 0xc00186b560?})
runtime/panic.go:770 +0x132
github.com/hashicorp/terraform/internal/command/jsonformat/structured/attribute_path.(*PathMatcher).GetChildWithKey(0xc0022de680, {0xc0009f42c0, 0x1a})
github.com/hashicorp/terraform/internal/command/jsonformat/structured/attribute_path/matcher.go:154 +0x2ec
github.com/hashicorp/terraform/internal/command/jsonformat/structured.ChangeMap.GetChild({0x0, 0x0, 0xc00186b350, 0x0, 0x0, {0x3e110a8, 0xc0022de680}, {0x3e110e0, 0x5954ca0}, 0x0}, ...)
github.com/hashicorp/terraform/internal/command/jsonformat/structured/map.go:75 +0x368
github.com/hashicorp/terraform/internal/command/jsonformat/differ.ComputeDiffForBlock({0x1, 0x0, {0x2e27ca0, 0xc0021ba180}, {0x0, 0x0}, {0x2faf440, 0xc00186b350}, {0x2e27ca0, 0xc0021ba588}, ...}, ...)
github.com/hashicorp/terraform/internal/command/jsonformat/differ/block.go:34 +0x285
github.com/hashicorp/terraform/internal/command/jsonformat/differ.checkForUnknownBlock.func1({0x1, 0x0, {0x2e27ca0, 0xc0021ba180}, {0x0, 0x0}, {0x2faf440, 0xc00186b350}, {0x2e27ca0, 0xc0021ba588}, ...})
github.com/hashicorp/terraform/internal/command/jsonformat/differ/unknown.go:54 +0x3d
github.com/hashicorp/terraform/internal/command/jsonformat/differ.checkForUnknownBlock.createProcessUnknownWithBefore.func2({0x1, 0x1, {0x2e27ca0, 0xc0021ba180}, {0x0, 0x0}, {0x2e740c0, 0x5730f68}, {0x2e27ca0, 0xc0021ba588}, ...}, ...)
github.com/hashicorp/terraform/internal/command/jsonformat/differ/unknown.go:64 +0x3d
github.com/hashicorp/terraform/internal/command/jsonformat/structured.Change.CheckForUnknown({0x1, 0x1, {0x2e27ca0, 0xc0021ba180}, {0x0, 0x0}, {0x2e740c0, 0x5730f68}, {0x2e27ca0, 0xc0021ba588}, ...}, ...)
github.com/hashicorp/terraform/internal/command/jsonformat/structured/unknown.go:64 +0x218
github.com/hashicorp/terraform/internal/command/jsonformat/differ.checkForUnknownBlock({0x1, 0x0, {0x2e27ca0, 0xc0021ba180}, {0x0, 0x0}, {0x2e740c0, 0x5730f68}, {0x2e27ca0, 0xc0021ba588}, ...}, ...)
github.com/hashicorp/terraform/internal/command/jsonformat/differ/unknown.go:50 +0x176
github.com/hashicorp/terraform/internal/command/jsonformat/differ.ComputeDiffForBlock({0x1, 0x1, {0x2faf440, 0xc001824450}, {0x2faf440, 0xc001824990}, {0x2faf440, 0xc001824c60}, {0x2faf440, 0xc001824f30}, ...}, ...)
github.com/hashicorp/terraform/internal/command/jsonformat/differ/block.go:77 +0x9e5
github.com/hashicorp/terraform/internal/command/jsonformat/differ.computeBlockDiffsAsList.func1({0x1, 0x1, {0x2faf440, 0xc001824450}, {0x2faf440, 0xc001824990}, {0x2faf440, 0xc001824c60}, {0x2faf440, 0xc001824f30}, ...})
github.com/hashicorp/terraform/internal/command/jsonformat/differ/list.go:73 +0x59
github.com/hashicorp/terraform/internal/command/jsonformat/differ.processNestedList({0x1, 0x1, {0x2e27ca0, 0xc0021ba2b8}, {0x2e27ca0, 0xc0021ba3a8}, {0x2e27ca0, 0xc0021ba480}, {0x2e27ca0, 0xc0021ba6c0}, ...}, ...)
github.com/hashicorp/terraform/internal/command/jsonformat/differ/list.go:88 +0xd5
github.com/hashicorp/terraform/internal/command/jsonformat/differ.computeBlockDiffsAsList({0x1, 0x1, {0x2e27ca0, 0xc0021ba2b8}, {0x2e27ca0, 0xc0021ba3a8}, {0x2e27ca0, 0xc0021ba480}, {0x2e27ca0, 0xc0021ba6c0}, ...}, ...)
github.com/hashicorp/terraform/internal/command/jsonformat/differ/list.go:72 +0x125
github.com/hashicorp/terraform/internal/command/jsonformat/differ.ComputeDiffForBlock({0x0, 0x0, {0x2faf440, 0xc001824420}, {0x2faf440, 0xc001824960}, {0x2faf440, 0xc001824c30}, {0x2faf440, 0xc001824f00}, ...}, ...)
github.com/hashicorp/terraform/internal/command/jsonformat/differ/block.go:94 +0xd98
github.com/hashicorp/terraform/internal/command/jsonformat.precomputeDiffs({{0x3522922, 0x3}, 0xc0021b5a40, {0xc000374c08, 0x2, 0x2}, {0x0, 0x0, 0x0}, {0xc0017c7900, ...}, ...}, ...)
github.com/hashicorp/terraform/internal/command/jsonformat/diff.go:61 +0x785
github.com/hashicorp/terraform/internal/command/jsonformat.Plan.renderHuman({{0x3522922, 0x3}, 0xc0021b5a40, {0xc000374c08, 0x2, 0x2}, {0x0, 0x0, 0x0}, {0xc0017c7900, ...}, ...}, ...)
github.com/hashicorp/terraform/internal/command/jsonformat/plan.go:59 +0x9a
github.com/hashicorp/terraform/internal/command/jsonformat.Renderer.RenderHumanPlan({0xc000194948?, 0xc000699200?, 0x0?}, {{0x3522922, 0x3}, 0xc0021b5a40, {0xc000374c08, 0x2, 0x2}, {0x0, ...}, ...}, ...)
github.com/hashicorp/terraform/internal/command/jsonformat/renderer.go:118 +0x1ef
github.com/hashicorp/terraform/internal/command/views.(*OperationHuman).Plan(0xc000920ff0, 0xc0016dfa40, 0xc0021ccd30)
github.com/hashicorp/terraform/internal/command/views/operation.go:130 +0x305
github.com/hashicorp/terraform/internal/backend/local.(*Local).opPlan(0xc000942000, {0x3e0fc90, 0xc0007140f0}, {0x3e0fc90, 0xc000714140}, 0xc00090ef00, 0xc000923980)
github.com/hashicorp/terraform/internal/backend/local/backend_plan.go:202 +0xe95
github.com/hashicorp/terraform/internal/backend/local.(*Local).Operation.func1()
github.com/hashicorp/terraform/internal/backend/local/backend.go:331 +0xbe
created by github.com/hashicorp/terraform/internal/backend/local.(*Local).Operation in goroutine 1
github.com/hashicorp/terraform/internal/backend/local/backend.go:324 +0x3fa
Thanks @jlenuffgsoi! That looks like it's specific to formatting a certain diff in the json output, so it would only happen with a particular combination of changes and likely disappear once they have been resolved.
Thanks @jlenuffgsoi! That looks like it's specific to formatting a certain diff in the json output, so it would only happen with a particular combination of changes and likely disappear once they have been resolved.
Yes, that's probably explains why after correcting my input settings in order to align with my env, the error disappeared.
Thank you. :-)
reopening until we can track down the root cause
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
Debug Output
https://gist.github.com/jlenuffgsoi/7f7c8960d2cbf6959d1b47cea6ced2ef
Expected Behavior
The resource should be imported successfully.
Actual Behavior
Terraform crashes when importing google_composer_environment resource :
Steps to Reproduce
terraform init terraform plan
Additional Context
No response
References
No response