web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / BadGateway failure - "...
Power Automate
Suggested Answer

BadGateway failure - "Action 'Get_file_content' failed"

(1) ShareShare
ReportReport
Posted on by 10
Hi all, 
 
I have some Microsoft Forms which I use Power Automate to send emails to a specific inbox. The forms that require an attachment to be sent to the inbox are failing due to 'BadGateway' with the Error saying "Action 'Get_file_content' failed". 
 
The forms that don't require the attachment are working as usual.
 
I have experienced this before and someone advised to check the Connections on Power Automate but this all looks to be connected as it should.
 
If useful, the raw inputs & outputs are as follows:
 
Inputs
 
{
    "host": {
        "connectionReferenceName""shared_onedriveforbusiness",
        "operationId""GetFileContent"
    },
    "parameters": {
        "id""012G53PZI7NNQI4LB445AZ7AX53HJSPQCQ",
        "inferContentType"true
    }
}
 
Outputs
 
{
    "statusCode"502,
    "headers": {
        "Cache-Control""max-age=0, private",
        "Vary""Origin",
        "X-NetworkStatistics""0,65535,0,0,53,26623,26623,21493",
        "X-SharePointHealthScore""2",
        "X-MS-SPConnector""1",
        "X-SP-SERVERSTATE""ReadOnly=0",
        "DATASERVICEVERSION""3.0",
        "SPClientServiceRequestDuration""74",
        "IsOCDI""0",
        "X-DataBoundary""EU",
        "X-1DSCollectorUrl""https://eu-mobile.events.data.microsoft.com/OneCollector/1.0/",
        "X-AriaCollectorURL""https://eu-mobile.events.data.microsoft.com/Collector/3.0/",
        "SPRequestGuid""171016a2-603f-9000-21e9-941d9e8fb456",
        "request-id""171016a2-603f-9000-21e9-941d9e8fb456",
        "MS-CV""ohYQFz9gAJAh6ZQdno+0Vg.0",
        "SPLogId""171016a2-603f-9000-21e9-941d9e8fb456",
        "Strict-Transport-Security""max-age=31536000",
        "X-Frame-Options""SAMEORIGIN",
        "Content-Security-Policy""frame-ancestors 'self' teams.microsoft.com *.teams.microsoft.com *.skype.com *.teams.microsoft.us local.teams.office.com teams.cloud.microsoft *.office365.com goals.cloud.microsoft *.powerapps.com *.powerbi.com *.yammer.com engage.cloud.microsoft word.cloud.microsoft excel.cloud.microsoft powerpoint.cloud.microsoft *.officeapps.live.com *.office.com *.microsoft365.com m365.cloud.microsoft *.cloud.microsoft *.stream.azure-test.net *.dynamics.com *.microsoft.com onedrive.live.com *.onedrive.live.com teams.microsoft.com *.teams.microsoft.com securebroker.sharepointonline.com;",
        "MicrosoftSharePointTeamServices""16.0.0.27306",
        "X-Content-Type-Options""nosniff",
        "X-MS-InvokeApp""1; RequireReadOnly",
        "P3P""CP=\"ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI\"",
        "X-AspNet-Version""4.0.30319",
        "X-Powered-By""ASP.NET",
        "X-Ms-Workflow-Resourcegroup-Name""6C004F5A8E504FBB9FA7B98CD1E9F001-792AAD5C14694938AC9ED2716CDA0593",
        "x-ms-workflow-subscription-id""2c8cfba1-d125-4f31-a479-50156c7ed09f",
        "x-ms-environment-id""default-6c004f5a-8e50-4fbb-9fa7-b98cd1e9f001",
        "x-ms-tenant-id""6c004f5a-8e50-4fbb-9fa7-b98cd1e9f001",
        "x-ms-subscription-id""2c8cfba1-d125-4f31-a479-50156c7ed09f",
        "x-ms-dlp-re""GetFileContent|False|2026-05-21T18:00:59.1792544+00:00",
        "x-ms-dlp-gu""-|-",
        "x-ms-dlp-ef""-|-/-|-|-|-|-",
        "x-ms-mip-sl""-|-|-|-",
        "x-ms-au-creator-id""792aad5c-1469-4938-ac9e-d2716cda0593",
        "Timing-Allow-Origin""*",
        "x-ms-apihub-cached-response""false",
        "x-ms-apihub-obo""false",
        "Date""Fri, 22 May 2026 08:36:56 GMT",
        "Content-Length""448",
        "Content-Type""application/json",
        "Expires""Thu, 07 May 2026 08:36:56 GMT",
        "Last-Modified""Fri, 22 May 2026 08:36:56 GMT"
    },
    "body": {
        "error": {
            "code"502,
            "source""flow-apim-europe-001-westeurope-01.azure-apim.net",
            "clientRequestId""b8a44118-35ae-443a-8e34-6ebec133159b",
            "message""BadGateway",
            "innerError": {
                "status"500,
                "message""An error was encountered while retrieving the user profile.\r\nclientRequestId: b8a44118-35ae-443a-8e34-6ebec133159b\r\nserviceRequestId: 171016a2-603f-9000-21e9-941d9e8fb456"
            }
        }
    }
}
 
Any help would be greatly appreciated! Thank you
Categories:
I have the same question (0)
  • Suggested answer
    Valantis Profile Picture
    5,355 on at
     
    The error message buried in the response is the key: "An error was encountered while retrieving the user profile." This is not a file issue, it's the OneDrive for Business connector failing to authenticate the user whose profile backs the connection.
     
    This typically happens when the account that owns the OneDrive connection has changed in some way password reset, MFA re-enrollment, license change, account disabled, or the OAuth token expired and the silent refresh failed.
     
    The fix:
    1. Go to make.powerautomate.com > My connections
    2. Find the OneDrive for Business connection used by the flow
    3. Delete it
    4. Create a fresh connection by re-authenticating
    5. Go back to the flow and re-select the new connection on the Get file content action
    6. Save and test
     
    If the connection belongs to a service account, check that the service account is still active, licensed, and hasn't had a password or MFA policy change recently.
    Also worth noting: the file ID in the inputs (012G53PZI7NNQI4LB445AZ7AX53HJSPQCQ) is a hardcoded ID from a previous Forms submission.
     
    If the connection was working before and fails now specifically on this action, the connection owner's profile retrieval is the confirmed cause based on that inner error.
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

    💼 LinkedIn

    ▶️ YouTube

  • Suggested answer
    11manish Profile Picture
    2,376 on at
    Try these steps in order:
    • Recreate the OneDrive connection
    • Verify whether the form is Personal or Group
    • If Group Form → switch from OneDrive connector to SharePoint connector
    • Add a 10–20 second delay before retrieving the file
    • Re-save and republish the flow
    The connector mismatch (OneDrive vs SharePoint) and stale authentication are the two most common root causes of this exact 502 BadGateway error.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 791

#2
Valantis Profile Picture

Valantis 582

#3
Haque Profile Picture

Haque 529

Last 30 days Overall leaderboard