Fixed: "The database session was disconnected" When Publishing a Flow in Power Automate
Publish on a small, finished flow put up a red banner: The database session was disconnected; this may be because a schema customization request is currently being ran in this environment. Nothing was wrong with the flow. It's a Dataverse error, and publishing the same flow again a minute later worked.
What I Was Doing
I was building Create a SharePoint Item, a short flow with Manually trigger a flow and the SharePoint action Create item, which adds a task called Buy milk to a list (How to Create an Item in a SharePoint List in Power Automate). The flow is in a solution in the environment's Dataverse. With the action filled in, I selected Publish.
What I Expected
The usual green message, Your flow is ready to go. We recommend you test it.
What I Got
A red banner under the designer's command bar:

The full text:
The database session was disconnected; this may be because a schema customization request is currently being ran in this environment. Please try again after the schema customization request is completed. Schema customization should be done outside of working hours if possible. Original exception: SQLErrorCode: 10054, SQLExceptionMessage: A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)
What I Checked
- What the message asks for. It names its own cause, a schema customization request, running in this environment, and its own fix: Please try again after the schema customization request is completed.
- Microsoft's documentation. Dataverse's Web service error codes list it as DBSessionKilledByEscort, code
0x80048563(-2147187357), with the same message. The article gives no other cause or fix. - The flow. Nothing in it was wrong: it was a trigger and one filled-in action, and I changed nothing before trying again.
Why It Happens
The flow is stored in the environment's Dataverse database, and publishing writes it there. The message says the database session was cut off while a schema customization request was running in the environment, so the publish failed on the database's side, not because of anything in the flow. I hadn't changed any tables myself, and neither the banner nor the documentation says which customization was running.
The Fix
Do what the message says: wait, then try again.
- Close the banner with its X.
- Wait about a minute.
- Select Publish again, without changing the flow.
After the Fix
The second Publish worked. The banner was Your flow is ready to go. We recommend you test it., and the title showed Published:

The flow then ran and created the item, as How to Create an Item in a SharePoint List in Power Automate shows.
Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
| Rebuilding the flow | Time spent on a flow with nothing wrong in it | Publish the same flow again after a short wait |
| Changing connections or settings to make the error go away | The flow changes for no reason | Leave it as it is and retry |
| Retrying again and again straight away | The customization may still be running | Wait a minute between attempts |
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| The same banner on the second try | The customization is still running | Wait longer, then publish again |
| A different error on the second try | A real problem in the flow, now visible | Read the new message; it's a separate issue |
| The error appears for other people's flows too | Something in the environment is busy | Ask whoever manages the environment what's running |
FAQ
Is my flow broken?
No. The message is about the environment's database, and the same flow, unchanged, published a minute later.
What does "Original exception: SQLErrorCode: 10054" mean?
It's the underlying error from the database connection: An existing connection was forcibly closed by the remote host. It fits the first sentence: the database session was disconnected.
How can I avoid it?
The message itself advises that schema customization should be done outside of working hours if possible. That's a note for whoever changes tables and solutions in the environment; for the person publishing a flow, waiting and retrying is the fix.
Conclusion
The database session was disconnected on Publish is Dataverse's DBSessionKilledByEscort: the environment's database was busy with a schema change. The flow is fine. Wait a minute and publish it again.
