Skip to main content

Fixed: "The database session was disconnected" When Publishing a Flow in Power Automate

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

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 designer's command bar for Create a SharePoint Item with a red banner: The database session was disconnected; this may be because a schema customization request is currently being ran in this environment, followed by the SQL error details and an Assist me button

The full text:

The error
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​

  1. 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.
  2. 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.
  3. 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.

  1. Close the banner with its X.
  2. Wait about a minute.
  3. 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 designer's command bar with the title Create a SharePoint Item • Published and a green banner Your flow is ready to go. We recommend you test it.

The flow then ran and created the item, as How to Create an Item in a SharePoint List in Power Automate shows.

Common Mistakes​

MistakeWhat happensDo this instead
Rebuilding the flowTime spent on a flow with nothing wrong in itPublish the same flow again after a short wait
Changing connections or settings to make the error go awayThe flow changes for no reasonLeave it as it is and retry
Retrying again and again straight awayThe customization may still be runningWait a minute between attempts

Troubleshooting​

SymptomLikely causeFix
The same banner on the second tryThe customization is still runningWait longer, then publish again
A different error on the second tryA real problem in the flow, now visibleRead the new message; it's a separate issue
The error appears for other people's flows tooSomething in the environment is busyAsk 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.

Additional Resources​