Search code examples
python-2.7openshifttail

How to troubleshoot 500 errors in Python on OpenShift using tail?


Problem

I want to troubleshoot 500 errors showing on the front end of a Python app on OpenShift using tail.

What I've Tried

rhc tail [appname]

This returns lots of results (from over 6 months ago) which are hard to search through and 'too many files open' error messages.


Solution

  • Solution

    It took me a while to figure this out, so just posting my current solution for posterity and my own reference.

    I ran the following which I think cleans up old logs:

    rhc app tidy [appname]
    

    I then ran what I think is a more specified tail request, which just returns the Python log file:

    rhc tail -f app-root/logs/python.log [appname]
    

    And can see a bit more relevant detail now.

    When you have this open in the shell and take the action on the front end of the website that causes the error, the results will show live in the shell.

    I am sure there is even more specific logs available to view, but this was the best I could find at the moment.