dcrosta / professor

Painless profiling for MongoDB
105 stars 9 forks source link

None.html missing? An error without a code. #7

Open peterbe opened 12 years ago

peterbe commented 12 years ago

I wouldn't be so lazy and not look it up in the source myself but today I'm just too body.

Error on request:
Traceback (most recent call last):
  File "/home/tornado/aroundtheworld/professor_env/lib/python2.6/site-packages/Werkzeug-0.8.3-py2.6.egg/werkzeug/serving.py", line 159, in run_wsgi
    execute(app)
  File "/home/tornado/aroundtheworld/professor_env/lib/python2.6/site-packages/Werkzeug-0.8.3-py2.6.egg/werkzeug/serving.py", line 146, in execute
    application_iter = app(environ, start_response)
  File "/home/tornado/aroundtheworld/professor_env/lib/python2.6/site-packages/Flask-0.8-py2.6.egg/flask/app.py", line 1518, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/tornado/aroundtheworld/professor_env/lib/python2.6/site-packages/Flask-0.8-py2.6.egg/flask/app.py", line 1506, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/home/tornado/aroundtheworld/professor_env/lib/python2.6/site-packages/Flask-0.8-py2.6.egg/flask/app.py", line 1197, in handle_exception
    return handler(e)
  File "/home/tornado/aroundtheworld/professor/professor/views.py", line 230, in not_found
    return render_template(str(error.code) + '.html')
  File "/home/tornado/aroundtheworld/professor_env/lib/python2.6/site-packages/Flask-0.8-py2.6.egg/flask/templating.py", line 122, in render_template
    return _render(ctx.app.jinja_env.get_template(template_name),
  File "/home/tornado/aroundtheworld/professor_env/lib/python2.6/site-packages/Jinja2-2.6-py2.6.egg/jinja2/environment.py", line 719, in get_template
    return self._load_template(name, self.make_globals(globals))
  File "/home/tornado/aroundtheworld/professor_env/lib/python2.6/site-packages/Jinja2-2.6-py2.6.egg/jinja2/environment.py", line 693, in _load_template
    template = self.loader.load(self, name, globals)
  File "/home/tornado/aroundtheworld/professor_env/lib/python2.6/site-packages/Jinja2-2.6-py2.6.egg/jinja2/loaders.py", line 115, in load
    source, filename, uptodate = self.get_source(environment, name)
  File "/home/tornado/aroundtheworld/professor_env/lib/python2.6/site-packages/Flask-0.8-py2.6.egg/flask/templating.py", line 61, in get_source
    raise TemplateNotFound(template)
TemplateNotFound: None.html
dcrosta commented 12 years ago

Can you reproduce this consistently? If so, would you mind running the server in debug mode (python server.py -d will do the trick) and find out what the underlying exception is? I suspect I know what the fix for this particular bug is, but I want to understand the underlying issue better as well.

lanecm commented 11 years ago

I encountered the exact same error. Ran server in debug mode and got the following error:

OperationFailure: database error: too much data for sort() with no index. add an index or specify a smaller limit

Occurs at line 160 in professor.logic.aggregate function. I think maybe you need an index on profiles collection.

tairov commented 11 years ago

I added the following indexes. It helps me to resolve some failures in logs.

db.profiles.ensureIndex({collection: 1});
db.profiles.ensureIndex({collection: 1, op: 1});
db.profiles.ensureIndex({collection: 1, op: 1, skel: 1});