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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
shvitani
Frequent Visitor

Processing error: The underlying connection was closed: An unexpected error occurred on a receive.

We keep getting this error (not always, but most at the time) on refresh, but only on Power BI Service (we have no problem from Power BI Desktop) - Please help...

 

Error details:

Hide On demand 4.1.2021 20.49.11 4.1.2021 20.54.22 Failed There was an error when processing the data in the dataset.
Processing error: The underlying connection was closed: An unexpected error occurred on a receive.
Cluster URI: WABI-WEST-EUROPE-B-PRIMARY-redirect.analysis.windows.net
Activity ID: 2d80e61f-48a2-4541-a176-1217d24cc91a
Request ID: 43eafda7-cfe0-01e2-bb3a-9f2781e6d703
Time: 2021-01-04 19:54:22Z

 

UPDATE AND MORE DETAILS:

We are requesting our own web API using these two functions:

 

GetAuthentication()

 

() => 
let
    output = Json.Document( 
        Web.Contents(
            #"www adresse",
            [   
                RelativePath ="/OmegaAPITest/Authentication/Token",
                Headers=[Accept="application/json", #"Content-Type"="application/x-www-form-urlencoded;charset=UTF-8"], 
                Content=Text.ToBinary("grant_type=password&username="&#"Brugernavn"&"&password="&Adgangskode&"&client_id=2E54A038A9E598FD325F592EBA63EAD12210DC815907D4022210DC815907D502")
                //Query=[r=Number.ToText(Number.Random())],
            ]
        )
    )
in  
    output

 

 

GetRequest(...)

 

(request as text) => 
let
    authentication = GetAuthentication(),
    output = Json.Document(   
        Web.Contents(
            #"www adresse", 
            [
                RelativePath = "/OmegaAPITest/v2/" & request,
                Timeout=#duration(0,1,0,0), //#duration(days as number, hours as number, minutes as number, seconds as number) as duration
                Headers=[#"Authorization"= "Guid " & authentication[access_token], #"Content-Type"="application/json; charset=utf-8"]
            ]
        )
    )
 in      
    output

 

 

PostRequest(...)

 

(request as text, content as text) => 
let  
    authentication = GetAuthentication(),
    output = Json.Document(
        Web.Contents(
            #"www adresse", 
            [
                RelativePath = "/OmegaAPITest/v2/" & request,
                Timeout=#duration(0,1,0,0), //#duration(days as number, hours as number, minutes as number, seconds as number) as duration
                Headers=[#"Authorization"= "Guid " & authentication[access_token], #"Content-Type"="application/json; charset=utf-8"],
                Content=Text.ToBinary(content)
            ]
        )
    )
in  
    output

 

 
We have extend our API to be able to cache the response for large data calculation - all this to overcome the problem.
Refreshing data on desktop alway work, but not then we publish it on the service and try refresh using the service.

For now it seems to work hvis API have caches some data for faster response, but only stabil if we add som delays - see new functions below:

 

GetRequestWithDelay(...)

 

(request as text, delay as number) => 
let
    output = Function.InvokeAfter(() =>
    let
        authentication = GetAuthentication(),
        response = Json.Document(   
            Web.Contents(
                #"www adresse", 
                [
                    RelativePath = "/OmegaAPITest/v2/" & request,
                    Timeout=#duration(0,1,0,0), //#duration(days as number, hours as number, minutes as number, seconds as number) as duration
                    Headers=[#"Authorization"= "Guid " & authentication[access_token], #"Content-Type"="application/json; charset=utf-8"]
                ]
            )
        )
    in 
        response, #duration(0,0,0,delay))
 in      
    output

 

 

PostRequestWithDelay(...)

 

(request as text, content as text, delay as number) => 
let
    output = Function.InvokeAfter(()=>
    let
        authentication = GetAuthentication2(),
        response = Json.Document(
                Web.Contents(
                    #"www adresse", 
                    [
                        RelativePath = "/OmegaAPITest/v2/" & request,
                        Timeout=#duration(0,1,0,0), //#duration(days as number, hours as number, minutes as number, seconds as number) as duration
                        Headers=[#"Authorization"= "Guid " & authentication[access_token], #"Content-Type"="application/json; charset=utf-8"],
                        Content=Text.ToBinary(content)
                    ]
                )
            )
    in 
        response,  #duration(0,0,0,delay))
in  
    output

 

 

6 REPLIES 6
v-jayw-msft
Community Support
Community Support

Hi @shvitani ,

 

It might caused by transport layer security (TLS) for Power BI. Check the topic below and see if it helps.

https://community.powerbi.com/t5/Service/Getting-The-underlying-connection-was-closed/td-p/1216847 

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Hi Jay,

 

Thanks for your reply, I have almost tried everything related to the transport layer security (TLS), nothing helped - please note that it's not on every refresh it crash, but most of the time.

 

Hi @shvitani ,

 

If this situation happens completely randomly, it will be difficult to debug the issue.

You could try to open a support ticket. It is free if you have a Pro account.

Go to https://support.powerbi.com. Scroll down and click "CREATE SUPPORT TICKET".

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Hi Jay,

 

Please note, we have added more details - do you think we need to create a support ticket? 🙂

aj1973
Community Champion
Community Champion

Hi @shvitani 

Is the Gateway up-to-date?

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Hi Amine,

 

Our report use Power Query to get data using our own public API. The report don't use gateway...

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors