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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Unable to make a connection to my postgresql server through the online environment

Hello,

 

Despite quite the troubleshooting online, I have not found a solution to the issue I have. 

 

I store and retrieve my data from my postgres server hosted on the same machine I make my reports on. To connect, I use the localhost IP-address and the port number would be 5432 in this case. This works fine through the Power BI Desktop app. However, since I want to setup a scheduled refresh, I have to configure a connection through the online environment as well. 

 

I downloaded the standard gateway and that - seemingly - works well. I can connect my local excel files without any hassle. The issue starts when I want to configure my postgres database server. The following error shows up:

 

"Failed to update data source credentials: An error happened while reading data from the provider: 'No connection could be made because the target machine actively refused it'"

 

ShomeNL_2-1662039832972.png

 

 

Now I have tried turning off the firewall to see whether that was the issue; no luck there. I also checked my command prompt with the help of netstat -anb, which did show something that I thought might be the issue:

 

ShomeNL_0-1662039523047.png

 

postgres seems to be listening on a different port than the one initialized in the configuration files and the port that it should be on, is occupied by a different program. However, Power BI Desktop can still connect to the database without any issue and svchost.exe seems to just be Windows' way of handling things on the back-end. 

 

I have also granted access to other IP-addresses through the configuration files in my postgres folder hoping that that would help, but nothing seems to. 

 

Anyone who might be able to assist me? 

Status: Investigating
Comments
Anonymous
Not applicable

Hi @ShomeNL 

You can try to use ODBC to connect to postgresql server .

PostgreSQL To Power BI: 3 Best Ways To Connect - Learn | Hevo (hevodata.com)

 

Best Regards,
Community Support Team _ Ailsa Tao

Anonymous
Not applicable

Hi!

I'm experiencing same problem.

In my case  I'm connected to a postgre DB hosted in a cloud server. The connection is done through a bitvise tunnel which is working fine in Powerbi Desktop, I can retrieve all data and connection is good. This generates the connection in "localhost:5005".

After uploading the file to PowerBi Service I get problem even to validate credentials getting the same error:

2024-10-14_09h14_11.png

By the way, ODBC connection works fine but it's extremly slow this is why I need to go to direct connection, which is definitively faster at least in desktop.

Thanks in avdance for your support.

Best

David