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 Automate
Answered

BadGateway error 502

(0) ShareShare
ReportReport
Posted on by

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"
}
Categories:
I have the same question (0)
  • Verified answer
    ChristianAbata Profile Picture
    8,951 Most Valuable Professional on at

    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.

  • Verified answer
    francomusso1 Profile Picture
    15 on at

    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 Profile Picture
    8 on at

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

  • Community Power Platform Member Profile Picture
    on at

    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, 

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 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard