powa-team / powa

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

Upgrading from 4.0.1 to 4.1.2 breaks webinterface #147

Closed RedShift1 closed 3 years ago

RedShift1 commented 3 years ago

After upgrading from 4.0.1 to 4.1.2, the webinterface fails to load any data with this error message:

<local>: powa_take_snapshot(0): function "powa_kcache_snapshot" failed: structure of query does not match function result type

First upgraded packages (yum upgrade), then upgraded the powa extension (ALTER EXTENSION powa UPDATE;), then restarted PostgreSQL.

Tried with DROP EXTENSION powa; CREATE EXTENSION powa and then restarting PostgreSQL, same result.

OS: CentOS 8.3 PostgreSQL version: 12.5 Installation source: RPM packages powa_12-4.1.2-1.rhel8.x86_64 powa_12-web-4.1.2-1.rhel8.x86_64

rjuju commented 3 years ago

Hello,

apparently you have some problem with snapshot of pg_stat_kcache extension. Are you using remote mode or local mode?

The most likely explanation here is that you didn't update the powa extension on the remote server(s) if that's what you're using. If not could you please provide more information (list of extension and versions, and full error message in postgres log.

RedShift1 commented 3 years ago

I'm using it in local mode. Here are the installed extensions:

powa=# \dx
                                     List of installed extensions
        Name        | Version |   Schema   |                        Description
--------------------+---------+------------+-----------------------------------------------------------
 btree_gist         | 1.5     | public     | support for indexing common datatypes in GiST
 hypopg             | 1.1.4   | public     | Hypothetical indexes for PostgreSQL
 pg_qualstats       | 2.0.2   | public     | An extension collecting statistics about quals
 pg_stat_kcache     | 2.1.3   | public     | Kernel statistics gathering
 pg_stat_statements | 1.7     | public     | track execution statistics of all SQL statements executed
 pg_wait_sampling   | 1.1     | public     | sampling based statistics of wait events
 plpgsql            | 1.0     | pg_catalog | PL/pgSQL procedural language
 powa               | 4.1.2   | public     | PostgreSQL Workload Analyser-core
(8 rows)

powa=#

I hadn't noticed pg_stat_kcache was upgraded. After running ALTER EXTENSION pg_stat_kcache UPDATE; and restarting PostgreSQL, the webinterface works again.