Open cakoose opened 2 years ago
I think the relevant code here is that we unconditionally set the value of "Outputs" in the state to whatever the provider Update function returns even if that Update also returns errors. (https://github.com/pulumi/pulumi/blob/master/pkg/resource/deploy/step.go#L485)
So one fix here would be to not save the result of Update if it errors. Another fix is that the provider shouldn't return changed outputs if it has returned an error and not actually done the update and instead return the old outputs.
I suspect we can't do the first fix as a provider could do like a partial update (say your changing two fields and it applies the change to one field then errors on the second).
Pinging @pgavlin to confirm. If this is the case then we should move this to GCP provider to fix up the output return from Update.
If this is the case then we should move this to GCP provider to fix up the output return from Update.
Meaning to TF bridge, right?
Meaning to TF bridge, right?
Yes.
So one fix here would be to not save the result of Update if it errors. Another fix is that the provider shouldn't return changed outputs if it has returned an error and not actually done the update and instead return the old outputs.
I suspect we can't do the first fix as a provider could do like a partial update (say your changing two fields and it applies the change to one field then errors on the second).
We do in fact do the first: https://github.com/pulumi/pulumi/blob/master/pkg/resource/deploy/step.go#L468-L474
In that code, if the update fails with a non-partial failure, we do not write the new outputs back. Instead, we fail the step entirely.
Interestingly, though, it looks like the TF bridge always returns partial failures during Create
and Update
: https://github.com/pulumi/pulumi-terraform-bridge/blob/master/pkg/tfbridge/provider.go#L902-L904, https://github.com/pulumi/pulumi-terraform-bridge/blob/master/pkg/tfbridge/provider.go#L1088-L1090
This behavior was introduced in https://github.com/pulumi/pulumi-terraform/pull/237. I'm somewhat surprised that it has not been more problematic given that it has been around for nearly four years. We should revisit this and see if we can be more precise about when we should return a fatal error rather than a partial error.
Hello!
Issue details
attemptDeadline: '1m'
.'1m'
is the wrong syntax. The correct syntax is'60s'
.pulumi up
).I'd expect that if a request fails with an HTTP 400, that Pulumi would know that the remote resource was not updated.
Steps to reproduce
gcp.cloudscheduler.Job
resource. I did not setattemptDeadline
.pulumi up
attemptDealine: '1m'
pulumi up
.~ attemptDeadline: "180s" => "1m"
attemptDeadline
field.pulumi up
(expecting no changes)~ attemptDeadline: "1m" => "180s"
I checked the setting in the GCP console and it's set to "3m".
Expected: In step 6, there should be no changes.
Actual: Pulumi state thinks that
attemptDeadline
needs to change from "1m" to "180s".HTTP 400 failure on
pulumi up
(step 4)Output of
pulumi stack export