Network Request Returned Unexpected Error: On-premises Gateway

Network Request Returned Unexpected Error: When we try to sign-in into power bi gateway we see this kind of error which is shown in the below image.

Network Request Returned Unexpected Error

For deeper dive if we see the gateway logs and found this kind of error listed below in the images. The gateway logs will be by default in the location just take a look if this could help this kind of similar issues. the error message shows that “An existing connection was forcedly closed”

Network Request Returned Unexpected Error

Enabling HTTPS Mode?

In some scenario this error happens because of the HTTPS is disable in the gateway network.

Enable the HTTPS mode and restart the gateway and close the gateway, then sign in again. Issue will get fixed in most of the scenarios.

Enabling HTTPS Mode?

Troubleshooting Steps?

Please verify below details for Network Request Returned Unexpected Error issues

  1. Disable TLS 1.3 and test the behavior once. Probably this will fix the issue if you have followed all the steps. Click on this below link and follow the steps to disable the TLS 1.3.
    https://learn.microsoft.com/en-us/data-integration/gateway/service-gateway-communication#tls-13-for-gateway-traffic
  2. Add the user in performance Log Users group and try to reconfigure the gateway.
    • image 3
  3. If still getting the error collect the below details:
    • Collect the gateway logs for more information about the issue.
    • Collect fiddler with fiddler proxy by adding the proxy in gateway configuration file. For more about this please check the below steps:

Note: Capture Traffic from Gateway machine only.

How to collect fiddler traces for Gateway?

By default, fiddler only collects traces from applications running in the default user account, because gateway runs with a different account without these changes fiddler will not capture gateway traffic. Make sure that fiddler is already setup to collect HTTPS as described in the fiddler traces below:

  1. Locate the machine.config file, this is normally located in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config. If it is not at this location run this command in windows PowerShell [System.Runtime.InteropServices.RuntimeEnvironment]::SystemConfigurationFile
  2. Take a back up of this file to restore from after you have finished collecting traces
  3. Open machine.config as administrator with a text editor (notepad/notepad++/VSCode etc.) and add this section at the end of the configuration object and then save the file.
  <!-- The following section is to force use of Fiddler Classic for all applications, including those running in service accounts -->  
  <system.net>
   <defaultProxy>
    <proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:8888" usesystemdefault="false" />
   </defaultProxy>
  </system.net>

It should look something like this.

<configuration>
...
  <!-- The following section is to force use of Fiddler Classic for all applications, including those running in service accounts -->  
  <system.net>
   <defaultProxy>
    <proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:8888" usesystemdefault="false" />
   </defaultProxy>
  </system.net>
</configuration>
  1. Restart Gateway and Fiddler
  2. Start capture Fiddler trace
  3. Reproduce the issue
  4. Make sure to restore to the machine.config backup taken at the start

In my case I have resolved the issue by going to Microsoft document and disabling the TLS 1.3 version, the TLS version must have been enabled due to various reasons link windows updates, GP policy and Security concern from organization.

On-prem Gateway

SQL Bi Links!

  1. Kerberos Issue: NT AuthorityAnonymous Login Failed -Resolve (kingfishertechtips.in)
  2. Port Number For Analysis Services – Find Ports For SSAS? (kingfishertechtips.in)
  3. RS.exe Utility: Migrate RDL Reports To Another SSRS/PBIRS (kingfishertechtips.in)
  4. Direct Query Mode ON In Tabular Model Issue – Visual Studio (kingfishertechtips.in)
  5. SMTP Server In SSRS/PBIRS |Subscribe To Email Problem/Issue (kingfishertechtips.in)
  6. SQL Server 2022 Download, Install, Connect Using SSMS Tool (kingfishertechtips.in)
  7. Creating Tabular Project & Deploy Model To Analysis Service (kingfishertechtips.in)
  8. Deploy Tabular Project To Azure Analysis Service – SSDT Tool (kingfishertechtips.in)
  9. SSRS/PBIRS – Install And Configure The Report Server On-Prem (kingfishertechtips.in)
  10. Could Not Load Folder Contents In Portal URLs – SSRSPBIRS (kingfishertechtips.in)
  11. SSRS/PBIRS – Install And Configure The Report Server On-Prem (kingfishertechtips.in)
  12. SQL Server 2022 Download, Install, Connect Using SSMS Tool (kingfishertechtips.in)
  13. Capture Fiddler Trace for Debugging the Network Traffic (kingfishertechtips.in)
  14. On-Premises Gateway: Configure/Map SQL DB To Power Bi (kingfishertechtips.in)
  15. Fixed Column/Row Header Make Visible In Any Report (kingfishertechtips.in)
  16. Self-Signed Certificate: Configure SSRS/PBIRS With SSL (kingfishertechtips.in)
  17. Create Local User Account/Local Admin User In Windows 10/11 (kingfishertechtips.in)
  18. Login With AAD/Domain/Microsoft Account To Azure VM’s/RDP (kingfishertechtips.in)
Vickey Rajpoot
Vickey Rajpoot

Hello there! I'm dedicated Microsoft Data & AI Engineer at LTIMindtree, where I thrive technology into actionable insights. Dive into my world by visiting my YouTube channel & Webiste, "Kingfisher Tech Tips".

Articles: 109

4 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *