Ad Widget

Collapse

Error with Postgreqsl version 17

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • john2843
    Junior Member
    • Dec 2023
    • 4

    #1

    Error with Postgreqsl version 17

    I am running Zabbix in containers except for PostgreSQL which is running on the host. After upgrading the host PostgreSQL from 16 to 17, the Zabbix server no longer connects to the database:
    Code:
    docker compose up
    [+] Running 3/0                                                                                    
    ✔ Container zabbix-docker-db-data-pgsql-1           Created                                   0.0s
    ✔ Container zabbix-docker-zabbix-web-nginx-pgsql-1  Created                                   0.0s
    ✔ Container zabbix-docker-zabbix-server-1           Created                                   0.0s
    Attaching to zabbix-server-1                                                                        
    zabbix-server-1  | ** Preparing Zabbix server
    zabbix-server-1  | ** Preparing database
    zabbix-server-1  | ** Using POSTGRES_USER variable from secret file
    zabbix-server-1  | ** Using POSTGRES_PASSWORD variable from secret file
    zabbix-server-1  | ********************
    zabbix-server-1  | * DB_SERVER_HOST: myhost.mynetwork.prv
    zabbix-server-1  | * DB_SERVER_PORT: 5432
    zabbix-server-1  | * DB_SERVER_DBNAME: zabbix
    zabbix-server-1  | * DB_SERVER_SCHEMA: public
    zabbix-server-1  | ********************
    zabbix-server-1  | **** PostgreSQL server is not available. Waiting 5 seconds...
    zabbix-server-1  | **** PostgreSQL server is not available. Waiting 5 seconds...
    [snip repeating message]
    I can get a shell on the Zabbix container and view tables on the database:
    Code:
    docker exec -u root -t -i zabbix-docker-zabbix-server-1 /bin/bash
    c6ff8c0d9643:/var/lib/zabbix# psql -U zabbix --host myhost.mynetwork.prv
    psql (16.3, server 17.0 (Debian 17.0-1.pgdg120+1))
    WARNING: psql major version 16, server major version 17.
            Some psql features might not work.
    Type "help" for help.
    
    zabbix=> \c zabbix
    psql (16.3, server 17.0 (Debian 17.0-1.pgdg120+1))
    WARNING: psql major version 16, server major version 17.
            Some psql features might not work.
    You are now connected to database "zabbix" as user "zabbix".
    zabbix=> \d
                       List of relations                                                                
    Schema |            Name            |   Type   | Owner  
    --------+----------------------------+----------+--------
    public | acknowledges               | table    | zabbix
    public | actions                    | table    | zabbix
    public | alerts                     | table    | zabbix
    public | auditlog                   | table    | zabbix[list of tables snipped]
    This is what I see in the PostgresSQL logs...this error does repeat with the Zabbix server error:
    Code:
    2024-10-15 12:35:02.365 CDT [3325870] zabbix@zabbix ERROR:  column d.daticulocale does not exist at character 289
    2024-10-15 12:35:02.365 CDT [3325870] zabbix@zabbix HINT:  Perhaps you meant to reference the column "d.datlocale".
    2024-10-15 12:35:02.365 CDT [3325870] zabbix@zabbix STATEMENT:  SELECT
            d.datname as "Name",
            pg_catalog.pg_get_userbyid(d.datdba) as "Owner",
            pg_catalog.pg_encoding_to_char(d.encoding) as "Encoding",
            CASE d.datlocprovider WHEN 'c' THEN 'libc' WHEN 'i' THEN 'icu' END AS "Locale Provider",
            d.datcollate as "Collate",
            d.datctype as "Ctype",
            d.daticulocale as "ICU Locale",
            d.daticurules as "ICU Rules",
            pg_catalog.array_to_string(d.datacl, E'\n') AS "Access privileges"
          FROM pg_catalog.pg_database d
          ORDER BY 1;

    Is PostgresSQL 17 expeced to work? Other things in my system might have changed and I cannot easily go back to PostgresSQL 16 so want to make sure before I debug further. I have looked for turning on increased debug logging on the Zabbix server container but haven't yet seen how to do do that.

    Thanks,

    John
  • Answer selected by john2843 at 17-10-2024, 22:07.
    cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4806

    pg17 is not supported...
    PostgreSQL 13.0-16.X

    Comment

    • john2843
      Junior Member
      • Dec 2023
      • 4

      #2
      It looks like PostgresSQL system catalog pg_database does not contain column daticulocale in version 17 but it existed in version 16. Here is document for version 17:

      51.15. pg_database # The catalog pg_database stores information about the available databases. Databases are created with the CREATE DATABASE command. Consult …

      Comment

      • cyber
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Dec 2006
        • 4806

        #3
        pg17 is not supported...
        PostgreSQL 13.0-16.X

        Comment

        • john2843
          Junior Member
          • Dec 2023
          • 4

          #4
          Thanks for confirming.

          Comment

          • natenjo
            Junior Member
            • Nov 2024
            • 1

            #5
            please note that your documentation is wrong in this point:



            as in "example 2" is pulls "postgres:latest", this currently leads to postgresql17 beeing used instead of 16.

            Comment

            • chainlynx
              Junior Member
              • Nov 2024
              • 3

              #6
              Originally posted by cyber
              pg17 is not supported...
              PostgreSQL 13.0-16.X

              Where do you see this? I am looking at this page right here https://www.zabbix.com/documentation...%20for%20Postg reSQL%20versions,X%20since%20Zabbix%207.0.

              It looks like it says its supported:


              I just deployed Zabbix using docker-compose in portainer and initially I specified "latest" for the PostgreSQL server and it didn't work. The logs in my zabbix web server said that it could not connect to the PostgreSQL database. When I deleted the volume for the postgresql-sever and specified PostgreSQL:16 in the docker-compose file it started working for me and was able to get to the GUI.

              Is the documentation flat out wrong here or is there something I am doing wrong?

              Comment

              • cyber
                Senior Member
                Zabbix Certified SpecialistZabbix Certified Professional
                • Dec 2006
                • 4806

                #7
                Support for PG17 comes with v 7.0.6 https://www.zabbix.com/documentation...on/whatsnew706
                Written also in here https://www.zabbix.com/documentation...n/requirements
                PostgreSQL 13.0-17.X Required if PostgreSQL is used as Zabbix backend database.
                Depending on the installation size, it might be required to increase PostgreSQL work_mem configuration property (4MB being the default value), so that the amount of memory used by the database for particular operation is sufficient and query execution does not take too much time.

                Added support for PostgreSQL versions:
                - 17.X since Zabbix 7.0.6.
                When I was answering this question at first, it was not yet announced. And 7.0.6 is also not yet out..

                Comment


                • chainlynx
                  chainlynx commented
                  Editing a comment
                  Thanks for clarifying!
              • deconf
                Junior Member
                • Oct 2022
                • 2

                #8
                Zabbix 7.0.6 Postgres 17.x is still not supported

                The initialization function still uses the column daticulocale which is not included in postgres17
                ```
                2024-11-21 15:12:32.064 CST [347] ERROR: column d.daticulocale does not exist at character 289
                2024-11-21 15:12:32.064 CST [347] HINT: Perhaps you meant to reference the column "d.datlocale".
                2024-11-21 15:12:32.064 CST [347] STATEMENT: SELECT
                d.datname as "Name",
                pg_catalog.pg_get_userbyid(d.datdba) as "Owner",
                pg_catalog.pg_encoding_to_char(d.encoding) as "Encoding",
                CASE d.datlocprovider WHEN 'c' THEN 'libc' WHEN 'i' THEN 'icu' END AS "Locale Provider",
                d.datcollate as "Collate",
                d.datctype as "Ctype",
                d.daticulocale as "ICU Locale",
                d.daticurules as "ICU Rules",
                pg_catalog.array_to_string(d.datacl, E'\n') AS "Access privileges"
                FROM pg_catalog.pg_database d
                ORDER BY 1;
                ```

                Comment

                • Tristis Oris
                  Member
                  • Sep 2015
                  • 66

                  #9
                  7.0.6. pg cluster upgrade can't succeed.

                  Code:
                  pg_restore: error: could not execute query: ERROR:  hypertables do not support  enabling or disabling triggers.
                  Command was: ALTER TABLE _timescaledb_internal._compressed_hypertable_117 ENABLE TRIGGER ALL;
                  
                  pg_restore: error: could not execute query: ERROR:  hypertables do not support  enabling or disabling triggers.
                  Command was: ALTER TABLE _timescaledb_internal._compressed_hypertable_118 DISABLE TRIGGER ALL;
                  
                  pg_restore: error: could not execute query: ERROR:  hypertables do not support  enabling or disabling triggers.
                  Command was: ALTER TABLE _timescaledb_internal._compressed_hypertable_118 ENABLE TRIGGER ALL;
                  
                  pg_restore: error: could not execute query: ERROR:  operation not supported on chunk tables
                  Command was: ALTER TABLE _timescaledb_internal._hyper_101_3107_chunk DISABLE TRIGGER ALL;
                  
                  pg_restore: error: could not execute query: ERROR:  operation not supported on chunk tables
                  Command was: ALTER TABLE _timescaledb_internal._hyper_101_3107_chunk ENABLE TRIGGER ALL;
                  
                  pg_restore: error: could not execute query: ERROR:  operation not supported on chunk tables
                  Command was: ALTER TABLE _timescaledb_internal._hyper_101_3113_chunk DISABLE TRIGGER ALL;

                  Comment

                  • chainlynx
                    Junior Member
                    • Nov 2024
                    • 3

                    #10
                    Originally posted by deconf
                    Zabbix 7.0.6 Postgres 17.x is still not supported

                    The initialization function still uses the column daticulocale which is not included in postgres17
                    ```
                    2024-11-21 15:12:32.064 CST [347] ERROR: column d.daticulocale does not exist at character 289
                    2024-11-21 15:12:32.064 CST [347] HINT: Perhaps you meant to reference the column "d.datlocale".
                    2024-11-21 15:12:32.064 CST [347] STATEMENT: SELECT
                    d.datname as "Name",
                    pg_catalog.pg_get_userbyid(d.datdba) as "Owner",
                    pg_catalog.pg_encoding_to_char(d.encoding) as "Encoding",
                    CASE d.datlocprovider WHEN 'c' THEN 'libc' WHEN 'i' THEN 'icu' END AS "Locale Provider",
                    d.datcollate as "Collate",
                    d.datctype as "Ctype",
                    d.daticulocale as "ICU Locale",
                    d.daticurules as "ICU Rules",
                    pg_catalog.array_to_string(d.datacl, E'\n') AS "Access privileges"
                    FROM pg_catalog.pg_database d
                    ORDER BY 1;
                    ```
                    I came back to this post just to check for this. Looks like ill be staying on pg16 just a little longer

                    Comment

                    • fansari
                      Junior Member
                      • Apr 2019
                      • 7

                      #11
                      I came accross the same issue.



                      The documentation says that Zabbix 7.0.6 supports Postgres 17. I did an upgrade to 7.0.6 and found that it does not work.

                      ```
                      2024-12-02 14:44:02.209 UTC [58] ERROR: column d.daticulocale does not exist at character 289
                      2024-12-02 14:44:02.209 UTC [58] HINT: Perhaps you meant to reference the column "d.datlocale".
                      2024-12-02 14:44:02.209 UTC [58] STATEMENT: SELECT
                      d.datname as "Name",
                      pg_catalog.pg_get_userbyid(d.datdba) as "Owner",
                      pg_catalog.pg_encoding_to_char(d.encoding) as "Encoding",
                      CASE d.datlocprovider WHEN 'c' THEN 'libc' WHEN 'i' THEN 'icu' END AS "Locale Provider",
                      ...
                      ```

                      https://support.zabbix.com/browse/ZBX-25616

                      https://github.com/zabbix/zabbix-docker/issues/1572


                      The problem is that the psql clients in docker images for Zabbix server and frontend are still version 16.
                      Last edited by fansari; 03-12-2024, 10:02.

                      Comment

                      • Tristis Oris
                        Member
                        • Sep 2015
                        • 66

                        #12
                        well, 7.2 still have no PG17 support. Nobody care?

                        Comment

                        • cyber
                          Senior Member
                          Zabbix Certified SpecialistZabbix Certified Professional
                          • Dec 2006
                          • 4806

                          #13
                          Originally posted by Tristis Oris
                          well, 7.2 still have no PG17 support. Nobody care?
                          Why do you say so? By docs it is supported.. I seriously doubt they would release something with such a claim and no verification.. Instead, I would like you to show us, whats going on... Just saying "still has no support"... is not enough..

                          Comment

                          • lwmacct
                            Junior Member
                            • Jan 2022
                            • 1

                            #14
                            Version 7.2 still doesn’t support it. After so many RC versions, could they not have tested and identified the issue?

                            Comment

                            • ross.fawcett
                              Junior Member
                              • Jan 2021
                              • 2

                              #15
                              I can only comment on 7.0.6 as we just upgraded today, but PG17 is definitely supported, however if you are using docker you will need to use the alpine container as the ubuntu (and possibly other images) don't have pg17 clients available.

                              "Docker images use base images as CentOS, RHEL, Alpine, OL, Ubuntu. Currently all these OS do not provide officially packages for PostgreSQL 17 client. Once they will provide packages, we update our images. Registered issue: https://github.com/zabbix/zabbix-docker/issues/1572
                              PG17 support was added to the images around two weeks ago https://github.com/zabbix/zabbix-doc...ent-2522427427

                              Comment

                              Working...