Skip to main content
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper I
Helper I

Possible BUG? Power BI Personal Gateway Does not close Database connections to PostGreSQL

We have about 6 datasets that are set to refresh on a schedule. This works as expected. However periodically the source PostgreSql database starts to deny connections because the number of connections has reached its limit.

Viewing the database logs shows that there are multiple connections open from the IP address of the Workstation that hosts the Power BI Personal Gateway.


Restarting the workstation closes the open connections.


I would expect the connections to be closed following the refresh of an individual dataset.





Advocate III
Advocate III

2 years later the same

Frequent Visitor

Any update? as it is still an issue on late 2019...

Super User
Super User

I've seen some similar issues posted regarding the gateway not closing connections properly to databases so likey some sort of bug.

Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

I was hoping to be able to use Task Scheduler to stop and re-start the Gateway as a service, to save me from having to re-boot the workstation once or twice a week, but can't seem to see it listed, even though I installed it as an Administrator.


In addition I have just installed the October 22 release of the Personal Gateway, that seems to hold some promise of solving other issues that I was getting, so am hopeful that it might address this one as well

As a workaround I managed to get the Data Management Service installed during the Gateway installation process and now I am running a batch file using Windows Task Scheduler with a NET STOP SLEEP 120 NET START kind of thing.


I am awaitng feedback from the DBA to see if this is a viable work around

Melissa did you have any luck with this workaround in the end? The Gateway is still leaking connections for me, so clearly this bug has not been fixed.


I've tried setting the task scheduler to do a reboot but this doesn't work as Power BI doesn't recognise that the Gateway is active upon the reboot. It would be very interesting to hear about your experiences with this issue.

For anyone that encounters this in the future. This is the batch file i've used over the last few days to prevent the connection leaks from occuring.


net stop PBIEgwService
Taskkill /IM GWConfig.exe /F
timeout /t 30
net start PBIEgwService
"C:\Users\Administrator\AppData\Local\Power BI Personal Gateway\1.0\Configurator\GWConfig.exe"



As well as rebooting the service it's necessary to restart GWConfig. Without this the web client doesn't recognise that a Gateway is online. It's also necessary to have a taskkill on the GWConfig to prevent multiple instances being active.

This is still an issue for us. 


I can't find anything in the Gateway updates that suggestst that this problem is even recognised.


The workaround does drop the connections, but the number of concurrent connections is building up now prior to the closing of the connections to levels that are starting to cause issues with other systems that require connections.


Does anyone know if this is going to be dealt with?

We're also seeing this issue.


The poor handling of connections also results in a failed refresh if you do a database restore of the source Postgres database. Personal Gateway has to be restarted in order to flush out its connections and reconnect successfully.


We're currently having to periodically run a variation of the suggested script (updated for Personal Gateway 2.0) to restart our gateway. 



Taskkill /IM GWConfig.exe /F
timeout /t 5
& "C:\Users\Administrator\AppData\Local\Power BI Gateway - Personal\2.0\Configurator\GWConfig.exe"



Any permanent solution for this bug ? I see that it has been discussed since 2015.

Helpful resources

July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors