add unknown paths to diags for debugging#31111
Conversation
When a user reports a "Configuration contains unknown value" error, there is no information on what might have been unknown during apply. Add unknown attribute paths to the diagnostic message to provide some more information when a reproduction may not be possible. Sine this is one of those "should never happen" types of errors which will be reported to the developers directly, we can leave the format as the raw internal representation for simplicity.
| diags = diags.Append(tfdiags.Sourceless( | ||
| tfdiags.Error, | ||
| "Configuration contains unknown value", | ||
| fmt.Sprintf("configuration for %s still contains unknown values during apply (this is a bug in Terraform; please report it!)\n"+ |
There was a problem hiding this comment.
Is this always a problem in Core, or could it be a provider bug?
There was a problem hiding this comment.
Yes, this is a core bug in that we should have caught an unknown value before we even get here. Once we've gotten this far it's kind of too late, but hopefully at least showing which part of the config was unknown can help track down the source of the unknown value.
|
Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch. |
|
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
When a user reports a "Configuration contains unknown value" error,
there is no information on what might have been unknown during apply.
Add unknown attribute paths to the diagnostic message to provide some
more information when a reproduction may not be possible. Sine this is
one of those "should never happen" types of errors which will be
reported to the developers directly, we can leave the format as the raw
internal representation for simplicity.