Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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"
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.
Solved! Go to Solution.
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
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
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
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
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)
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.
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.
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.
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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!