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
-
Okta Terraform Provider
- Okta Classic Engine
- Okta Identity Engine (OIE)
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.
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.
- 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
- If the job runs successfully, continue using this command as a temporary workaround until the backend concurrency limitations are resolved.
