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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ralwi65
Frequent Visitor

Postgres via PBI Service: No connection could be made because the target machine actively refused it

I wrote a report using DirectQuery Connection to a on-Premis PostgreSQL Database. Everything works fine except the connection via Power BI Service. The error message is  "No connection could be made because the target machine actively refused it"

ralwi65_0-1748251492171.png

We are using a DNS entry since connecting directly with the IP is not currently supported.

 

Is this for sure a network (firewall / port) issue?

Our network team told me that everything is open and they have checked if carefully.

Any ideas? Help is appreciated.

 

Thank you very much.

1 ACCEPTED SOLUTION
v-pgoloju
Community Support
Community Support

Hi @ralwi65,

 

Thank you for reaching out to the Microsoft Fabric Forum Community.


Try these troubleshoot points:

 

Temporarily disable antivirus/firewall on the PostgreSQL host and test.

Try using IP address directly (if DNS might be masking something).

Create a local test report using the gateway machine with a simple connection string and try using that in the gateway.

Check for TLS/SSL enforcement mismatches between Gateway and PostgreSQL.

 


If the issue still persists, I’d recommend raising a support ticket with Microsoft. The support team can look into the backend and provide more in-depth assistance tailored to your environment.


https://learn.microsoft.com/en-us/power-bi/support/create-support-ticket

 

If this information was helpful, kindly mark the response as accepted and give it a thumbs-up so it can assist others as well.

 

Best regards,
Prasanna Kumar

View solution in original post

13 REPLIES 13
v-pgoloju
Community Support
Community Support

Hi @ralwi65,

 

Thank you for  for engaging with the Microsoft Fabric Forum Community.

 

As we haven’t received any further updates and there are no outstanding queries at the moment, we’ll go ahead and close this thread for now. If you have any additional questions in the future, please don’t hesitate to start a new thread we’re always here to help.


Warm regards,
Prasanna Kumar

v-pgoloju
Community Support
Community Support

Hi @ralwi65,

 

Just checking, have you had a chance to open a support ticket, as suggested. If so, we'd love to hear the current status or any updates from that.

If the issue was resolved through the support ticket, it would be great if you could share the solution here as well. It could really help other community members find answers more quickly.

 

Warm regards,
Prasanna Kumar

v-pgoloju
Community Support
Community Support

Hi @ralwi65,

 

Thank you for reaching out to the Microsoft Fabric Forum Community.


Try these troubleshoot points:

 

Temporarily disable antivirus/firewall on the PostgreSQL host and test.

Try using IP address directly (if DNS might be masking something).

Create a local test report using the gateway machine with a simple connection string and try using that in the gateway.

Check for TLS/SSL enforcement mismatches between Gateway and PostgreSQL.

 


If the issue still persists, I’d recommend raising a support ticket with Microsoft. The support team can look into the backend and provide more in-depth assistance tailored to your environment.


https://learn.microsoft.com/en-us/power-bi/support/create-support-ticket

 

If this information was helpful, kindly mark the response as accepted and give it a thumbs-up so it can assist others as well.

 

Best regards,
Prasanna Kumar

v-pgoloju
Community Support
Community Support

Hi @ralwi65,

 

Thank you for reaching out to the Microsoft Fabric Forum Community.

And aslo Thanks to @GilbertQ for prompt and helpful response.

 

checklist to troubleshoot the error:

Ensure it’s listening on the right port/interface. Verify postgresql.conf (listen_addresses) and pg_hba.conf.

Confirm the gateway is installed and configured properly. Test connection from the gateway machine to the PostgreSQL server.

Check both network and host-level firewalls (e.g., Windows Firewall on the DB server).

Ensure the DNS entry resolves correctly from the gateway machine.

Review PostgreSQL logs and Power BI Gateway logs for connection failures.


If this solution helped, please consider marking the response as accepted and giving it a thumbs-up so others can benefit as well.

 

Best regards,
Prasanna Kumar

 

Additional info:

The Power PI Desktop Application runs on the same maschine where the Gateway is located. Access from Power BI Desktop to PostgreSQL database is working correctly, only the PB Service throws an error.

Thank you

When setting up the connection in the gateway the following error is thrown:

Unable to update connection credentials. Unable to connect to the data source. Either the data source is inaccessible, a connection timeout occurred, or the data source credentials are invalid. Please verify the data source configuration and contact a data source administrator to troubleshoot this issue.

 


Details: An error happened while reading data from the provider: 'No connection could be made because the target machine actively refused it' Please have this information handy if you choose to create a support ticket. Session Id: (...)

Cluster URI: https://api.powerbi.com

Status code: 400 Time: Tue May 27 2025 09:50:32 GMT+0200 (Central European Summer Time) 

ralwi65_0-1748332584300.png

Hey @ralwi65 ,
which version of the Postgre driver do you have in place - on your Gateway VM?
Here you can see my setup, up and running.

sergej_og_0-1748375411893.png

You have to use a specific one, not the latest. Since the latest versions of this drivers are not supported. That was the case at least 6 months ago.

Regards

Hi sergej_og,

we are using 4.0.17.

ralwi65_0-1748417853179.png

Which version do you have in use?

Thank you, Ralf

 

Thank you, but unfortunalety we get the same error: 

"No connection could be made because the target machine actively refused it"

As far I can remember there two check boxes at the beginning of the installation...before clicking "install".
Have you checked both?

ok, pls try version 4.0.10.

GilbertQ
Super User
Super User

Hi @ralwi65 

 

Based off the error message above, it appears that the target machine you're going to, which is your postgres database, is not accepting the call. What I recommend you can try to do is use the command prompt to telnet on the dns name and port to the postgre server and see if that can access it successfully. How to telnet to an IP address on a specific port? - Super User





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Hi @ralwi65 ,

 

You can try whatever @GilbertQ mentioned.It will give more details (issue with gateway/driver/network) to understand the issue.

 

Thanks,

Sai Teja 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.