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
Error type: HTTP:BAD_GATEWAY02Likely 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
- Check the health of the service behind the gateway or proxy you are calling.
- If a retry is safe, wrap the request in an Until Successful scope and set
maxRetriesandmillisBetweenRetries. - Handle the failure with an error handler of type
HTTP:BAD_GATEWAY.
04Official documentation
→Related errors
- HTTP:GATEWAY_TIMEOUTHTTP:GATEWAY_TIMEOUT means a server acting as a gateway or proxy did not receive a response from its upstream within the specified time (HTTP 504). The timeout happened behind the gateway, not in your Mule app's own Response Timeout.
- HTTP:SERVICE_UNAVAILABLEHTTP:SERVICE_UNAVAILABLE means the server could not handle the request because it is down for maintenance or overloaded (HTTP 503). The fault is on the remote side, so retry after a delay and handle the error if the service stays down.
- HTTP:INTERNAL_SERVER_ERRORHTTP:INTERNAL_SERVER_ERROR means the server hit a situation that prevented it from fulfilling the request the HTTP Request operation sent (HTTP 500). Read the response body and the remote system's logs to find what failed there.
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