MetricSign
Start free
High severitydata source

Power BI Refresh Error:
Database returned an error to the gateway

What does this error mean?

The database returned an error to the gateway during the refresh query. Unlike connection errors, this means the gateway reached the database but the database rejected or failed the query.

Common causes

  • 1The database ran out of temporary storage or log space during query execution
  • 2A query lock or deadlock occurred on the source database
  • 3The database was in read-only mode (e.g., during backup or failover)
  • 4The specific database user hit a resource quota or connection limit
  • 5A DDL change (ALTER TABLE, DROP COLUMN) invalidated an existing query plan

How to fix it

  1. 1Check the database server's error logs for the specific error that occurred at the time of the refresh.
  2. 2Look for blocking queries or deadlocks in the database during the refresh window using sp_who2 or activity monitor.
  3. 3Verify the database has sufficient tempdb/log space and is not in read-only mode.
  4. 4Check whether the database was undergoing a failover or maintenance operation at the refresh time.
  5. 5If the error is a lock conflict, reschedule the refresh to a lower-traffic period or optimize queries to reduce lock duration.

Frequently asked questions

Does this error affect multiple datasets at once?

If multiple datasets connect to the same data source, yes — all of them will fail until the source connectivity is restored.

Can this error be caused by a server migration or rename?

Yes — if the server name, database name, or connection string changed (e.g., during a cloud migration), Power BI still holds the old connection details. Update the connection in Power BI Desktop and republish.

Does this error appear in Power BI Desktop?

Sometimes — if you open the .pbix file and attempt a refresh, Desktop will surface the same connection error. This is useful for debugging without affecting the Service dataset.

Will the error resolve automatically once the source is back online?

Only if it was a temporary outage. The next scheduled refresh will succeed automatically. If the connection string changed or credentials expired, manual intervention is needed.

Source · learn.microsoft.com/en-us/power-bi/connect-data/service-gateway-onprem-tshoot

Other data source errors