powa-team / powa

PostgreSQL Workload Analyzer
http://powa.readthedocs.io/
PostgreSQL License
777 stars 57 forks source link

Cannot run manually built powa #184

Closed tarkhil closed 2 months ago

tarkhil commented 3 months ago

FreeBSD 14.0 Python 3.11 Postgres 15.8

(powa) tarkhil@stor:~/powa % ./bin/powa-web
Traceback (most recent call last):
  File "/home/tarkhil/powa/./bin/powa-web", line 4, in <module>
    from powa import make_app
  File "/home/tarkhil/powa/lib/python3.11/site-packages/powa/__init__.py", line 21, in <module>
    from powa.overview import Overview
  File "/home/tarkhil/powa/lib/python3.11/site-packages/powa/overview.py", line 12, in <module>
    from powa.server import ServerOverview
  File "/home/tarkhil/powa/lib/python3.11/site-packages/powa/server.py", line 15, in <module>
    from powa.config import ConfigChangesGlobal
  File "/home/tarkhil/powa/lib/python3.11/site-packages/powa/config.py", line 9, in <module>
    from powa.sql.views import get_config_changes
  File "/home/tarkhil/powa/lib/python3.11/site-packages/powa/sql/views.py", line 5, in <module>
    from powa.sql.utils import diff
  File "/home/tarkhil/powa/lib/python3.11/site-packages/powa/sql/utils.py", line 7, in <module>
    block_size = select([cast(func.current_setting('block_size'), Numeric)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tarkhil/powa/lib/python3.11/site-packages/sqlalchemy/sql/_selectable_constructors.py", line 482, in select
    return Select(*entities)
           ^^^^^^^^^^^^^^^^^
  File "/home/tarkhil/powa/lib/python3.11/site-packages/sqlalchemy/sql/selectable.py", line 5169, in __init__
    self._raw_columns = [
                        ^
  File "/home/tarkhil/powa/lib/python3.11/site-packages/sqlalchemy/sql/selectable.py", line 5170, in <listcomp>
    coercions.expect(
  File "/home/tarkhil/powa/lib/python3.11/site-packages/sqlalchemy/sql/coercions.py", line 396, in expect
    resolved = impl._literal_coercion(
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tarkhil/powa/lib/python3.11/site-packages/sqlalchemy/sql/coercions.py", line 635, in _literal_coercion
    self._raise_for_expected(element, argname)
  File "/home/tarkhil/powa/lib/python3.11/site-packages/sqlalchemy/sql/coercions.py", line 1134, in _raise_for_expected
    return super()._raise_for_expected(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tarkhil/powa/lib/python3.11/site-packages/sqlalchemy/sql/coercions.py", line 696, in _raise_for_expected
    super()._raise_for_expected(
  File "/home/tarkhil/powa/lib/python3.11/site-packages/sqlalchemy/sql/coercions.py", line 519, in _raise_for_expected
    raise exc.ArgumentError(msg, code=code) from err
sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [<sqlalchemy.sql.elements.Label at 0x31652a61f610; block_size>]. Did you mean to say select(<sqlalchemy.sql.elements.Label at 0x31652a61f610; block_size>)?
(powa) tarkhil@stor:~/powa %

According to truss ( like strace in linux), it does not even try to read powa-web.conf. Just hits something and dies.

Modules installed, loaded

Extensions installed

I can login as powa and call

powa=# select public.powa_take_snapshot();
 powa_take_snapshot
--------------------
                  0
(1 row)

Not a slightest idea what happens and how to fix it.

rjuju commented 3 months ago

Hi,

This is actually "only" an issue in powa-web. The problem is that sqlalchemy keeps breaking its API, which forces us to keep adding workaround to make it work with older versions. We gave up on that some time ago and entirely removed sqlalchemy from powa-web, so the next version (5.0.0) will fix that problem once and for all.

Until that version is released, your options are:

rjuju commented 2 months ago

I'm closing the issue hoping that one of the solutions worked. if you still have problems feel free to reopen this issue or create a new one.