Ad Widget

Collapse

ERROR: "history_bin" is not a hypertable or a continuous aggregate

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • darko11z
    Junior Member
    • Jun 2022
    • 18

    #1

    ERROR: "history_bin" is not a hypertable or a continuous aggregate

    My system:
    - Red Hat 9.5
    - Zabbix 7.0
    - PostgreSQL v14.15
    - TimescaleDB v2.17.1

    In Zabbix PostgreSQL repository database server log file I see the following errors:
    Code:
    2025-01-31 09:41:10.531 [37971] ERROR: "history_bin" is not a hypertable or a continuous aggregate
    2025-01-31 09:41:10.531 [37971] HINT: The operation is only possible on a hypertable or continuous aggregate.
    2025-01-31 09:41:10.531 [37971] STATEMENT: select drop_chunks(relation=>'history_bin',older_than=>17 33128870)
    2025-01-31 09:41:11.260 [37971] ERROR: "auditlog" is not a hypertable or a continuous aggregate
    2025-01-31 09:41:11.260 [37971] HINT: The operation is only possible on a hypertable or continuous aggregate.
    2025-01-31 09:41:11.260 [37971] STATEMENT: select drop_chunks(relation=>'auditlog',older_than=>17331 28870)
    From error message "drop_chunks" function is executed from Zabbix, that is required to be hypertable or continues aggregate.

    I have searched for hypertables:
    Code:
    select
    hypertable_schema || '.' || hypertable_name as hypertable,
    hypertable_size(hypertable_schema || '.' || hypertable_name) as hypertable_size,
    pg_size_pretty(hypertable_size(hypertable_schema || '.' || hypertable_name)) as hypertable_pretty_size
    from
    timescaledb_information.hypertables
    order by
    hypertable_size desc
    ;
    and I get:
    hypertable | hypertable_size | hypertable_pretty_size
    ---------------------+-----------------+-----------------------
    zabbix.history | 20816011264 | 19 GB
    zabbix.history_uint | 17264852992 | 16 GB
    zabbix.history_log | 6809673728 | 6494 MB
    zabbix.trends_uint | 1515520000 | 1445 MB
    zabbix.trends | 1084407808 | 1034 MB
    zabbix.history_text | 308232192 | 294 MB
    zabbix.history_str | 177315840 | 169 MB
    Tables "history_bin" and "auditlog" are not listed on above list of hypertables.

    I have searched to see if those are tables or materialized view (continues aggregates in TimescaleDB language):

    Code:
    select table_schema, table_name, table_type
    from information_schema.tables
    where table_schema = 'zabbix' and table_name in ('history_bin', 'auditlog');
    I get the list of ordinary tables:
    Code:
    table_schema | table_name | table_type
    --------------+-------------+------------
    zabbix | auditlog | BASE TABLE
    zabbix | history_bin | BASE TABLE


    Those two errors indicate that Zabbix expects "history_bin" and "auditlog" are expected to be TimecaleDB hypertables or continue aggregates, but it looks like there are just an ordinary base tables, so drop_chunk function fails.

    I am afraid as negative consequence disk will get full, because old data are not cleansed with drop_chunk function.

    What should I do to fix this issue?
    Last edited by darko11z; 31-01-2025, 11:12.
  • darko11z
    Junior Member
    • Jun 2022
    • 18

    #2
    Now I see what is the issue. On web page: https://www.initmax.com/wiki/zabbix-...rsion-7-0-lts/ there are post-install tasks to convert tables "history_bin" in "auditlog" to hypertables. Most probably this post-install tasks were not performed by our Zabbix administrator. That would explain the issues in PostgreSQL server log file.

    Comment

    • db100
      Member
      • Feb 2023
      • 61

      #3
      i also see the same error in the logs ... i am running zabbix in a docker container so i would expect updates and migrations to fire automatically ... how could this be ? is there a manual solution for it ? i have run with success the timescale.sql script but nothing has changed ... should i also run all other scripts under the "with-compression" folder and if so in which order ?

      Comment

      Working...