MuleSoft · HTTP Connector

HTTP:BAD_GATEWAY

Short answer

HTTP:BAD_GATEWAY means a server acting as a gateway or proxy received an invalid response while handling your request (HTTP 502). The fault is behind that gateway, so check the upstream service and retry.

VerifiedLast verified

01Error text

MuleSoft error
Error type: HTTP:BAD_GATEWAY

02Likely causes

  • The server acting as a gateway or proxy to manage the request received an invalid response.
  • HTTP Connector treats any status code from 500 through 599 as a failure and raises an error.

03How to fix it

  1. Check the health of the service behind the gateway or proxy you are calling.
  2. If a retry is safe, wrap the request in an Until Successful scope and set maxRetries and millisBetweenRetries.
  3. Handle the failure with an error handler of type HTTP:BAD_GATEWAY.

04Official documentation

Test every fix in a non-production environment before you apply it to production. See how entries are verified.

More for MuleSoft work:Open MuleSoft jobsMuleSoft rates and salariesHire a senior MuleSoft developer

The iPaaS Brief

Subscribe to The iPaaS Brief.

The iPaaS newsletter for the people who run integrations. From iPaaS Group.

Free. You finish on theipaasbrief.com and confirm by email.