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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Bad gateway 502 Onedri...
Power Automate
Unanswered

Bad gateway 502 Onedrive pdf converter

(0) ShareShare
ReportReport
Posted on by 175

Hello Everyone,

 

I had built a flow 2 months ago that would convert word files on a sharepoint document repository into PDF. Eventually it evolved to converting excel files so a switch case was built to accomodate. This was all working fine for a while until yesterday 10/28.

 

The flow was able to save the file to onedrive but failed on the conversion to PDF with a bad gateway 502 error. In the body it stated:

"The underlying connection was closed: An unexpected error occurred on a send.\r\n inner exception: An error occurred while sending the request.\r\n inner exception: The underlying connection was closed: An unexpected error occurred on a send.\r\n inner exception: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.\r\n inner exception: An existing connection was forcibly closed by the remote host",
 
I attempted to rerun the flow and try other files and resulted in the same thing.
 
I decided to open a support ticket. Support had me rebuild the connector connection and noticed the icon for onedrive had updated. It continued to fail, so we ended up rebuilding a copy of the flow and resulted in the same issue. The tech upon checking the gateways tab was met with a message about needing a subscription stated to me pdf conversion on onedrive needed a premium licensce. I was totally confused stating that it made no sense as the changes occurred oct 1st and still ran fine up until yesterday.  It then evolved into saying i was possibly on a trial account. (I am under GCC g3 Lic, and not using free flow). Eventually he got back to me and explained he was wrong so we further troubleshoot the issue.
 
We ended up opening up IE with browser cache clear. The flow tested and then ran fine without the gateway issue. His explanation was that when i built my flow, the flow designer was possibly pulling in old cached information into building my flow therefore resulting in the gateway 502 errors. Resaving in IE with new cache clear fixed the problem was his explanation. This baffled me as it didnt really make sense that a cloud platform would rely on browser cache to authenticate. This would lead me to believe there are many other users that run into this same scenario using Chrome.
 
Has anyone ran into a similar incident and explanation like this before? Also if anyone knows the onedrive pdf converter requires a premium lic? Or was i fed a bunch of baloney and connections on the backend fixed itself. If this is truly the root cause of the issue, then the flow designer needs to be redesigned.
 
Thanks
Jason
Categories:
I have the same question (0)
  • Gristy Profile Picture
    2,429 on at

    not seen that before as you describe but a good one to keep in mind.

     

    currently the onedrive pdf conversion is not premium connector i am sure it will change in the future though.

  • v-litu-msft Profile Picture
    on at

    Hi @JasonK,

     

    I have tested on my side using the Chrome, it runs successful, not happened the issue you met:

    Annotation 2019-10-29 145846.png

     

    Annotation 2019-10-29 145829.png

    Convert file into PDF feature not need premium license. The error message is "The underlying connection was closed" , so the issue may be caused by the fact that connection of OneDrive was invalid, to let it go ahead, you need to create a new connection. But sometimes, the invalid connection will store in the browser, so you may need to clear them, and try again. Or save as a copy Flow, export it and import it back, etc. Hope it helps.

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • JasonK Profile Picture
    175 on at

    Thanks for the reply,

     

    Thats the thing, this flow had worked fine for 2 + months and then all of a sudden stopped working. Are there any changelogs on specific functions? Only thing i can think of if something changed with the pdf converter (in terms of code or functionality) that would cause it to stop functioning with old code and require a recreation. Either way this causes a negative impact to users needing to be aware of backend functionality changes.

  • v-litu-msft Profile Picture
    on at

    Hi @JasonK,

     

    At present, it seems that connection is more likely to expire. You can try to recreate a new connection just like I told, if it work, it will be caused by the connection expire.

    Or you can recreate the action, if it can resolve your issue, it may be caused by the your deduction.

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • rjhale Profile Picture
    212 on at

    I'm having a similar issue where the Convert File step results in a Bad Gateway error, but it happens very inconsistently.  For example, I have a Flow the converts a variable set of files to pdf every morning.  This morning it failed converting 3 of 16 files.  Yesterday it failed converting 2 of 8 files.  When I rerun the Flow it either fails on different files or it successfully converts all of them.  There seems to be no rhyme or reason as to when it fails.  

     

    I would really like to know of a way make this conversion process more stable short of using a 3rd party connector.  

  • JasonK Profile Picture
    175 on at

    From what I can tell this issue is recurring and sporadic because its network issues on microsoft's end. I have a feeling some CDNs where stuff is stored is having connectivity issue thus the bad gateway errors. 

     

    My only suggestion is keep opening tickets to MS for this and keep an eye on the admin center health status. There may be some correlations to their network outages and bad gateway msgs that are occurring (Onedrive, Powerautomate, Sharepoint, etc.).

     

    One other possible suggestion is take a look at the trigger properties. There is a retry policy setting there: 

     
  • JasonK Profile Picture
    175 on at

    My response got flagged as spam for some odd reason.

     

    Basically i think the issue is network connection related on microsoft side. 

    One thing i would suggest trying is tweaking the retry policy on the trigger policy. 

  • JasonK Profile Picture
    175 on at

    And i have cursed myself as BAD GATEWAY on pdf conversion has started popping up again on all pdf conversions since 1/14/20. Opening another ticket with microsoft as no changes were made to the flow. 

  • rjhale Profile Picture
    212 on at

    I'm running into the Bad Gateway errors again this morning as well.  I'm in the midwest.  This is getting annoying.  

  • JasonK Profile Picture
    175 on at

    Are you in GCC tenant btw? The pattern seems to be network related issue on microsoft's end. Thats my guess

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard