pulumi / pulumi-terraform-bridge

A library allowing Terraform providers to be bridged into Pulumi.
Apache License 2.0
199 stars 43 forks source link

Lack of Diagnostic Information when Bug present in Upstream Provider #2413

Open zbuchheit opened 2 months ago

zbuchheit commented 2 months ago

What happened?

When an upstream provider has a bug that triggers an inconsistent result of apply error, our downstream providers displays this behavior as a spurious diff without any error or diagnostics. I would expect the behavior to display a log or show what is causing the spurious diff.

Example

Example Error

2024-09-11T17:09:09.291-0700 [ERROR] vertex "mist_device_gateway.gateway_one" error: Provider produced inconsistent result after apply
╷
│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to mist_device_gateway.gateway_one, provider
│ "provider[\"registry.terraform.io/juniper/mist\"]" produced an unexpected new value:
│ .additional_config_cmds: was cty.ListValEmpty(cty.String), but now null.
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue
│ tracker.

When I translate the code to pulumi in a bridged provider instead of an error I get a spurious diff and doesn't appear in the logs even when TF_LOG=debug is used.

Output of pulumi about

N/A

Additional context

I think the behavior itself is actually acceptable in that it doesn't throw an error and is an upstream bug that needs to be fixed, but I would expect a diagnostic log to show up to help troubleshoot this or some sort of warning.

Currently it is very difficult to figure out what is causing the spurious diff if the resource has a complex schema, whereas in TF the error points you to the problem immediately

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

guineveresaenger commented 2 months ago

Thank you for filing this bug. I've added kind/enhancement as well since this is a subcategory of inconsistencies in diff display that we may have a better fix for soon.

cc @iwahbe

zbuchheit commented 2 months ago

If I can be of any help to provide logs etc, just let me know. Thanks! 😄