cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ChloeL
New Member

BadGateway error 502

I'm trying to get the image attachment from CRM Note entity and resize the image, but the flow is getting the BadGateway error when running resize. please see the below information. Please help

 
 
 
 
 
 
 
 
 
 
 
 

2020-09-24_21h48_34.png

 

2020-09-24_21h49_41.png

 

 
 

 

 

 

 

Body

{
  "error": {
    "code"502,
    "source""australia-001.azure-apim.net",
    "clientRequestId""b1eaf79a-269f-4043-92a8-f99ac87f6578",
    "message""BadGateway",
    "innerError": {
      "HttpStatusCode"500,
      "HttpStatusMessage""An error occurred processing the request",
      "OperationId"null,
      "Errors": [
        "An error occurred executing the specified image resize operation."
      ],
      "Operation Status""Error",
      "Filename"null,
      "FileContent"null
    }
  }
}
 
Header
 
{
  "Request-Context""appId=cid-v1:4f24fb98-845b-4c7d-8f1e-e629ebb10cb5",
  "api-supported-versions""1.0",
  "X-Azure-Ref""0s4NsXwAAAABPGO1xifeZQqRvP4Afg9q3TUVMMDFFREdFMDEyMQAzOTcwZDFlNS1kODBiLTQ2NWEtYjM1Yi0wNzBjMDE2ZWU0NzI=",
  "Timing-Allow-Origin""*",
  "x-ms-apihub-cached-response""true",
  "Date""Thu, 24 Sep 2020 11:32:05 GMT",
  "X-Powered-By""ASP.NET",
  "Content-Length""534",
  "Content-Type""application/json"
}
2 ACCEPTED SOLUTIONS

Accepted Solutions
ChristianAbata
Community Champion
Community Champion

hi @ChloeL  that is an api error from Encodian service I suggest you to contact them to see what is happening. Normally this kind of errors are quick solved and temporaries.



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

View solution in original post

francomusso1
Regular Visitor

In case anyone else is experiencing this same issue, here's the solution...

It's about how files get stored in note attachments in CDS (not an error with Power Automate or Encodian's action/service/connector).

In the File Content input within the Resize an Image action, you'll need to wrap that Document field in a bas64ToBinary expression like so:

base64ToBinary(triggerOutputs()?['body/documentbody'])

...and make sure you add this via the expression editor or it won't work. Ever since I made that change, the flow has been flawless an the Encodian action is surprisingly fast.

 

Full disclosure - I didn't figure that out by myself, I contacted Encodian support who were absolutely excellent and had my issue resolved in no time. 10/10 for service 👏

View solution in original post

4 REPLIES 4
ChristianAbata
Community Champion
Community Champion

hi @ChloeL  that is an api error from Encodian service I suggest you to contact them to see what is happening. Normally this kind of errors are quick solved and temporaries.



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
francomusso1
Regular Visitor

In case anyone else is experiencing this same issue, here's the solution...

It's about how files get stored in note attachments in CDS (not an error with Power Automate or Encodian's action/service/connector).

In the File Content input within the Resize an Image action, you'll need to wrap that Document field in a bas64ToBinary expression like so:

base64ToBinary(triggerOutputs()?['body/documentbody'])

...and make sure you add this via the expression editor or it won't work. Ever since I made that change, the flow has been flawless an the Encodian action is surprisingly fast.

 

Full disclosure - I didn't figure that out by myself, I contacted Encodian support who were absolutely excellent and had my issue resolved in no time. 10/10 for service 👏

powerAutoUser
Regular Visitor

I am getting similar issue since this morning. My flow was working fine until last night. I have created Approval workflows using Business Central Connector.

 

 

{
"error": {
"code": 502,
"source": "flow-apim-msmanaged-na-eastus2-01.azure-apim.net",
"clientRequestId": "9ef809d5-6414-427d-93cb-15c093375a68",
"message": "BadGateway",
"innerError": {
"status": 500,
"message": "ErrorCode: Unknown Purchase_QuotePurchLines cannot publish Purchase_QuotePurchLines because a different entity with the same name has already been added. CorrelationId: d791b5bb-d821-475b-a52a-dd970e19a507.\r\nclientRequestId: 9ef809d5-6414-427d-93cb-15c093375a68",
"error": {
"message": "ErrorCode: Unknown Purchase_QuotePurchLines cannot publish Purchase_QuotePurchLines because a different entity with the same name has already been added. CorrelationId: d791b5bb-d821-475b-a52a-dd970e19a507."
},
"source": "api.businesscentral.dynamics.com",
"errors": []
}
}
}

Hi @francomusso1 ,

Thank you for your answer. 

 

Could you tell me how you exactly applied  this expression in your flow. 

 

Expression: base64ToBinary(triggerOutputs()?['body/documentbody'])

 

Regards, 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (2,637)