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

invalid partitioning function cuid_timestamp

XMLWordPrintable

    • Icon: Documentation task Documentation task
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 7.0.1rc1, 7.2.0alpha1
    • 7.0.0alpha8, 7.0.0alpha9
    • None
    • RHEL 8.8, PostgreSQL 15.5 (upgraded from v11), TimescaleDB 2.10.1 (upgraded from 1.7.2), PHP 8.2 (upgraded), Zabbix 7.0.0alpha8/9 (upgraded from 5.0.40)
    • S24-W24/25
    • 1

      Steps to reproduce:

      1. Upgrade Zabbix 5.0.40 -> 7.0.0alpha8 or alpha9
      VERSION='7.0.0-alpha8.release1.el8'; echo $VERSION
      sudo dnf upgrade -y zabbix-web-pgsql-$VERSION zabbix-server-pgsql-$VERSION 

      (it's possible, this is not needed, but I did not test fresh 7.0.0alpha8/9 installation)

      1. Install SQL scripts for upgraded version:
      sudo yum install -y zabbix-sql-scripts-$VERSION 
      1. Try to execute timescaledb.sql as instructed here:

      Result:

      1. timescaledb.sql is not there, but timescaledb/schema.sql (documentation not updated after ZBX-23797 In zabbix-sql-scripts missing timescaledb.sql (after release 7.0.0alpha8) - ZABBIX SUPPORT ?)
      2. running timescaledb/schema.sql instead returning error (the same for 7.0.0alpha9):
      [automat@zbxdemo ~]$ cat /usr/share/zabbix-sql-scripts/postgresql/timescaledb/schema.sql | sudo -u zabbix psql zabbix
      
      could not change directory to "/home/automat": Permission denied
      Password for user zabbix:
      NOTICE:  function base36_decode(pg_catalog.varchar) does not exist, skipping
      DROP FUNCTION
      CREATE FUNCTION
      NOTICE:  function cuid_timestamp(pg_catalog.varchar) does not exist, skipping
      DROP FUNCTION
      CREATE FUNCTION
      NOTICE:  PostgreSQL version 15.5 is valid
      NOTICE:  TimescaleDB extension is detected
      NOTICE:  TimescaleDB version 2.10.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
      WARNING:  column type "character varying" used for "note" does not follow best practices
      HINT:  Use datatype TEXT instead.
      WARNING:  column type "character varying" used for "ip" does not follow best practices
      HINT:  Use datatype TEXT instead.
      WARNING:  column type "character varying" used for "resourcename" does not follow best practices
      HINT:  Use datatype TEXT instead.
      ERROR:  invalid partitioning function
      HINT:  A valid partitioning function for open (time) dimensions must be IMMUTABLE, take the column type as input, and return an integer or timestamp type.
      CONTEXT:  SQL statement "SELECT create_hypertable('auditlog', 'auditid', chunk_time_interval => 604800,
                              time_partitioning_func => 'cuid_timestamp', migrate_data => true, if_not_exists => true)"
      PL/pgSQL function inline_code_block line 69 at PERFORM 
      1. If ignored and started zabbix_server anyway:
        8918:20240111:125835.296 Starting Zabbix Server. Zabbix 7.0.0alpha9 (revision 6c4616adff7).
        8918:20240111:125835.296 ****** Enabled features ******
        8918:20240111:125835.296 SNMP monitoring:           YES
        8918:20240111:125835.296 IPMI monitoring:           YES
        8918:20240111:125835.296 Web monitoring:            YES
        8918:20240111:125835.296 VMware monitoring:         YES
        8918:20240111:125835.296 SMTP authentication:       YES
        8918:20240111:125835.296 ODBC:                      YES
        8918:20240111:125835.296 SSH support:               YES
        8918:20240111:125835.296 IPv6 support:              YES
        8918:20240111:125835.296 TLS support:               YES
        8918:20240111:125835.296 ******************************
        8918:20240111:125835.296 using configuration file: /etc/zabbix/zabbix_server.conf
        8918:20240111:125835.538 current database version (mandatory/optional): 05000000/05000007
        8918:20240111:125835.539 required mandatory version: 06050175
        8918:20240111:125835.539 mandatory patches were found
        8918:20240111:125835.540 starting automatic database upgrade
        8918:20240111:125835.558 completed 0% of database upgrade
      ...
        8918:20240111:125903.932 completed 97% of database upgrade
      NOTICE:  function items_name_upper_upper() does not exist, skipping
        8918:20240111:125903.982 completed 98% of database upgrade
        8918:20240111:125904.042 completed 99% of database upgrade
        8918:20240111:125904.090 completed 100% of database upgrade
        8918:20240111:125904.104 database upgrade fully completed
        8918:20240111:125904.149 database could be upgraded to use primary keys in history tables
        9165:20240111:125904.209 starting HA manager
        9165:20240111:125904.247 HA manager started in active mode
        8918:20240111:125904.250 server #0 started [main process]
        9167:20240111:125904.256 server #1 started [service manager #1]
        9168:20240111:125904.257 server #2 started [configuration syncer #1]
        9172:20240111:125904.432 server #3 started [alert manager #1]
        9173:20240111:125904.445 server #4 started [alerter #1]
        9177:20240111:125904.448 server #7 started [preprocessing manager #1]
        9180:20240111:125904.456 server #10 started [lld worker #2]
        9175:20240111:125904.459 server #5 started [alerter #2]
        9176:20240111:125904.460 server #6 started [alerter #3]
        9179:20240111:125904.462 server #9 started [lld worker #1]
        9178:20240111:125904.463 server #8 started [lld manager #1]
        9181:20240111:125904.473 server #11 started [housekeeper #1]
        9182:20240111:125904.493 server #12 started [timer #1]
        9183:20240111:125904.495 server #13 started [http poller #1]
        9185:20240111:125904.503 server #14 started [discovery manager #1]
        9186:20240111:125904.533 server #15 started [history syncer #1]
        9190:20240111:125904.562 server #16 started [history syncer #2]
        9192:20240111:125904.570 server #17 started [history syncer #3]
        9193:20240111:125904.573 server #18 started [history syncer #4]
        9194:20240111:125904.576 server #19 started [escalator #1]
        9195:20240111:125904.587 server #20 started [proxy poller #1]
        9196:20240111:125904.592 server #21 started [self-monitoring #1]
        9203:20240111:125904.651 server #22 started [task manager #1]
        9204:20240111:125904.671 server #23 started [poller #1]
        9205:20240111:125904.693 server #24 started [poller #2]
        9206:20240111:125904.697 server #25 started [poller #3]
        9207:20240111:125904.699 server #26 started [poller #4]
        9209:20240111:125904.733 server #27 started [poller #5]
        9210:20240111:125904.734 server #28 started [unreachable poller #1]
        9212:20240111:125904.736 server #29 started [trapper #1]
        9213:20240111:125904.739 server #30 started [trapper #2]
        9214:20240111:125904.742 server #31 started [trapper #3]
        9215:20240111:125904.745 server #32 started [trapper #4]
        9230:20240111:125904.746 server #47 started [configuration syncer worker #1]
        9216:20240111:125904.747 server #33 started [trapper #5]
        9225:20240111:125904.758 server #42 started [trigger housekeeper #1]
        9220:20240111:125904.764 server #37 started [history poller #2]
        9219:20240111:125904.767 server #36 started [history poller #1]
        9218:20240111:125904.770 server #35 started [alert syncer #1]
        9217:20240111:125904.771 server #34 started [icmp pinger #1]
        9231:20240111:125904.772 server #48 started [internal poller #1]
        9221:20240111:125904.774 server #38 started [history poller #3]
        9222:20240111:125904.776 server #39 started [history poller #4]
        9229:20240111:125904.779 server #46 started [snmp poller #1]
        9223:20240111:125904.798 server #40 started [history poller #5]
        9224:20240111:125904.803 server #41 started [availability manager #1]
        9228:20240111:125904.826 server #45 started [agent poller #1]
        9227:20240111:125904.830 server #44 started [http agent poller #1]
        9226:20240111:125904.831 server #43 started [odbc poller #1]
        9229:20240111:125904.861 thread started
        9228:20240111:125904.902 thread started
        9227:20240111:125904.903 thread started
        9177:20240111:125904.969 [3] thread started [preprocessing worker #3]
        9177:20240111:125904.969 [1] thread started [preprocessing worker #1]
        9177:20240111:125904.969 [2] thread started [preprocessing worker #2]
        9181:20240111:125905.000 [Z3005] query failed: [0] PGRES_FATAL_ERROR:ERROR:  table "auditlog" is not a hypertable
       [select set_integer_now_func('auditlog', 'zbx_ts_unix_now', true)]
        9181:20240111:125905.000 Table "auditlog"is not hypertable. Run timescaledb.sql script to upgrade configuration.
        9213:20240111:125905.038 Proxy "zbxdemo" version 5.0.40 is not supported by server version 7.0.0.
        9185:20240111:125905.050 thread started [discovery worker #1]
        9185:20240111:125905.050 thread started [discovery worker #2]
        9185:20240111:125905.050 thread started [discovery worker #3]
        9185:20240111:125905.050 thread started [discovery worker #4]
        9185:20240111:125905.050 thread started [discovery worker #5]

      Expected:

      No errors, or missed I any prerequisites?

      Sub-question: this is maybe unrelated (also mentioned by thiagodiniz in ZBX-23146 TSDB upgrade doesn't work - ZABBIX SUPPORT), but is it correct?:

      NOTICE:  function items_name_upper_upper() does not exist, skipping

            askolmeisters Armands Arseniuss Skolmeisters
            rico Richard Ostrochovský
            Team C
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: