How to debug 503 errors in Openshift?

I have a scalable EAP 6.0 web application hosted on Openshift and I get HTTP 503 error messages whenever I try to access the application. How to fix it.

+7
source share
2 answers

In my case, this was a problem with the HAProxy cartridge, not with my web cartridge. I found this while trying to view the HAProxy status page at http://app-domain.rhcloud.com/haproxy-status/ (obviously, you will have to replace the application and the domain in this URL with your own Openshift settings). This page displayed error 503.

To fix this, ssh into a HAProxy session using

ssh 1234567890abcdef1234567890abcdef@app-domain.rhcloud.com 

You will get your actual username and hostname from the OpenShift web admin console. Then run

 ctl_app restart 

This will restart HAProxy. And for me it solved the problem.

Another handy tip I found during debugging was that you can go to a specific instance of your web cartridge bypassing HAProxy.

On the HAProxy status page, you can see that the web cartridge instance is called gear-1234567890ab-domain. Remove the β€œgear-” prefix, and then use the remaining hexadecimal characters and the domain name to form the URL, for example:

 1234567890ab-domain.rhcloud.com 

This will lead you directly to a specific web cartridge, bypassing any problems with HAProxy.

+9
source

Thanks Phyxx,

His work for me allows you to detail your proposal so that others can also win.

Step 1: cd / var / lib / openshift / your server / haproxy / conf

Step 2: vi haproxy.cfg

step 3: remove the "httpchk get / option"

Step 4: save

Step 5: restart ctl_app

0
source

All Articles