<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
Troubleshooting Okta Terraform Concurrency Issues
Okta Classic Engine
Okta Identity Engine
SDKs & Libraries
Overview

There are instances where Terraform jobs are failing with errors returned by the Okta backend. During the failed job, users may experience specific backend error messages that indicate a concurrency conflict, such as:

 

Failed to acquire lock

 

Update returned unexpected row count

 

Applies To
  • Okta Terraform Provider

  • Okta Classic Engine
  • Okta Identity Engine (OIE)
Cause

There are numerous reasons for Terraform errors, including end-user misconfigurations, provider bugs, and backend issues. Errors originating from the backend that mention locks or unexpected row counts are typically the result of a concurrency issue in which multiple simultaneous Terraform requests conflict with one another in the Okta environment.

Solution

To determine whether the backend error is due to a concurrency issue, it is possible to test the process serially. This method can also serve as a short-term workaround while the root cause of the issue is being investigated.

 

The parallelism option can be supplied during the terraform apply phase to test this.

  1. Set the parallelism value to 1. This will force the Terraform job to run all requests serially rather than concurrently, by executing the following command: 
    terraform apply -parallelism=1

  1. If the job runs successfully, continue using this command as a temporary workaround until the backend concurrency limitations are resolved.
Loading
Troubleshooting Okta Terraform Concurrency Issues