Forum Discussion

Pranoti98's avatar
Pranoti98
Frequent Visitor
10 months ago
Solved

refresh error :Web.Contents failed to get contents... (502): Bad Gateway

I've been using Power BI to connect to data collected via the KoBoToolbox API (https://kf.kobotoolbox.org). Everything was working smoothly until recently, when I started facing persistent refresh failures both in Power BI Desktop and the Power BI Service. In Desktop, the queries show errors like:
Web.Contents failed to get contents... (502): Bad Gateway and Unable to read data from the transport connection: The connection was closed.

In the Power BI Service, although the data source connections show as successful, the scheduled refresh fails with a generic “internal service error”, and occasionally a message saying:

"The last refresh attempt failed because of an internal service error. This is usually a transient issue. If you try again later and still see this message, contact support."

I suspect this is due to large data payloads or API throttling from KoBoToolbox. I’ve tried manually refreshing and even chunking data through pagination, but it’s still slow and unreliable. Has anyone else experienced something similar with KoBo or other API-based JSON endpoints in Power BI?

  • Anonymous's avatar
    Anonymous
    10 months ago

    Hi Pranoti98 ,

    Thank you for reaching out to the Microsoft fabric community forum. Thank you amitchandak and rohit1991  for your response.

     

    You don’t have to rebuild your report. Keep all visuals and measures. Just change the source so the API data is first saved to a stable location (SharePoint, OneDrive, Dataverse, Azure, etc.) and then connect Power BI to that stored file/table. This avoids throttling and gives reliable refresh.
    Also let me know as amitchandak mentioned have you raised the issue in issues forum?

     

    Thank you.

6 Replies

  • Hii Pranoti98 

     

    Your Power BI configuration is fine  the refresh failure is happening because KoBoToolbox is timing out or throttling large requests, which causes these 502 errors. Splitting the data into smaller chunks plus retry logic is the most reliable fix. If the KoBo API keeps returning 502, the only stable workaround is: don’t connect Power BI directly >> store the API data somewhere reliable >> refresh from that source.

    • Pranoti98's avatar
      Pranoti98
      Frequent Visitor

      Hey Rohit,
      Thanks for your reply.
      thing is that i am working on this dahsboard since last 2 months, and i am worried if i do saves data to cloude/sharepoint and then access it from there, i need to do everything from start. 

      Thanks

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Pranoti98 ,

    Thank you for reaching out to the Microsoft fabric community forum. Thank you amitchandak and rohit1991  for your response.

     

    You don’t have to rebuild your report. Keep all visuals and measures. Just change the source so the API data is first saved to a stable location (SharePoint, OneDrive, Dataverse, Azure, etc.) and then connect Power BI to that stored file/table. This avoids throttling and gives reliable refresh.
    Also let me know as amitchandak mentioned have you raised the issue in issues forum?

     

    Thank you.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Pranoti98 ,

     

    Could you please confirm if the issue has been resolved through the raising issue in issues forum? If the issue has been resolved, we kindly request you to share the resolution or key insights here to help others in the community.

    Please feel free to contact us if you have any further questions.

     

    Thank you.