Ad Widget

Collapse

Can't restore backup Zabbix 7.0 Postgress 15 timescaleDB

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jswheeler
    Junior Member
    • Feb 2024
    • 22

    #1

    Can't restore backup Zabbix 7.0 Postgress 15 timescaleDB

    Host: Debian bookworm (12)
    Zabbix version: 7.0.2
    Database: Postgres 15
    TimescaleDB extensions installed

    I've been running timescaledb for about 6 months. I had an issue with my working instance and I've had to restore from backup. My backup is created with pg_dump as an ascii file .sql (the default output of pg_dump).

    I'm not able to restore the database, here are the things I've tried.

    sudo -u postgres dropdb zabbix
    sudo -u postgres createdb -O zabbix zabbix
    echo "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;" | sudo -u postgres psql zabbix
    cat 20250417-000005.sql| sudo -u postgres psql zabbix

    This appears to restore the data with a few errors like
    ALTER TABLE
    ERROR: operation not supported on hypertables that have compression enabled
    ERROR: operation not supported on hypertables that have compression enabled
    ERROR: operation not supported on hypertables that have compression enabled
    ERROR: operation not supported on hypertables that have compression enabled
    ERROR: operation not supported on hypertables that have compression enabled
    ERROR: operation not supported on hypertables that have compression enabled
    ALTER TABLE
    and
    COPY 0
    ERROR: function base36_decode(text) does not exist
    LINE 1: CAST(base36_decode(substring(cuid FROM 2 FOR 8))/1000 AS int...
    ^
    HINT: No function matches the given name and argument types. You might need to add explicit type casts.
    QUERY: CAST(base36_decode(substring(cuid FROM 2 FOR 8))/1000 AS integer)
    CONTEXT: PL/pgSQL function public.cuid_timestamp(character varying) line 3 at RETURN
    COPY _hyper_7_1129_chunk, line 1: "cm9ang75s00018kiytnxay6jq 1 Admin 1744246699 192.168.1.90 0 15 59644 \N Get logs cm9ang75r00008kiyzy..."
    ERROR: function base36_decode(text) does not exist
    LINE 1: CAST(base36_decode(substring(cuid FROM 2 FOR 8))/1000 AS int...
    ^
    HINT: No function matches the given name and argument types. You might need to add explicit type casts.
    QUERY: CAST(base36_decode(substring(cuid FROM 2 FOR 8))/1000 AS integer)
    CONTEXT: PL/pgSQL function public.cuid_timestamp(character varying) line 3 at RETURN
    COPY _hyper_7_1189_chunk, line 1: "cm9knnd6c0001t0iybxql4f7b 1 Admin 1744851695 192.168.1.90 1 23 3 \N home cm9knnd6c0000t0iy0xwhmt67 {..."
    COPY 0​
    but it appears that most of the data is there (I can see data in DBeaver). When I attempt to login I receive

    Click image for larger version

Name:	image.png
Views:	150
Size:	93.2 KB
ID:	502041​copied here
    SQL statement execution has failed "INSERT INTO auditlog (auditid,userid,username,clock,ip,action,resourcet ype,resourceid,resourcename,recordsetid,details) VALUES ('cm9o8xggy0001zuiyod11c9wt','1','Admin','17450688 37','192.168.1.90','8','0','1','','cm9o8xggy0000zu iynih2i0hu','')
    I can't login to the UI and this does not seem to be a password issue. This is the corresponding message in postgres

    2025-04-19 08:40:11.549 CDT [48506] zabbix@zabbix ERROR: invalid INSERT on the root table of hypertable "_hyper_7_1189_chunk"
    2025-04-19 08:40:11.549 CDT [48506] zabbix@zabbix HINT: Make sure the TimescaleDB extension has been preloaded.
    2025-04-19 08:40:11.549 CDT [48506] zabbix@zabbix STATEMENT: INSERT INTO auditlog (auditid,userid,username,clock,ip,action,resourcet ype,resourceid,resourcename,recordsetid,details) VALUES ('cm9o9mmj70001q9iyzi6trwzk','1','Admin','17450700 11','192.168.1.90','8','0','1','','cm9o9mmj70000q9 iyu2ux80ri','')​
    I'm stuck. I seem to be able to recover the data, but I can access the UI.
Working...