MuleSoft · CloudHub 2.0
502 Bad Gateway during traffic switch to CloudHub 2.0
Short answer
A 502 Bad Gateway while switching traffic from CloudHub to CloudHub 2.0 usually means the dedicated load balancer cannot talk to the new app. Check that the upstream uses TLS 1.2 or higher and that the app's listener binds to 0.0.0.0.
VerifiedLast verified
01Error text
502 Bad Gateway02Likely causes
- The dedicated load balancer needs TLS 1.2 or higher as upstream.
- A stale backend IP after a redeploy.
- A path-rewrite trailing slash.
- The HTTP Listener is bound to
127.0.0.1instead of0.0.0.0. - Duplicate vanity domain paths.
03How to fix it
- In Runtime Manager, open CloudHub > Load Balancers and check the upstream TLS setting.
- Check that the app's HTTP Listener host is
0.0.0.0and that it listens on port 8081. - Choose the correct DLB endpoint in the Ingress tab. A wrong endpoint can also cause 404 errors.
- Check mapping rules for a trailing slash in the path rewrite, and for duplicate vanity domain paths.
iNotes
Brief 502 or 503 errors during private space rolling updates or patches are described as expected behavior.
04Official documentation
→Related errors
- 504 Gateway Timeout during or after traffic switch to CloudHub 2.0A 504 Gateway Timeout during or after the traffic switch to CloudHub 2.0 means a request ran longer than the load balancer waits. Keep client timeouts under 300 seconds, or raise Read Response Timeout in the private space's Advanced settings.
- HTTP:BAD_GATEWAYHTTP: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.
- Failed to bind to uri"Failed to bind to uri" on CloudHub means the app's HTTP listener is binding to a specific host instead of 0.0.0.0. Change the listener host to 0.0.0.0 and redeploy.
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