Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add unknown paths to diags for debugging #31111

Merged
merged 1 commit into from May 24, 2022
Merged

Conversation

jbardin
Copy link
Member

@jbardin jbardin commented May 23, 2022

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.

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.
@jbardin jbardin added the 1.2-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged label May 23, 2022
@jbardin jbardin requested a review from a team May 23, 2022 17:34
@jbardin jbardin self-assigned this May 23, 2022
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"+
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this always a problem in Core, or could it be a provider bug?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jbardin jbardin merged commit 2ad3ac7 into main May 24, 2022
@jbardin jbardin deleted the jbardin/unknown-error-paths branch May 24, 2022 14:37
@github-actions
Copy link

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

@github-actions
Copy link

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1.2-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants