cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
aurelijusm
Level: Powered On

Getting error Bad Gateway (sometimes) while sending email with attachments

Hi,

I have a flow triggered by PowerApps, which, based on several conditions, takes the attachments from two sharepoint lists and send an email with these attachments combined (attachments are appended to array). Sometimes the flow fails - the error occurs in the part when the email needs to be sent. I get error: BadGateway

image.png

"error": {
"code": 502,
"source": "flow-apim-europe-001-westeurope-01.azure-apim.net",
"clientRequestId": "54d0c117-b7d2-4b17-98c8-a0b3c5411122",
"message": "BadGateway",
"innerError": {
"status": 502,
"message": "Request failed. Try again later.\r\nclientRequestId: 54d0c117-b7d2-4b17-98c8-a0b3c5411122",
"source": "office365-we.azconn-we-01.p.azurewebsites.net"

I know that the error is "temporary or transient", but anyways the flow cannot be simply re-submitted, therefore I would like to have a solution how to avoid it (kind of crucial process fails due to this error). I found somewhere that it could be due to attachments size? One attachment is maximum 10MB, but it could be several of them in this case. Would it help to add second step to send an email and set it to run if previous send email step failed?
1 ACCEPTED SOLUTION

Accepted Solutions
Jay-Encodian
Level 10

Re: Getting error Bad Gateway (sometimes) while sending email with attachments

Hey,
The V2 actions use the graph API which has a max limit of 4MB currently... this is detailed on the connector documentation.
The V1 actions whilst deprecated don’t use the graph API and support larger attachments.... might be a temporary work around.
You could also try adding the attachments to a zip file (.zip) using the Encodian ‘Add to Archive (ZIP)’ action but whilst you might reduce the attachment size it’s not a robust solution in isolation.
HTH
Jay

View solution in original post

5 REPLIES 5
Jay-Encodian
Level 10

Re: Getting error Bad Gateway (sometimes) while sending email with attachments

Hey,
The V2 actions use the graph API which has a max limit of 4MB currently... this is detailed on the connector documentation.
The V1 actions whilst deprecated don’t use the graph API and support larger attachments.... might be a temporary work around.
You could also try adding the attachments to a zip file (.zip) using the Encodian ‘Add to Archive (ZIP)’ action but whilst you might reduce the attachment size it’s not a robust solution in isolation.
HTH
Jay

View solution in original post

Community Support Team
Community Support Team

Re: Getting error Bad Gateway (sometimes) while sending email with attachments

Hi @aurelijusm,

 

If you want to add the second step to send an email and set it to run if the previous send email step failed, you could Configure run after, set the Second send email action should run after the previous action has failed.Annotation 2019-11-20 141451.png

 

Annotation 2019-11-20 141506.png

 

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.

aurelijusm
Level: Powered On

Re: Getting error Bad Gateway (sometimes) while sending email with attachments

Thanks.
How could I use the deprecated action? I only can see V2. By the way it is not a simple Send an Email, it is a Send an Email from a shared mailbox.

Community Support Team
Community Support Team

Re: Getting error Bad Gateway (sometimes) while sending email with attachments

Hi @aurelijusm,

 

If you cannot select the deprecated action in the list of Outlook actions, you could not use it.

Yes, you can also configure run after in the Send an Email from a shared mailbox (V2) action, no matter what actions.

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.

PoohBear
Level 8

Re: Getting error Bad Gateway (sometimes) while sending email with attachments

This is not acceptable. I am having the same issue right now. If Microsoft is going to make changes / updates then they need to ensure the new version works just as the previous version. Can someone please tell me if this will eventually be corrected?

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,809)