Skip to main content

Notifications

Power Automate - Using Connectors
Unanswered

502 BadGateway Error when creating OneDrive file

(0) ShareShare
ReportReport
Posted on by 16

I have a flow which runs when an email is received and for each attachment it moves the attachment to a one drive folder.

This flow has been running for over 6 months (20,000+ runs) with no issue, today this flow wont work with the 502 BadGateway error on the create file step:Flow Error.PNG

The body is:

{
"error": {
"code": 502,
"source": "flow-apim-europe-001-francecentral-01.azure-apim.net",
"clientRequestId": "a6a09fd8-a5d8-4be8-ade5-2328ed890c6c",
"message": "BadGateway",
"innerError": {
"status": 502,
"message": "An unspecified error has occurred.",
"source": "api.connectorp.svc.ms"
}
}
}
Categories:
  • Re: 502 BadGateway Error when creating OneDrive file

    In analyzing this a bit closer, here is what I found:

    • 5 days ago the Flow ran without issue
      • All 18 files were extracted from the .zip file
    • Today, I noticed the 502 when testing (its a Button trigger)
      • There are 17/18 files extracted by the action; error above occurs on a .jpg within a nested folder
      • CONFIRMED by reviewing successfull runs from 5 days ago that the .jpg file within the same nested folder structure extracted without issue
      • If I remove the .jpg, the extraction is successful

    Questions:

    • How could something that ran successfully 5 days ago, now not run successfully?
    • How do I fix this issue?

    Thank you

  • Re: 502 BadGateway Error when creating OneDrive file

    I started receiving a 502 error today on the OneDrive for Business Extract Archive to Folder action. 

    Worked yesterday. 

    So far:

    - Deleted, recreated action (no go)

    - Deleted, recreated connection (no go)

    Strangely, the action works (unzips a .zip folders contents to OneDrive for Business folder) but the Flow fails on this action with:

    {
     "error": {
     "code": 502,
     "source": "flow-apim-msmanaged-na-eastus2-01.azure-apim.net",
     "clientRequestId": "9561a1ac-0b52-464d-9b77-ae1fb1285f89",
     "message": "BadGateway",
     "innerError": {
     "status": 502,
     "message": "Unable to upload contents of file '/Content/test-1.zip': One or more files failed to upload.",
     "source": "api.connectorp.svc.ms"
     }
     }
    }

    image.png

    image.png

    image.png

    BUT THE ACTION IS COMPLETED!!

    image.pngNeed help on this. Any ideas?

  • RLV1 Profile Picture
    RLV1 2 on at
    Re: 502 BadGateway Error when creating OneDrive file

    This issue, if resolved, is back in my flows.

     

    I'm new posting here.  My flows look similar to the others:

     

    receive email

    export email

    create file.....error, 502

     

     

  • meganvwalker Profile Picture
    meganvwalker 52 on at
    Re: 502 BadGateway Error when creating OneDrive file

    Agreed. This wasn't a user issue, but a MS issue. Thanks for all the feedback from everyone! But issue resolved itself (AKA MS fixed it). 

  • MathewB Profile Picture
    MathewB 16 on at
    Re: 502 BadGateway Error when creating OneDrive file

    Hi @v-yamao-msft,

    The flow started working yesterday morning and i have had 0 issues since then, it seems like there was a temporary fault with OneDrive and Flow. 

    What should I verify as the solution as there was no user solution?
    Microsoft broke something then fixed it a day later.

    Thanks

    Mat

     

     

  • v-yamao-msft Profile Picture
    v-yamao-msft on at
    Re: 502 BadGateway Error when creating OneDrive file

    Hi @Mat_,

     

    Could you please try again with it?

    Does the issue still happen?

    What’s your location?

    Generally, error code 502 means that the failure is temporary or transient. Please click or tap Resubmit to try the flow again.

    I have made a flow likes below which is working fine.

    1.PNG2.PNG

    Please test it on your side and feel free post back if the issue still exits.

     

    Best regards,

    Mabel

     

  • MathewB Profile Picture
    MathewB 16 on at
    Re: 502 BadGateway Error when creating OneDrive file

    @Anonymous The flow worked for me too, I assume Microsoft have now fixed whatever they broke.

  • Re: 502 BadGateway Error when creating OneDrive file

    The flows worked today but we are still without a reply from Microsoft.

     

  • MathewB Profile Picture
    MathewB 16 on at
    Re: 502 BadGateway Error when creating OneDrive file

    Hi @Anonymous,

    When/If Microsoft get back to you with a fix please could you let me know?

     

    Thanks

    Mat

  • Re: 502 BadGateway Error when creating OneDrive file

    We have the exact same issue and it started this morning with more than 10 flows whos only job is to download the email attachment to onedrive

    We have a ticket open with Microsoft, but have still to receive a reply.

    I have recreated the issue by doing a new similar flow from scratch and encountered the same Bad Gateway 502 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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,636

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,942

Leaderboard

Featured topics