Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App can't rebuild database components on its own #160

Open
WillNilges opened this issue Aug 5, 2022 · 0 comments
Open

App can't rebuild database components on its own #160

WillNilges opened this issue Aug 5, 2022 · 0 comments
Labels

Comments

@WillNilges
Copy link
Member

I deleted the pool_cache table because Proxstar was erroring about it, expecting it to re-build it (since, y'know, it's a cache!), but now it's sad.

/usr/local/lib/python3.8/site-packages/rq_dashboard/legacy_config.py:26: UserWarning: Configuration option REDIS_HOST is depricated and will be removed in future versions. Please use RQ_DASHBOARD_REDIS_HOST instead.
  warnings.warn(warning_template.format(old_name=old_name, new_name=new_name), UserWarning)
/usr/local/lib/python3.8/site-packages/rq_dashboard/legacy_config.py:26: UserWarning: Configuration option REDIS_PORT is depricated and will be removed in future versions. Please use RQ_DASHBOARD_REDIS_PORT instead.
  warnings.warn(warning_template.format(old_name=old_name, new_name=new_name), UserWarning)
2022-08-04 21:39:08,890 ERROR Exception on / [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 609, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/local/lib/python3.8/site-packages/ddtrace/contrib/dbapi/__init__.py", line 118, in execute
    return self._trace_method(self.__wrapped__.execute, self._self_datadog_name, query, {}, query, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/ddtrace/contrib/psycopg/patch.py", line 69, in _trace_method
    return super(Psycopg2TracedCursor, self)._trace_method(method, name, resource, extra_tags, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/ddtrace/contrib/dbapi/__init__.py", line 81, in _trace_method
    return method(*args, **kwargs)
psycopg2.errors.UndefinedTable: relation "pool_cache" does not exist
LINE 2: FROM pool_cache
             ^


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.8/site-packages/ddtrace/contrib/flask/helpers.py", line 25, in wrapper
    return func(pin, wrapped, instance, args, kwargs)
  File "/usr/local/lib/python3.8/site-packages/ddtrace/contrib/flask/helpers.py", line 36, in wrapper
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.8/site-packages/ddtrace/contrib/flask/helpers.py", line 25, in wrapper
    return func(pin, wrapped, instance, args, kwargs)
  File "/usr/local/lib/python3.8/site-packages/ddtrace/contrib/flask/patch.py", line 481, in _traced_request
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python3.8/site-packages/ddtrace/contrib/flask/wrappers.py", line 25, in trace_func
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/flask_pyoidc/flask_pyoidc.py", line 253, in wrapper
    return view_func(*args, **kwargs)
  File "/opt/proxstar/proxstar/__init__.py", line 197, in list_vms
    vms = get_pool_cache(db)
  File "/opt/proxstar/proxstar/db.py", line 113, in get_pool_cache
    db_pools = db.query(Pool_Cache).all()
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3373, in all
    return list(self)
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3535, in __iter__
    return self._execute_and_instances(context)
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3560, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
    return meth(self, multiparams, params)
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1124, in _execute_clauseelement
    ret = self._execute_context(
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1316, in _execute_context
    self._handle_dbapi_exception(
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1510, in _handle_dbapi_exception
    util.raise_(
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
    raise exception
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
    self.dialect.do_execute(
  File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 609, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/local/lib/python3.8/site-packages/ddtrace/contrib/dbapi/__init__.py", line 118, in execute
    return self._trace_method(self.__wrapped__.execute, self._self_datadog_name, query, {}, query, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/ddtrace/contrib/psycopg/patch.py", line 69, in _trace_method
    return super(Psycopg2TracedCursor, self)._trace_method(method, name, resource, extra_tags, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/ddtrace/contrib/dbapi/__init__.py", line 81, in _trace_method
    return method(*args, **kwargs)
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation "pool_cache" does not exist
LINE 2: FROM pool_cache
             ^

[SQL: SELECT pool_cache.pool AS pool_cache_pool, pool_cache.vms AS pool_cache_vms, pool_cache.num_vms AS pool_cache_num_vms, pool_cache.usage AS pool_cache_usage, pool_cache.limits AS pool_cache_limits, pool_cache.percents AS pool_cache_percents 
FROM pool_cache]
(Background on this error at: http://sqlalche.me/e/13/f405)

It'd be cool if the app could re-build its missing schemas on its own or something.

@WillNilges WillNilges added the bug label Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant