How to trace a page not showing up?

69 views
Skip to first unread message

Helgi Örn Helgason

unread,
Oct 7, 2014, 6:57:52 AM10/7/14
to django...@googlegroups.com
Hi!
I am quite new when it comes to Django and Python. I am responsible for a rather disfunctional Django website package which is rather messy (I have this confirmed by an experienced Django/Pyton developer who took a look at it). The system is in use serving a school organisation.

My most acute problem right now is to find a way to trace why a page on our web suddenly quit showing up, going to the url just loads for a while and then stops with nothing showing up, just blank white.
This page was working perfectly before we did a supervisorctl restart after a power failure, and it is still visible in Django admin.
The rest of the web is working properly.

What can I possibly do to find out what's causing this? How can I trace errors like this one in a Django system?

The system is Django 1.3, Python 2.7.3, PostgreSQL, Nginx.

Erik Cederstrand

unread,
Oct 7, 2014, 8:16:06 AM10/7/14
to Django Users
The simplest solution is to insert a breakpoint (https://docs.python.org/2/library/pdb.html) at the beginning of your view, start the development server and load the problematic URL in a browser. Then go to the terminal and single-step through your view to find out where it's stalling.

If you page uses javascript, it's possible that Django loads the page correctly and the problem lies in your javascript code instead.

Erik

Collin Anderson

unread,
Oct 7, 2014, 12:44:00 PM10/7/14
to django...@googlegroups.com
Or raise an exception or use print statements.

It could also be that nginx is timing out, but usually it will say that. You could open up the development tools (right click, inspect element) and see what error code the network tab says.

Helgi Örn Helgason

unread,
Oct 10, 2014, 5:45:45 AM10/10/14
to django...@googlegroups.com

Thank you Erik and Collin for your replies, of which I yet haven't tried out, perhaps because I don't fully understand them. Like a said; I am a noob in Django/Python. :-/

But I have stumbled upon something that could maybe be of help, a thing called solr seems to be causing some problems.

supervisor error log says:
Failed to query Solr using 'django_ct:projects.project': [Errno 110] Connection timed out

and manage.py rebuild_index gives me this:
Removing all documents from your index because you said so.
Failed to clear Solr index: [Errno 110] Connection timed out
All documents removed.
Indexing 3933 People.
Failed to add documents to Solr: [Errno 110] Connection timed out

Can this solr thing block pages from showing?

There are now three branches of our site tree that are not showing up. :(

Tom Evans

unread,
Oct 10, 2014, 6:34:35 AM10/10/14
to django...@googlegroups.com
Yes, SOLR is a search index/database/analysis engine. Depending how
much your site uses it, it could be essential to displaying web pages.

The errors messages you get from SOLR are "Connection timed out"
(errno=110). This means you tried to connect to SOLR, it waited a
bunch of time (probably 30 seconds) and then gave up. The problem is
that your webserver will wait a bunch of time (probably also 30
seconds) and then give up and deliver an empty/blank/error page to the
client (depends on the server).

Is SOLR running? It is usually run inside tomcat, and has a web ui
interface for controlling it. It usually runs on port 8983, "sudo
netstat -lpn | grep java" if it is not.

Tom

PS Django 1.3 has known security flaws, please do upgrade to Django
1.4, which has long term support and should not require major changes
to your own code.

Helgi Örn Helgason

unread,
Oct 10, 2014, 7:18:41 AM10/10/14
to django...@googlegroups.com
Thank's Tom,

solr is most probably not running.

sudo netstat -lpn | grep java
gave nothing at all

/Helgi

Helgi Örn Helgason

unread,
Oct 13, 2014, 6:07:46 AM10/13/14
to django...@googlegroups.com
Found this in a __init__.py file:

HAYSTACK_SEARCH_ENGINE = 'solr'

Solr was not running, the Jetty servlet engine is on a seperate server that was not working. The thing is running now and one of the branches on the site is up and running again. Two more to go. :-/
Reply all
Reply to author
Forward
0 new messages