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
Super User II
Super User II

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
New Member

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

3 REPLIES 3
ChristianAbata
Super User II
Super User II

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
New Member

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

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": []
}
}
}

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,201)