Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostgreSQL 17 support for zabbix-server-pgsql (all flavors) #1572

Open
neothematrix opened this issue Nov 22, 2024 · 10 comments
Open

PostgreSQL 17 support for zabbix-server-pgsql (all flavors) #1572

neothematrix opened this issue Nov 22, 2024 · 10 comments

Comments

@neothematrix
Copy link

hello!
I've just updated zabbix-server-pgsql container to zabbix 7.0.6 and I tried upgrading my postgresql from 16 to 17 (it's actually a postgres with timescaledb extension provided by timescaledb, but it shouldn't be too different).

After upgrading to Postgres 17, I'm not able to start zabbix-server-pgsql container anymore, with this error repeated in the container logs:

**** PostgreSQL server is not available. Waiting 5 seconds...

upon inspecting a little bit more, this is a message generated by the docker-entrypoint.sh when trying to test database availability:

psql --host ${DB_SERVER_HOST} --port ${DB_SERVER_PORT} --username ${DB_SERVER_ROOT_USER} --list

I tried manually executing that command and this is the output:

psql: ERROR: column d.daticulocale does not exist LINE 8: d.daticulocale as "ICU Locale", ^ HINT: Perhaps you meant to reference the column "d.datlocale".

I think the issue here is that all zabbix-server-pgsql images are still using "postgresql 16" client and possibly the "--list" command doesn't work properly with different DB versions.

I checked all the flavors (alpine, ubuntu and redhat) and they all show the same issue.

@fibbs
Copy link

fibbs commented Nov 25, 2024

Same here. Problem is that the postgresql CLIENT inside the image is still version 16.

@dotneft
Copy link
Collaborator

dotneft commented Nov 25, 2024

Sorry, how is it related to Zabbix Docker? The issue caused by PostgreSQL client. Please wait when fix will be available in OS distributions.

@TriDvaRas
Copy link

The error occurs when using old psql client with v17 server
So the issue(?) is that official zabbix images are using psql 16

Manually bumping psql to match the version 17 fixes this

[~]$ psql -V
psql (PostgreSQL) 16.6
[~]$ psql -h  dbhostname  -p 5432 -U zabbix -d zabbix --list
Password for user zabbix: 
psql: ERROR:  column d.daticulocale does not exist
LINE 8:   d.daticulocale as "ICU Locale",
          ^
HINT:  Perhaps you meant to reference the column "d.datlocale".
[~]$ psql -V
psql (PostgreSQL) 17.2
[~]$ psql -h  dbhostname  -p 5432 -U zabbix -d zabbix --list
Password for user zabbix: 
                                                 List of databases
   Name    |  Owner   | Encoding | Locale Provider | Collate |  Ctype  | Locale | ICU Rules |   Access privileges   
-----------+----------+----------+-----------------+---------+---------+--------+-----------+-----------------------
 postgres  | postgres | UTF8     | libc            | C.UTF-8 | C.UTF-8 |        |           | 
 template0 | postgres | UTF8     | libc            | C.UTF-8 | C.UTF-8 |        |           | =c/postgres          +
           |          |          |                 |         |         |        |           | postgres=CTc/postgres
 template1 | postgres | UTF8     | libc            | C.UTF-8 | C.UTF-8 |        |           | =c/postgres          +
           |          |          |                 |         |         |        |           | postgres=CTc/postgres
 zabbix    | zabbix   | UTF8     | libc            | C.UTF-8 | C.UTF-8 |        |           | 
(4 rows)

@neothematrix
Copy link
Author

neothematrix commented Nov 27, 2024

@dotneft maybe it's worth using the native "pg_isready" command to check database availability instead of psql --list?
it should work for all postgres versions: https://www.postgresql.org/docs/current/app-pg-isready.html

the same change should also be done for "web-nginx-pgsql" and "web-apache-pgsql"

@dotneft
Copy link
Collaborator

dotneft commented Nov 28, 2024

pgsql is used on server / proxy containers not only for checking availability.

@dotneft
Copy link
Collaborator

dotneft commented Dec 6, 2024

Added PostgreSQL 17 client to all images based on Alpine. Waiting for other OS distributions.

@neothematrix
Copy link
Author

great news @dotneft thank you very much! has the new image been pushed to dockerhub already?

@dotneft
Copy link
Collaborator

dotneft commented Dec 6, 2024

Is in progress of building.

@ryanjphillips
Copy link

ryanjphillips commented Dec 16, 2024

Reporting the same issue here. @dotneft If I'm not missing anything here there still isn't a updated image for this yet?

Edit: Specifically for the version 7.0.6 image?

@dotneft
Copy link
Collaborator

dotneft commented Dec 17, 2024

7.0.6 already released. So the tag is not changed, you can try to use "latest" tag till new version will be released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants