Terraform Provider: Inconsistent result when updating scheduled_maintenance_template first_event_scheduled_at #120

Closed
opened 2026-04-05 16:18:54 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @listellm on 2/4/2026

Description

When updating the first_event_scheduled_at attribute on a oneuptime_scheduled_maintenance_template resource, Terraform reports an inconsistent result error due to the schedule_next_event_at attribute changing unexpectedly.

Error Message

Error: Provider produced inconsistent result after apply

When applying changes to oneuptime_scheduled_maintenance_template.this,
provider "provider[\"registry.terraform.io/oneuptime/oneuptime\"]" produced
an unexpected new value: .schedule_next_event_at: was
cty.StringVal("2026-02-04T19:00:00.000Z"), but now
cty.StringVal("2026-02-04T18:00:00.000Z").

This is a bug in the provider, which should be reported in the provider's
own issue tracker.

Steps to Reproduce

  1. Create a oneuptime_scheduled_maintenance_template resource with first_event_scheduled_at set to a specific time
  2. Apply the configuration successfully
  3. Change first_event_scheduled_at to a different time
  4. Run terraform apply
  5. Observe the inconsistent result error

Expected Behaviour

The provider should either:

  1. Mark schedule_next_event_at as Computed so Terraform expects it to change when related attributes change
  2. Or ensure the planned value matches the actual result after apply

Actual Behaviour

The provider returns a different value for schedule_next_event_at than what was planned, causing Terraform to report an inconsistent result error.

Workaround

Running terraform apply a second time succeeds as the state is actually updated despite the error.

Environment

  • Terraform version: >= 1.14.0
  • OneUptime Provider version: 9.4.8

Additional Context

The schedule_next_event_at attribute appears to be automatically computed/updated by the API when first_event_scheduled_at changes. The provider schema should reflect this behaviour by marking it as computed.

*Originally created by @listellm on 2/4/2026* ## Description When updating the `first_event_scheduled_at` attribute on a `oneuptime_scheduled_maintenance_template` resource, Terraform reports an inconsistent result error due to the `schedule_next_event_at` attribute changing unexpectedly. ## Error Message ``` Error: Provider produced inconsistent result after apply When applying changes to oneuptime_scheduled_maintenance_template.this, provider "provider[\"registry.terraform.io/oneuptime/oneuptime\"]" produced an unexpected new value: .schedule_next_event_at: was cty.StringVal("2026-02-04T19:00:00.000Z"), but now cty.StringVal("2026-02-04T18:00:00.000Z"). This is a bug in the provider, which should be reported in the provider's own issue tracker. ``` ## Steps to Reproduce 1. Create a `oneuptime_scheduled_maintenance_template` resource with `first_event_scheduled_at` set to a specific time 2. Apply the configuration successfully 3. Change `first_event_scheduled_at` to a different time 4. Run `terraform apply` 5. Observe the inconsistent result error ## Expected Behaviour The provider should either: 1. Mark `schedule_next_event_at` as `Computed` so Terraform expects it to change when related attributes change 2. Or ensure the planned value matches the actual result after apply ## Actual Behaviour The provider returns a different value for `schedule_next_event_at` than what was planned, causing Terraform to report an inconsistent result error. ## Workaround Running `terraform apply` a second time succeeds as the state is actually updated despite the error. ## Environment - Terraform version: >= 1.14.0 - OneUptime Provider version: 9.4.8 ## Additional Context The `schedule_next_event_at` attribute appears to be automatically computed/updated by the API when `first_event_scheduled_at` changes. The provider schema should reflect this behaviour by marking it as computed.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/oneuptime#120