0

So, I am writing a django-mongo app, using mongo for storing files as well, and using the python files mongoforms and mongoengine. Things were going well for a while, but just recently I have started to get 504 errors. I am using nginx -> apache (mod_wsgi) for non-static files.

Other (non-mongo) django apps on the same server are working, as are static html pages served up by ngnix. Also, if I turn off mongodb entirely, I get the normal django debug=True error page, so when mongo is just turned off it seems that nginx, apache, and django are all able to function.

However, with mongo in the picture I am now unable to get a response. I am able to use the command line interface to mongo, and although I'm only using the 32b version, it says that I'm only using 0.0625GB for the database in question.

So, I realize this isn't enough information to figure out what my problem is, but that's more or less what I'm looking for: where do I look next? I can connect to mongo, but not via django, although I used to be able to. I've tried commenting out virtually the entire django view, just leaving the index call which is not even asking for anything from mongo, so what I'm looking for is where do I look next? Are there any debugging techniques for mongo where I can figure out why it's taking so long to respond to django? Any other ways to debug this?

I don't expect anyone to miraculously solve my problem here but telling me what info to look for next would help as I don't have much experience debugging the django-mongo connection. It worked at one time but it has stopped working and I'm not sure where to look.

rossdavidh
  • 1,966
  • 2
  • 22
  • 33
  • 1
    Try just running a find_one() instead of create/ensure_index, this might help you determine if the create/ensure_index call is timing out. Is your instance locked with fsyncLock() for some reason? Can you connect with PyMongo from the same host, using the same connection settings as Django is using? Can you run the same operations on MongoDB from PyMongo as you're trying to do in your Django view? – A. Jesse Jiryu Davis Jul 01 '13 at 17:21
  • I'm using mongoengine instead of pymongo, but the suggestion to connect at the python command line instead of through the browser was a good one. It appears (following this example: https://docs.djangoproject.com/en/1.5/intro/tutorial05/ ) is that I am getting the right response.status_code and response.content for response = client.get('/'), so this must be a server or urls.py setup problem rather than a problem with mongo or django connection per se. Thanks for the help! – rossdavidh Jul 09 '13 at 15:55

0 Answers0