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 Automate
Answered

BadGateway failure

(0) ShareShare
ReportReport
Posted on by 18
I have a Microsoft Form which when it is completed will send an email to an inbox through Power Automate, along with an attachment.
 
This morning I have received the below error message on all the forms that work like this - 
 
INPUTS
 
{
    "host": {
        "connectionReferenceName""shared_onedriveforbusiness",
        "operationId""GetFileContent"
    },
    "parameters": {
        "id""012G53PZPSVRA6L7D7TFCYLYSPOH5UP7IY",
        "inferContentType"true
    }
}
 
OUTPUTS
 
{
  "error": {
    "code"502,
    "source""flow-apim-europe-001-westeurope-01.azure-apim.net",
    "clientRequestId""41aa403d-6120-40f7-9b5d-eab1e05a9d8a",
    "message""BadGateway",
    "innerError": {
      "status"500,
      "message""An error was encountered while retrieving the user profile.\r\nclientRequestId: 41aa403d-6120-40f7-9b5d-eab1e05a9d8a\r\nserviceRequestId: 13d500a2-c02b-9000-2554-4ae5dce9fcd5"
    }
  }
 
Can someone help please?
 
Attached is a snip from the original flow.
Power Automate1.png
Categories:
I have the same question (0)
  • Verified answer
    PowerDeveloperTP Profile Picture
    453 on at
    Hello,
     
    Could you please try re authenticating the one connection and try again. It might be because of broken connection.
     
     
    Thank you.
    Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
    This helps others find solutions to future issues!
     
  • GL-17031010-0 Profile Picture
    18 on at
    Thanks for your reply, One of the connections was disconnected so I reconnected and tested one of the forms but it still didn't come through to the mailbox.
  • PowerDeveloperTP Profile Picture
    453 on at
     
    Are you still experiencing the same error after fixing the broken connection?
     
    Thank you.
     
  • Suggested answer
    deepakmehta13a Profile Picture
    369 on at

    Hi,

    From the details and the error message shared, this looks like a connector-related issue rather than a problem with your flow logic.

    The error:

    BadGateway (502) with inner error “An error was encountered while retrieving the user profile”

    typically occurs when the OneDrive for Business connector is unable to resolve the user context or access the file, even though the file ID is passed correctly.

    A few things you can try:

    1. Recreate or refresh the connection
      Sometimes the connection token becomes invalid or cannot retrieve the user profile properly. Try:

    • Removing the OneDrive for Business connection

    • Re-adding it

    • Updating the flow to use the new connection

    1. Verify file ownership and location
      Ensure that the file you are trying to access:

    • Exists in the same OneDrive account tied to the connection

    • Has not been moved or deleted

    • Is accessible by the account running the flow

    1. Check permissions
      If the file is coming from Forms or another source, confirm that:

    • The account used in the flow has access to that file

    • There are no permission changes recently

    1. Retry / transient issue
      Since this started suddenly and is affecting multiple flows, it could be a temporary service issue on the connector side. These 502/500 errors are often transient.
      You can:

    • Check if the flow succeeds on retry

    • Add retry policy or delay if needed

    1. Test the action separately
      Try creating a simple flow with only:

    • Get file content
      to confirm whether the issue is reproducible outside this flow.

    Based on similar cases, this issue is often related to connection context or temporary backend service errors, not the flow configuration itself.

    Hope this helps.

    If this helps resolve your issue, please consider marking the response as Verified so it can help others facing a similar scenario.

    If you found this helpful, you can also click “Yes” on “Was this reply helpful?” or give it a Like.

  • GL-17031010-0 Profile Picture
    18 on at
    Thanks everyone, it seems to be working now so maybe took a few hours to sort itself out after I reconnected.
    Thanks for the help

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard