High severityresource
Power BI Refresh Error:
1213
What does this error mean?
MySQL detected a deadlock between two or more transactions and rolled back one of them to resolve the cycle.
Common causes
- 1Two transactions each hold a lock the other needs, in reverse order
- 2ADF parallel activities updating the same rows in different orders across concurrent threads
- 3dbt incremental models and application writes competing for the same row locks
- 4Missing indexes causing full table scans that create broad lock contention
How to fix it
- 1Step 1: Implement automatic retry for the rolled-back transaction — MySQL only rolls back one transaction, leaving the other to proceed.
- 2Step 2: Check the last deadlock: `SHOW ENGINE INNODB STATUS;` — look for the LATEST DETECTED DEADLOCK section.
- 3Step 3: Ensure transactions always acquire locks in the same order across all application paths.
- 4Step 4: Add indexes to reduce the number of rows locked during UPDATE/DELETE operations.
Frequently asked questions
Official documentation: https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html