Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-25514

Errors when Database upgrade to primary keys

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 7.0.5
    • None
    • None

      Steps to reproduce:

      1. according to https://www.zabbix.com/documentation/current/en/manual/appendix/install/db_primary_keys#postgresql-timescaledb

      Result:

      each time i run

      cat /usr/share/zabbix-sql-scripts/postgresql/timescaledb/schema.sql | sudo -u postgres psql zabbix

      i got that error.

      
      CREATE FUNCTION
      NOTICE:  function base36_decode(pg_catalog.varchar) does not exist, skipping
      DROP FUNCTION
      NOTICE:  PostgreSQL version 16.4 (Ubuntu 16.4-1.pgdg24.04+2) is valid
      NOTICE:  TimescaleDB extension is detected
      NOTICE:  TimescaleDB version 2.16.1 is valid
      NOTICE:  table "history" is already a hypertable, skipping
      NOTICE:  table "history_uint" is already a hypertable, skipping
      NOTICE:  table "history_log" is already a hypertable, skipping
      NOTICE:  table "history_text" is already a hypertable, skipping
      NOTICE:  table "history_str" is already a hypertable, skipping
      NOTICE:  table "history_bin" is already a hypertable, skipping
      NOTICE:  table "auditlog" is already a hypertable, skipping
      NOTICE:  table "trends" is already a hypertable, skipping
      NOTICE:  table "trends_uint" is already a hypertable, skipping
      NOTICE:  TimescaleDB extension is already installed; not changing configuration
      NOTICE:  TimescaleDB is configured successfully
      DO
      cat /usr/share/zabbix-sql-scripts/postgresql/timescaledb/option-patches/with-compression/history_upgrade.sql | sudo -u postgres psql zabbix
             cat /usr/share/zabbix-sql-scripts/postgresql/timescaledb/option-patches/with-compression/history_upgrade_uint.sql | sudo -u postgres psql zabbix
             cat /usr/share/zabbix-sql-scripts/postgresql/timescaledb/option-patches/with-compression/history_upgrade_log.sql | sudo -u postgres psql zabbix
             cat /usr/share/zabbix-sql-scripts/postgresql/timescaledb/option-patches/with-compression/history_upgrade_str.sql | sudo -u postgres psql zabbix
             cat /usr/share/zabbix-sql-scripts/postgresql/timescaledb/option-patches/with-compression/history_upgrade_text.sql | sudo -u postgres psql zabbix
             cat /usr/share/zabbix-sql-scripts/postgresql/timescaledb/option-patches/with-compression/trends_upgrade.sql | sudo -u postgres psql zabbix

       

      on each step: ERROR:  need to specify one of "compress_after" or "compress_created_before"

      COPY 0
      CREATE TABLE
      COPY 0
      ERROR:  need to specify one of "compress_after" or "compress_created_before"
      CONTEXT:  SQL statement "SELECT add_compression_policy('history', (
                      SELECT extract(epoch FROM (config::json->>'compress_after')::interval)
                      FROM timescaledb_information.jobs
                      WHERE application_name LIKE 'Compression%%' AND hypertable_schema='public'
                              AND hypertable_name='history_old'
                      )::integer
              )"
      PL/pgSQL function inline_code_block line 17 at SQL statement
      COPY 60445987
      CREATE TABLE
      COPY 60445987
      DO
      UPDATE 1
      COPY 0
      CREATE TABLE
      COPY 0
      WARNING:  column type "character varying" used for "source" does not follow best practices
      HINT:  Use datatype TEXT instead.
      ERROR:  need to specify one of "compress_after" or "compress_created_before"
      CONTEXT:  SQL statement "SELECT add_compression_policy('history_log', (
                      SELECT extract(epoch FROM (config::json->>'compress_after')::interval)
                      FROM timescaledb_information.jobs
                      WHERE application_name LIKE 'Compression%%' AND hypertable_schema='public'
                              AND hypertable_name='history_log_old'
                      )::integer
              )"
      PL/pgSQL function inline_code_block line 17 at SQL statement
      COPY 217932
      CREATE TABLE
      COPY 217932
      WARNING:  column type "character varying" used for "value" does not follow best practices
      HINT:  Use datatype TEXT instead.
      ERROR:  need to specify one of "compress_after" or "compress_created_before"
      CONTEXT:  SQL statement "SELECT add_compression_policy('history_str', (
                      SELECT extract(epoch FROM (config::json->>'compress_after')::interval)
                      FROM timescaledb_information.jobs
                      WHERE application_name LIKE 'Compression%%' AND hypertable_schema='public'
                              AND hypertable_name='history_str_old'
                      )::integer
              )"
      PL/pgSQL function inline_code_block line 17 at SQL statement
      COPY 0
      CREATE TABLE
      COPY 0
      ERROR:  need to specify one of "compress_after" or "compress_created_before"
      CONTEXT:  SQL statement "SELECT add_compression_policy('history_text', (
                      SELECT extract(epoch FROM (config::json->>'compress_after')::interval)
                      FROM timescaledb_information.jobs
                      WHERE application_name LIKE 'Compression%%' AND hypertable_schema='public'
                              AND hypertable_name='history_text_old'
                      )::integer
              )"
      PL/pgSQL function inline_code_block line 17 at SQL statement
      COPY 967035
      CREATE TABLE
      COPY 967035
      DO
      UPDATE 1
      

            askolmeisters Armands Arseniuss Skolmeisters
            Tristis Oris Tristis Oris
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - Not Specified
                Not Specified
                Logged:
                Time Spent - 2h
                2h