Forum Discussion

ralwi65's avatar
ralwi65
Frequent Visitor
1 year ago
Solved

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"

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.

  • Anonymous's avatar
    Anonymous
    1 year ago

    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

13 Replies

    • SaiTejaTalasila's avatar
      SaiTejaTalasila
      Icon for Super User rankSuper User

      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 

  • Anonymous's avatar
    Anonymous
    Not applicable

    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

     

    • ralwi65's avatar
      ralwi65
      Frequent Visitor

      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

      • ralwi65's avatar
        ralwi65
        Frequent Visitor

        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) 

  • Anonymous's avatar
    Anonymous
    Not applicable

    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

  • Anonymous's avatar
    Anonymous
    Not applicable

    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

  • Anonymous's avatar
    Anonymous
    Not applicable

    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