"500 Internal Server Error" for lava dashboard in development mode

Asked by Terry Guo on 2012-03-29

Hi,

I want to customize the lava dashboard, so I set up the development environment by following file SETUP-WEBDEV-ENV in package lava-deployment-tool. It works. But when click the menu Dashboard --> Bundle Streams, I always get "500 Internal Server Error", same issue happens to menu Dashboard --> Tests and etc.

The log file /srv/lava/instances/dev/var/log/lava-uwsgi.log says:

WARNING:root:dataview-specific database connection not available, dataview query is NOT sandboxed
ERROR:django.request:Internal Server Error: /dashboard/streams/
Traceback (most recent call last):
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/srv/lava/instances/dev/src/lava-dashboard/dashboard_app/views.py", line 119, in bundle_stream_list
    }, RequestContext(request)
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/shortcuts/__init__.py", line 20, in render_to_response
    return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/loader.py", line 188, in render_to_string
    return t.render(context_instance)
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/base.py", line 123, in render
    return self._render(context)
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/base.py", line 117, in _render
    return self.nodelist.render(context)
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/base.py", line 744, in render
    bits.append(self.render_node(node, context))
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/base.py", line 757, in render_node
    return node.render(context)
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 127, in render
    return compiled_parent._render(context)
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/base.py", line 117, in _render
    return self.nodelist.render(context)
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/base.py", line 744, in render
    bits.append(self.render_node(node, context))
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/base.py", line 757, in render_node
    return node.render(context)
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 127, in render
    return compiled_parent._render(context)
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/base.py", line 117, in _render
    return self.nodelist.render(context)
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/base.py", line 744, in render
    bits.append(self.render_node(node, context))
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/base.py", line 757, in render_node
    return node.render(context)
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 127, in render
    return compiled_parent._render(context)
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/base.py", line 117, in _render
    return self.nodelist.render(context)
 File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/base.py", line 744, in render
    bits.append(self.render_node(node, context))
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/base.py", line 757, in render_node
    return node.render(context)
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 127, in render
    return compiled_parent._render(context)
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/base.py", line 117, in _render
    return self.nodelist.render(context)
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/base.py", line 744, in render
    bits.append(self.render_node(node, context))
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/base.py", line 757, in render_node
    return node.render(context)
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 127, in render
    return compiled_parent._render(context)
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/base.py", line 117, in _render
    return self.nodelist.render(context)
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/base.py", line 744, in render
    bits.append(self.render_node(node, context))
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/base.py", line 757, in render_node
    return node.render(context)
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 127, in render
    return compiled_parent._render(context)
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/base.py", line 117, in _render
    return self.nodelist.render(context)
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/base.py", line 744, in render
    bits.append(self.render_node(node, context))
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/base.py", line 757, in render_node
    return node.render(context)
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 127, in render
    return compiled_parent._render(context)
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/base.py", line 117, in _render
    return self.nodelist.render(context)
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/base.py", line 744, in render
    bits.append(self.render_node(node, context))
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/base.py", line 757, in render_node
    return node.render(context)
  File "/srv/lava/instances/dev/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 64, in render
    result = block.nodelist.render(context)

Please help.

BR,
Terry

Question information

Language:
English Edit question
Status:
Solved
For:
LAVA Dashboard (deprecated) Edit question
Assignee:
No assignee Edit question
Solved by:
Terry Guo
Solved:
2012-03-29
Last query:
2012-03-29
Last reply:
Terry Guo (terry.guo) said : #1

It seems after I checkout lava dashboard code into folder /srv/lava/instances/dev/src, there isn't an explicit step in file SETUP-WEBDEV-ENV to initialize database for lava dashboard. So beside running "./setup.py develop", what else should I do?

Terry Guo (terry.guo) said : #2

Figured out by myself.

According to file SETUP-WEBDEV-ENV, you need to perform following steps:

1) Checkout the lava dashboard source code into folder /srv/lava/instances/dev/src.
2) Run command "./lava-deployment-tool install_config_app dev"
3) Activate virtualenv: ". /srv/lava/instances/dev/bin/activate"
4) Go to folder /srv/lava/instances/dev/src/lava-dashboard and run command "./setup.py develop".

For lava dashboard, you need to run another command to set up the DB.
5) ./lava-deployment-tool manage dev migrate

Then no "500 internal error".

Zygmunt Krynicki (zyga) said : #4

I have not read those instructions in a while. You need to run lava-server manage syncdb and lava-server manage migrate. You should have started with lava-deployment-tool setup, followed by install with the latest 2012.03 pybundle from lava-project download page on launchpad