Terraform Provider: probe_version field produces inconsistent result after apply #158

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

Originally created by @listellm on 1/16/2026

Bug Report

Component

Terraform Provider (terraform-provider-oneuptime)

Description

The OneUptime Terraform provider produces an inconsistent result after applying changes to oneuptime_probe resources. The probe_version field changes from a string value to a JSON object representation between plan and apply operations, causing Terraform to report a provider bug.

Expected Behaviour

The probe_version field should remain as the string value provided in the configuration (e.g., "9.3.19") throughout the resource lifecycle.

Actual Behaviour

After terraform apply, the provider returns probe_version as a JSON object {"_type":"Version","value":"9.3.19"} instead of the string "9.3.19" that was provided, causing Terraform to report an inconsistent state.

Steps to Reproduce

  1. Create a oneuptime_probe resource with probe_version = "9.3.19"
  2. Run terraform apply
  3. Run terraform apply again
  4. Observe the error about inconsistent provider result

Error Message

Error: Provider produced inconsistent result after apply

When applying changes to module.probe["example"].oneuptime_probe.this, provider
"provider["registry.terraform.io/oneuptime/oneuptime"]" produced an
unexpected new value: .probe_version: was cty.StringVal("9.3.19"), but now
cty.StringVal("{\"_type\":\"Version\",\"value\":\"9.3.19\"}").

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

Terraform Configuration

resource "oneuptime_probe" "this" {
  project_id    = "zzzzz"
  name          = "probe name"
  key           = random_uuid.this.result
  description   = "Probe for aws "
  probe_version = "9.3.19"
  should_auto_enable_probe_on_new_monitors = false
  labels        = [...]
}

Environment

  • OneUptime Provider Version: 9.3.19
  • Terraform Version: 1.12.0
  • Platform: Linux 6.14.0-37-generic

Current Workaround

Using a lifecycle rule to ignore changes to the probe_version field:

resource "oneuptime_probe" "this" {
  # ... configuration ...
  
  lifecycle {
    ignore_changes = [probe_version]
  }
}

Impact

  • Prevents proper state management for probe resources
  • Requires lifecycle workarounds that hide legitimate version changes
  • Causes Terraform to report provider bugs on every subsequent apply
  • Makes it difficult to manage probe version upgrades through Terraform

Root Cause

The provider appears to be returning the probe_version field as a JSON object with _type and value properties from the API, rather than normalising it to a string value as defined in the schema.

Suggested Fix

The provider should normalise the probe_version field to return only the string value, stripping the JSON object wrapper before returning it to Terraform.

*Originally created by @listellm on 1/16/2026* ## Bug Report ### Component Terraform Provider (`terraform-provider-oneuptime`) ### Description The OneUptime Terraform provider produces an inconsistent result after applying changes to `oneuptime_probe` resources. The `probe_version` field changes from a string value to a JSON object representation between plan and apply operations, causing Terraform to report a provider bug. ### Expected Behaviour The `probe_version` field should remain as the string value provided in the configuration (e.g., `"9.3.19"`) throughout the resource lifecycle. ### Actual Behaviour After `terraform apply`, the provider returns `probe_version` as a JSON object `{"_type":"Version","value":"9.3.19"}` instead of the string `"9.3.19"` that was provided, causing Terraform to report an inconsistent state. ### Steps to Reproduce 1. Create a `oneuptime_probe` resource with `probe_version = "9.3.19"` 2. Run `terraform apply` 3. Run `terraform apply` again 4. Observe the error about inconsistent provider result ### Error Message ``` Error: Provider produced inconsistent result after apply When applying changes to module.probe["example"].oneuptime_probe.this, provider "provider["registry.terraform.io/oneuptime/oneuptime"]" produced an unexpected new value: .probe_version: was cty.StringVal("9.3.19"), but now cty.StringVal("{\"_type\":\"Version\",\"value\":\"9.3.19\"}"). This is a bug in the provider, which should be reported in the provider's own issue tracker. ``` ### Terraform Configuration ```hcl resource "oneuptime_probe" "this" { project_id = "zzzzz" name = "probe name" key = random_uuid.this.result description = "Probe for aws " probe_version = "9.3.19" should_auto_enable_probe_on_new_monitors = false labels = [...] } ``` ### Environment - **OneUptime Provider Version**: `9.3.19` - **Terraform Version**: `1.12.0` - **Platform**: Linux 6.14.0-37-generic ### Current Workaround Using a lifecycle rule to ignore changes to the `probe_version` field: ```hcl resource "oneuptime_probe" "this" { # ... configuration ... lifecycle { ignore_changes = [probe_version] } } ``` ### Impact - Prevents proper state management for probe resources - Requires lifecycle workarounds that hide legitimate version changes - Causes Terraform to report provider bugs on every subsequent apply - Makes it difficult to manage probe version upgrades through Terraform ### Root Cause The provider appears to be returning the `probe_version` field as a JSON object with `_type` and `value` properties from the API, rather than normalising it to a string value as defined in the schema. ### Suggested Fix The provider should normalise the `probe_version` field to return only the string value, stripping the JSON object wrapper before returning it to Terraform.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/oneuptime#158