zabbix/zabbix-docker

New {EXPOSE_WEB_SERVER_INFO} variable breaks NGINX config on zabbix-web-nginx-pgsql:ubuntu-6.0-latest container

argusb opened this issue · 3 comments

SUMMARY

The latest zabbix- is broken.
Log message:

Feb 07 08:43:20 containuc zabbix-web[291152]: 2024-02-07 08:43:20,179 INFO spawned: 'nginx' with pid 20
Feb 07 08:43:20 containuc zabbix-web[291152]: 2024-02-07 08:43:20,179 INFO spawned: 'nginx' with pid 20
Feb 07 08:43:20 containuc zabbix-web[291152]: 2024/02/07 08:43:20 [emerg] 20#20: directive "server_tokens" is not terminated by ";" in /etc/nginx/nginx.conf:68
Feb 07 08:43:20 containuc zabbix-web[291152]: nginx: [emerg] directive "server_tokens" is not terminated by ";" in /etc/nginx/nginx.conf:68
Feb 07 08:43:20 containuc zabbix-web[291152]: 2024-02-07 08:43:20,198 INFO exited: nginx (exit status 1; not expected)
Feb 07 08:43:20 containuc zabbix-web[291152]: 2024-02-07 08:43:20,198 INFO exited: nginx (exit status 1; not expected)
Feb 07 08:43:21 containuc zabbix-web[291152]: 2024-02-07 08:43:21,199 INFO gave up: nginx entered FATAL state, too many start retries too quickly
Feb 07 08:43:21 containuc zabbix-web[291152]: 2024-02-07 08:43:21,199 INFO gave up: nginx entered FATAL state, too many start retries too quickly

Is see some sort of template variable in /etc/nginx/nginx.conf:

zabbix@71fc9622c1f2:/usr/share/zabbix$ grep token /etc/nginx/nginx.conf
    server_tokens                   {EXPOSE_WEB_SERVER_INFO};
zabbix@71fc9622c1f2:/usr/share/zabbix$ 

Removing this line fixes the container (until the next restart):

zabbix@be9dca779c30:/usr/share/zabbix$ sed -i 's/server_tokens.*//' /etc/nginx/nginx.conf
zabbix@be9dca779c30:/usr/share/zabbix$ /etc/init.d/nginx start
OS / ENVIRONMENT / Used docker-compose files

podman-4.9.0-1.fc39.x86_64 on Fedora 39 using systemd through quadlets.

CONFIGURATION
~ cat /etc/containers/systemd/zabbix-web.container
[Container]
Image=docker.io/zabbix/zabbix-web-nginx-pgsql:ubuntu-6.0-latest
ContainerName=zabbix-web
Environment=DB_SERVER_HOST=192.168.166.3 POSTGRES_PASSWORD=xxx POSTGRES_USER=postgres ZBX_SERVER_HOST=192.168.166.3 EXPOSE_WEB_SERVER_INFO=on TZ=Europe/Amsterdam PHP_TZ=Europe/Amsterdam
Label=io.containers.autoupdate=registry
PublishPort=1080:8080

[Install]
WantedBy=default.target
~

Added the EXPOSE_WEB_SERVER_INFO var here, which didn't make a difference.

STEPS TO REPRODUCE

Start the container, nginx will fail to start in the container.

EXPECTED RESULTS

Container should start and run nginx or fail when nginx fails to start.

ACTUAL RESULTS

Container starts, but nginx fails to start.


Yep, looks like it:

    server_tokens                   {EXPOSE_WEB_SERVER_INFO};

Should probably be:

    server_tokens                   ${EXPOSE_WEB_SERVER_INFO};

Fixed! Please wait some time while images will be available.