tessera-metrics / tessera

A dashboard front-end for graphite.
http://tessera-metrics.github.io/tessera/
Apache License 2.0
1.19k stars 81 forks source link

Unable to create dashboards when installed from pip #525

Closed tgrabiec closed 7 years ago

tgrabiec commented 9 years ago

Hi,

I Installed like this on debian:

apt-get update
apt-get install -y python-pip curl
pip install tessera
tessera

I get 500 errors when trying to list or create dashboards:

172.17.42.1 - - [16/Oct/2015 16:52:24] "GET / HTTP/1.1" 200 -
172.17.42.1 - - [16/Oct/2015 16:52:25] "GET /static/css/bundle.css HTTP/1.1" 200 -
172.17.42.1 - - [16/Oct/2015 16:52:25] "GET /static/themes/bootstrap-light.css HTTP/1.1" 200 -
172.17.42.1 - - [16/Oct/2015 16:52:25] "GET /static/tessera-typography.css HTTP/1.1" 200 -
172.17.42.1 - - [16/Oct/2015 16:52:25] "GET /static/themes/tessera-light.css HTTP/1.1" 200 -
172.17.42.1 - - [16/Oct/2015 16:52:25] "GET /static/tessera.css HTTP/1.1" 200 -
172.17.42.1 - - [16/Oct/2015 16:52:25] "GET /static/bundle.js HTTP/1.1" 200 -
172.17.42.1 - - [16/Oct/2015 16:52:25] "GET /static/tessera.js HTTP/1.1" 200 -
172.17.42.1 - - [16/Oct/2015 16:52:25] "GET /static/fonts/fontawesome-webfont.woff?v=4.2.0 HTTP/1.1" 200 -
172.17.42.1 - - [16/Oct/2015 16:52:26] "GET /api/dashboard/tagged/featured HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python2.7/dist-packages/tessera/views_api.py", line 35, in wrapper
    value = fn(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/tessera/views_api.py", line 138, in dashboard_list_tagged
    tag = database.TagRecord.query.filter_by(name=tag).first()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2333, in first
    ret = list(self[0:1])
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2200, in __getitem__
    return list(res)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2404, in __iter__
    return self._execute_and_instances(context)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2419, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 720, in execute
    return meth(self, multiparams, params)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py", line 317, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 817, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 947, in _execute_context
    context)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1108, in _handle_dbapi_exception
    exc_info
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 185, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 940, in _execute_context
    context)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 435, in do_execute
    cursor.execute(statement, parameters)
OperationalError: (OperationalError) no such table: tag u'SELECT tag.id AS tag_id, tag.name AS tag_name, tag.description AS tag_description, tag.bgcolor AS tag_bgcolor, tag.fgcolor AS tag_fgcolor \nFROM tag \nWHERE tag.name = ?\n LIMIT ? OFFSET ?' (u'featured', 1, 0)
172.17.42.1 - - [16/Oct/2015 16:52:26] "GET /api/dashboard/tagged/featured-billboard HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python2.7/dist-packages/tessera/views_api.py", line 35, in wrapper
    value = fn(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/tessera/views_api.py", line 138, in dashboard_list_tagged
    tag = database.TagRecord.query.filter_by(name=tag).first()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2333, in first
    ret = list(self[0:1])
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2200, in __getitem__
    return list(res)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2404, in __iter__
    return self._execute_and_instances(context)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2419, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 720, in execute
    return meth(self, multiparams, params)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py", line 317, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 817, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 947, in _execute_context
    context)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1108, in _handle_dbapi_exception
    exc_info
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 185, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 940, in _execute_context
    context)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 435, in do_execute
    cursor.execute(statement, parameters)
OperationalError: (OperationalError) no such table: tag u'SELECT tag.id AS tag_id, tag.name AS tag_name, tag.description AS tag_description, tag.bgcolor AS tag_bgcolor, tag.fgcolor AS tag_fgcolor \nFROM tag \nWHERE tag.name = ?\n LIMIT ? OFFSET ?' (u'featured-billboard', 1, 0)
172.17.42.1 - - [16/Oct/2015 16:52:26] "GET /favicon.ico HTTP/1.1" 404 -
172.17.42.1 - - [16/Oct/2015 16:52:31] "GET /static/css/bootstrap.css.map HTTP/1.1" 404 -

tessera version: 0.8.2

aalpern commented 9 years ago

You have to intialize the database before running the server. Run inv db.init Looks like the README is missing that step - I'll update it.

aalpern commented 9 years ago

Spoke too soon - looks like a problem with the 0.8.2 package; the bundled db file is zero bites.

aalpern commented 7 years ago

Closing this as is - we're not going to support running directly from a pip install without configuring and initializing the database first. The README has been updated to indicate that.