Forum Discussion
There was a problem refreshing. Cannot acquire lock for model because it is currently in use
I have a more information about these locking issues with gen1-dataflows in the PBI service.
The back-end error is CDSALockAcquireError.
The most relevant information that was shared with me is :
"Occasionally, a dataflow will fail to release a lock, usually due to a refresh failure or a user cancellation. Most of the time, these issues auto-resolve after 24 hours due to the 24 hour limit on refresh completion. However, sometimes the 24 hour rule fails to take effect, or the customer does not want to wait 24 hours.
If customers don't want to wait a day, there are live-site engineers that can be contacted at Microsoft (by CSS Mindtree/professional) who have a special procedure they can use to release the dataflow locks"
That part above is very important to learn, as a PBI developer. Whenever I'm told by a company manager that they need their data urgently, then they probably wouldn't find it acceptable if I tell them to chill, have a beer and come back in the morning for their data. Managers would hold their report-developers responsible for getting their reports working, and would probably believe we had initiated these problem in the first place... In this particular case the dataflow-locking issues that we encountered were NOT actually triggered by me. ... there were other unrelated problem in the health of Power BI that triggered these dataflows to get all locked up.
Unfortunately for the PBI developer, there aren't any easy workarounds either. This is because we can't delete or rename a locked dataflow, and lots of other PBI artifacts are referring back to the original dataflow.
Additional second-hand information (use at your own discretion):
"Premium dataflow read and write locks are very normal. It is how dependent dataflows (linked entities) are kept in sync with one another, similar to how databases use transactions. Refreshing a dataflow and/or saving a dataflow is designed to fail when locks are active, with the following user error:
Cannot acquire lock for model '[workspace id]/[dataflow id]' because it is currently in use.
The following is normal, expected dataflow behavior:
- Locking ALWAYS happens at the Dataflow level, not the entity level.
- Within a single workspace, when a refresh is running, all downstream dependent dataflows are locked during the refresh and show as refreshing themselves in Power BI.
- Attempting to edit and save any of the refreshing dataflows results in the expected "Cannot acquire lock" user error.
- Attempting to cancel an upstream refresh will cancel that and all dependent refreshes. The upstream refresh will show as "Cancelled" in Power BI, but the downstream refreshes will show as "Failed".
(see images)
- Within a single workspace, refreshing a downstream dataflow Does NOT cause the upstream dataflow to automatically refresh.
- Attempting to edit and save OR refresh the upstream dataflow while the downstream dataflow is running will result in the expected "Cannot acquire lock" user error.
- When there are two or more upstream dataflows (A1, A2) that a downstream dataflow (B) depends on (linked entity), if A1 and A2 are refreshed at the same time, one will acquire the lock and the other will fail.
- Across workspaces, a downstream or upstream dataflow can be edited and saved OR refreshed regardless of the status of the dataflow in the other workspace. Downstream dataflow will use the latest complete snapshot from the upstream dataflow.
Occasionally, a dataflow will fail to release a lock, usually due to a refresh failure or a user cancellation. Most of the time, these issues auto-resolve after 24 hours due to the 24 hour limit on refresh completion.
However, sometimes the 24 hour rule fails to take effect, or the customer does not want to wait 24 hours.
Causes of Locking Issues
One or more of the following may be observed to indicate the presence of locks -
- Dataflow refresh is STILL RUNNING as observed in Power BI and taking longer than normal.
- Dataflow refresh is STILL RUNNING as observed in Power BI after 24 hours.
- Dataflow refresh is STILL RUNNING as observed in Power BI and clicking on Cancel refresh results in a "Something went wrong" error in the Power BI UI.
- Dataflow edit and save fails with "Cannot acquire lock" user error while the current, upstream, and downstream dataflow refreshes are NOT ongoing."
Conclusion
Hopefully this is helpful. Ideally Microsoft would share this type of thing first-hand in their "known issues", rather than making customers regurgitate it ourselves in the community. I am assured that none of this is overly sensitive and I received confirmation from my source that nothing here is a "secret". It can be shared with friends and relatives and coworkers... so feel free to put it in your next Christmas letter!
This information was provided in July 2024 and is subject to change if/when Microsoft fixes the locking bugs.