How to debug Django exceptions in OpenShift applications

919 views Asked by At

Background:

I am deploying a django application with Python 2.7.5 && Django 1.6. Currently I am able to render all pages, but one.

The only error I am able to see when tailing the logs is:

"GET /test/ HTTP/1.1" 500 2011 "http://myPrivateApp.rhcloud.com/myPrivatePage/" Obviously this log message doesn't tell me much other than it failed and I cannot find any django related logs within the repos.

After playing around with the other pages, I highly suspect the issue is related to an exception being thrown within the page.

Question:

How can I debug Django exception errors on OpenShift? Is it possible to step through executing code in Openshift via ssh && the use of a debugger app such as ipdb?

I would really like to dig deeper into the issue, but am not finding any clear way to do so with OpenShift.

2

There are 2 answers

1
iMitwe On

On Openshift, you can type this command :

   rhc tail -a <app-name> 

and get the traceback . It should tell you what went wrong

0
Radek On

I strongly advocate to use Sentry ( https://getsentry.com/welcome/ ) for such debugging. It just made our lives easier. You can see all the details reported and the same errors are grouped together.

Additionally you can SSH into Openshift and use the common Linux tools or to use rhc tail as mentioned.