Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I debug 503 errors in Openshift?

Tags:

openshift

I have a scalable EAP 6.0 web app hosted on Openshift, and I get HTTP 503 error messages whenever I attempt to access the app. How do I fix this.

like image 735
Phyxx Avatar asked Jul 25 '12 05:07

Phyxx


1 Answers

In my case this was an issue with the HAProxy cartridge, and not my web cartridge. I found this out by attempting to view the HAProxy status page at http://app-domain.rhcloud.com/haproxy-status/ (obviously you'll have to replace app and domain in that URL to match your own Openshift settings). That page was displaying a 503 error.

To fix it, ssh into the HAProxy session using

ssh [email protected]

You'll get your actual username and hostname from your OpenShift web admin console. Then run

ctl_app restart

This will restart the HAProxy. And for me, that fixed the issue.

Another handy tip I found while debugging this was that you can browse to a specific instance of your web cartridge, bypassing the HAProxy.

In the HAProxy status page, you can see that the web cartridge instance is called gear-1234567890ab-domain. Drop the "gear-" prefix, and then use the remaining hex characters and domain name to form a URL like:

1234567890ab-domain.rhcloud.com

This will take you straight to the specific web cartridge, bypassing any HAProxy issues.

like image 107
Phyxx Avatar answered Nov 03 '22 01:11

Phyxx