Troubleshooting

This section presents solutions and workarounds for issues you may encounter when using the Terraform-Secret Server integration.

Issue When Upgrading the Delinea Terraform Provider from v2.0.9 to 3.0.0 or Later

Cause

When upgrading your Delinea Terraform provider from v2.0.9 to 3.0.0 or later, you can receive a "Breaking Change: sshkeyargs Data Type Migration" error. This issue occurs because of a discrepancy in the data type of the sshkeyargs property in the Terraform state file between v2.0.9 and later versions.

Resolution

To resolve this, manually update your Terraform state file:

  1. Back up your state file (terraform.tfstate).

  2. Open the state file in a text editor.

  3. Find the sshkeyargs property under your resource and change its value from [] to null: "sshkeyargs": null.

  4. Save the state file.

  5. Update your Terraform provider version to the latest version in your configuration.

  6. Run:

    terraform init -upgrade

  7. To verify that the issue is resolved, run:

    terraform plan

Plan or Apply Fails Immediately with a Server URL Error After Upgrading to v5.0.0

Cause

server_url uses plaintext http:// against a host that is not a loopback address. Provider v5.0.0 rejects that at configure time because the credential would travel in the clear.

Resolution

Change server_url to https://. If Secret Server is behind upstream TLS termination and you accept the risk, set allow_insecure_http = true on the provider block or export TSS_ALLOW_INSECURE_HTTP=true.

Authentication Fails Behind a Reverse Proxy After Upgrading to v5.0.0

Cause

With username/password authentication, v5.0.0 sends an unauthenticated GET to <server_url>/api/v1/healthcheck and then <server_url>/health before sending credentials, and does not follow redirects. A proxy that routes only the legacy /healthcheck.aspx path, or that redirects the health paths, makes the probe fail.

Resolution

Allow the appropriate health path through the proxy so it returns a direct 2xx response. Static Secret Server token authentication skips the probe.

Error: password fields do not accept itemvalue

Cause

A fields block sets itemvalue on a field the secret template marks as a password field. v5.0.0 rejects the configuration before writing anything; v4.0.0 accepted it and then failed the apply with "Provider produced inconsistent result after apply".

Resolution

Replace itemvalue with password_value plus password_wo_version, or set generate = true.

Refresh Errors Instead of Recreating a Secret Deleted Outside Terraform

Cause

v5.0.0 fails closed on refresh. Secret Server answers a deleted secret, a never-existent secret, and a permission-denied secret alike with HTTP 400 API_AccessDenied, and an HTTP 404 can come from an attachment sub-request on a live secret, so the provider cannot prove the secret is gone and keeps it in state rather than silently planning a replacement.

Resolution

Confirm in Secret Server that the secret really was deleted, then run terraform state rm <resource address> and apply again to recreate it.

An account permitted to view deleted secrets sees a different signal: Secret Server Cloud returns the recycled secret with active = false. Refresh then succeeds and emits a Secret Inactive warning for a secret Terraform last recorded as active. Set active = false in the configuration if the deactivation is intended; otherwise restore the secret, or use the terraform state rm recovery above.

Error: Missing or Ambiguous fieldname

Cause

v5.0.0 requires fieldname on every fields block and requires it to resolve to exactly one field name or slug on the secret template.

Resolution

Add the intended fieldname to every block, delete blocks that reference fields the template no longer defines, and remove duplicate references to the same template field (for example one by display name and one by slug).