Ad Widget

Collapse

Upgrading to 7.0 - Database error in frontend, no errors in logs

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rondo1
    Junior Member
    • Jun 2024
    • 5

    #1

    Upgrading to 7.0 - Database error in frontend, no errors in logs

    I am running Zabbix using Docker compose. I am attempting to upgrade from Zabbix 6.0.5 to 7.0. After upgrading, I see this error in the front end.

    Code:
    Database error
        The Zabbix database version does not match current requirements. Your database version: 7000000. Required version: 6000000. Please contact your system administrator
    This is my upgrade procedure:
    1. Ensure Zabbix is running.
    2. Upgrade MySQL from version 8.0 to 8.0.30 by changing the docker image to mysql:8.0.30. Required here: https://www.zabbix.com/documentation...#mysql-version
      Code:
      	$ docker-compose -f docker-compose.yaml up -d
      	$ docker logs -f zabbix-docker_mysql-server_1
      	2024-06-14 15:53:49+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
      	2024-06-14 15:53:49+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
      	2024-06-14 15:53:49+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.30-1.el8 started.
      	'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
      	2024-06-14T15:53:50.492907Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
      	2024-06-14T15:53:50.492924Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
      	2024-06-14T15:53:50.494336Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
      	2024-06-14T15:53:50.495581Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.30) starting as process 1
      	2024-06-14T15:53:50.517215Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
      	2024-06-14T15:53:50.848725Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
      	2024-06-14T15:53:53.916447Z 4 [System] [MY-013381] [Server] Server upgrade from '80027' to '80030' started.
      	2024-06-14T15:54:03.871582Z 4 [System] [MY-013381] [Server] Server upgrade from '80027' to '80030' completed.
      	2024-06-14T15:54:04.058192Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
      	2024-06-14T15:54:04.083790Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.30'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server - GPL.
      	2024-06-14T15:54:04.083825Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
      	​
    3. Ensure that log_bin_trust_function_creators = 1​ in the database. Required here: https://www.zabbix.com/documentation...rade_notes_700
      Code:
      	$ docker exec -it zabbix-docker_mysql-server_1 /bin/bash
      	
      	# mysql -u root -p
      	mysql> SHOW VARIABLES\G;
      	...
      	*************************** 312. row ***************************
      	Variable_name: log_bin_trust_function_creators
      	 Value: ON​
      	...
      1. I already have this variable set in my compose file which is why it's on:
        Code:
        		...
        		mysql-server:
        		image: mysql:8.0.30
        		command:
        		- mysqld
        		- --character-set-server=utf8mb4
        		- --collation-server=utf8mb4_bin
        		- --binlog_expire_logs_seconds=259200
        		- --log_bin_trust_function_creators=1​
        		...
    4. Update the other Zabbix components by changing the Docker images to 7.0.0 versions in the compose file.
    5. Bring the compose project up and check Zabbix server logs for upgrade.
      Code:
      	$ docker-compose -f docker-compose.yaml up -d
      	Recreating zabbix-docker_zabbix-agent_1 ... done
      	zabbix-docker_mysql-server_1 is up-to-date
      	Recreating zabbix-docker_zabbix-snmptraps_1 ... done
      	Recreating zabbix-docker_zabbix-server_1    ... done
      	Recreating zabbix-docker_zabbix-web-nginx-mysql_1 ... done
      	
      	$ docker logs -f zabbix-docker_zabbix-server_1
      	    1:20240614:160724.928 Starting Zabbix Server. Zabbix 7.0.0 (revision 49955f1).
      	    1:20240614:160724.929 ****** Enabled features ******
      	    1:20240614:160724.929 SNMP monitoring:           YES
      	    1:20240614:160724.929 IPMI monitoring:           YES
      	    1:20240614:160724.929 Web monitoring:            YES
      	    1:20240614:160724.929 VMware monitoring:         YES
      	    1:20240614:160724.929 SMTP authentication:       YES
      	    1:20240614:160724.929 ODBC:                      YES
      	    1:20240614:160724.929 SSH support:               YES
      	    1:20240614:160724.929 IPv6 support:              YES
      	    1:20240614:160724.929 TLS support:               YES
      	    1:20240614:160724.929 ******************************
      	    1:20240614:160724.929 using configuration file: /etc/zabbix/zabbix_server.conf
      	    1:20240614:160725.006 current database version (mandatory/optional): 06000000/06000002
      	    1:20240614:160725.006 required mandatory version: 07000000
      	    1:20240614:160725.006 mandatory patches were found
      	    1:20240614:160725.012 starting automatic database upgrade
      	    1:20240614:160725.022 completed 0% of database upgrade
      	    1:20240614:160725.670 completed 1% of database upgrade
      	    1:20240614:160726.124 completed 2% of database upgrade
      	    1:20240614:160726.330 completed 3% of database upgrade
      	    1:20240614:160726.575 completed 4% of database upgrade
      	    1:20240614:160726.690 completed 5% of database upgrade
      	    1:20240614:160726.869 completed 6% of database upgrade
      	    1:20240614:160726.994 completed 7% of database upgrade
      	    1:20240614:160727.212 completed 8% of database upgrade
      	    1:20240614:160727.329 completed 9% of database upgrade
      	    1:20240614:160727.417 completed 10% of database upgrade
      	    1:20240614:160727.498 completed 11% of database upgrade
      	    1:20240614:160727.598 completed 12% of database upgrade
      	    1:20240614:160729.387 completed 13% of database upgrade
      	    1:20240614:160732.330 completed 14% of database upgrade
      	    1:20240614:160733.607 completed 15% of database upgrade
      	    1:20240614:160734.502 completed 16% of database upgrade
      	    1:20240614:160734.679 completed 17% of database upgrade
      	    1:20240614:160734.982 completed 18% of database upgrade
      	    1:20240614:160735.123 completed 19% of database upgrade
      	    1:20240614:160735.213 completed 20% of database upgrade
      	    1:20240614:160735.290 completed 21% of database upgrade
      	    1:20240614:160735.371 completed 22% of database upgrade
      	    1:20240614:160735.491 completed 23% of database upgrade
      	    1:20240614:160735.838 completed 24% of database upgrade
      	    1:20240614:160736.094 completed 25% of database upgrade
      	    1:20240614:160736.362 completed 26% of database upgrade
      	    1:20240614:160736.571 completed 27% of database upgrade
      	    1:20240614:160736.892 completed 28% of database upgrade
      	    1:20240614:160739.638 completed 29% of database upgrade
      	    1:20240614:160739.899 completed 30% of database upgrade
      	    1:20240614:160740.354 completed 31% of database upgrade
      	    1:20240614:160740.523 completed 32% of database upgrade
      	    1:20240614:160740.823 completed 33% of database upgrade
      	    1:20240614:160741.068 completed 34% of database upgrade
      	    1:20240614:160741.302 completed 35% of database upgrade
      	    1:20240614:160741.602 completed 36% of database upgrade
      	    1:20240614:160742.016 completed 37% of database upgrade
      	    1:20240614:160742.308 completed 38% of database upgrade
      	    1:20240614:160742.586 completed 39% of database upgrade
      	    1:20240614:160742.805 completed 40% of database upgrade
      	    1:20240614:160743.018 completed 41% of database upgrade
      	    1:20240614:160743.275 completed 42% of database upgrade
      	    1:20240614:160743.541 completed 43% of database upgrade
      	    1:20240614:160743.743 completed 44% of database upgrade
      	    1:20240614:160743.965 completed 45% of database upgrade
      	    1:20240614:160744.109 completed 46% of database upgrade
      	    1:20240614:160744.198 completed 47% of database upgrade
      	    1:20240614:160744.337 completed 48% of database upgrade
      	    1:20240614:160744.431 completed 49% of database upgrade
      	    1:20240614:160744.517 completed 50% of database upgrade
      	    1:20240614:160746.892 completed 51% of database upgrade
      	    1:20240614:160747.094 completed 52% of database upgrade
      	    1:20240614:160747.382 completed 53% of database upgrade
      	    1:20240614:160747.533 completed 54% of database upgrade
      	    1:20240614:160747.937 completed 55% of database upgrade
      	    1:20240614:160748.181 completed 56% of database upgrade
      	    1:20240614:160748.417 completed 57% of database upgrade
      	    1:20240614:160748.571 completed 58% of database upgrade
      	    1:20240614:160748.714 completed 59% of database upgrade
      	    1:20240614:160748.930 completed 60% of database upgrade
      	    1:20240614:160749.183 completed 61% of database upgrade
      	    1:20240614:160749.359 completed 62% of database upgrade
      	    1:20240614:160749.578 completed 63% of database upgrade
      	    1:20240614:160749.722 completed 64% of database upgrade
      	    1:20240614:160749.958 completed 65% of database upgrade
      	    1:20240614:160750.156 completed 66% of database upgrade
      	    1:20240614:160751.603 completed 67% of database upgrade
      	    1:20240614:160751.851 completed 68% of database upgrade
      	    1:20240614:160751.950 completed 69% of database upgrade
      	    1:20240614:160751.984 completed 70% of database upgrade
      	    1:20240614:160752.062 completed 71% of database upgrade
      	    1:20240614:160752.099 completed 72% of database upgrade
      	    1:20240614:160753.283 completed 73% of database upgrade
      	    1:20240614:160753.794 completed 74% of database upgrade
      	    1:20240614:160753.878 completed 75% of database upgrade
      	    1:20240614:160754.240 completed 76% of database upgrade
      	    1:20240614:160754.269 completed 77% of database upgrade
      	    1:20240614:160754.354 completed 78% of database upgrade
      	    1:20240614:160754.598 completed 79% of database upgrade
      	    1:20240614:160754.874 completed 80% of database upgrade
      	    1:20240614:160755.179 completed 81% of database upgrade
      	    1:20240614:160755.497 completed 82% of database upgrade
      	    1:20240614:160755.587 completed 83% of database upgrade
      	    1:20240614:160755.754 completed 84% of database upgrade
      	    1:20240614:160755.994 completed 85% of database upgrade
      	    1:20240614:160756.364 completed 86% of database upgrade
      	    1:20240614:160756.620 completed 87% of database upgrade
      	    1:20240614:160756.841 completed 88% of database upgrade
      	    1:20240614:160756.993 completed 89% of database upgrade
      	    1:20240614:160758.414 completed 90% of database upgrade
      	    1:20240614:160758.491 completed 91% of database upgrade
      	    1:20240614:160758.585 completed 92% of database upgrade
      	    1:20240614:160758.874 completed 93% of database upgrade
      	    1:20240614:160758.987 completed 94% of database upgrade
      	    1:20240614:160759.526 completed 95% of database upgrade
      	    1:20240614:160759.742 completed 96% of database upgrade
      	    1:20240614:160759.974 completed 97% of database upgrade
      	    1:20240614:160800.135 completed 98% of database upgrade
      	    1:20240614:160800.206 completed 99% of database upgrade
      	    1:20240614:160800.231 completed 100% of database upgrade
      	    1:20240614:160800.613 database upgrade fully completed
      	    1:20240614:160800.622 database could be upgraded to use primary keys in history tables
      	  248:20240614:160800.646 starting HA manager
      	  248:20240614:160800.658 HA manager started in active mode​
      This error shows in the frontend: Database error
      The Zabbix database version does not match current requirements. Your database version: 7000000. Required version: 6000000. Please contact your system administrator​.

      I noticed this snippet in the server logs:
      Code:
      	1:20240614:160725.006 current database version (mandatory/optional): 06000000/06000002
      	1:20240614:160725.006 required mandatory version: 07000000
      If I restart the Zabbix server, it changes to this
      Code:
      	$ docker restart zabbix-docker_zabbix-server_1
      	$ docker logs -f zabbix-docker_zabbix-server_1
      	...
      	1:20240614:161217.027 current database version (mandatory/optional): 07000000/07000000
      	1:20240614:161217.027 required mandatory version: 07000000
      	...
      The frontend error does not change from the original. I have verified that log_bin_trust_function_creators = 1​ remains after the upgrade.
      Things I've tried:​
      1. Allow unsuppored db versions: ZBX_ALLOWUNSUPPORTEDDBVERSIONS=0
      2. Setting log_bin_trust_function_creators = 0​ after the upgrade and restarting the services.
      3. Granting all permissions to zabbix user in mysql database before the upgrade.
        Code:
        mysql> grant all privileges on zabbix.* to 'zabbix'@'%';
      4. Restarting all the Zabbix and mysql services.
      5. Restarting the VM.​

    There are no errors in relation to the upgrade in any of the logs for the Zabbix server or MySQL database. Not sure where to go from here. I see many people have similar issue with the error message in the frontend. The solution that is recommended is often setting log_bin_trust_function_creators = 1​. That doesn't seem to work in this case.

    Does anybody have any suggestions? Thank you!​
  • Answer selected by rondo1 at 18-06-2024, 16:29.
    rondo1
    Junior Member
    • Jun 2024
    • 5

    Thank you cyber and Markku for your help.

    Indeed, grep "ZABBIX_VERSION" include/defines.inc.php showed 6.0.5.

    My issue was Docker and how bind mounts work. Here's a snippet of my Docker compose file:
    Code:
    zabbix-web-nginx-mysql:
      image: zabbix/zabbix-web-nginx-mysql:7.0.0-alpine
      ports:
       - "80:80"
       - "443:443"
      volumes:
       - /etc/localtime:/etc/localtime:rw
       - /etc/timezone:/etc/timezone:rw
       - ./zbx_env/etc/ssl/nginx:/etc/ssl/nginx:rw
       - ./zbx_env/usr/share/zabbix/modules/:/usr/share/zabbix/modules/:rw
       - ./zbx_env/usr/share/zabbix/local/conf/:/usr/share/zabbix/local/conf/:ro
       - ./zbx_env/usr/share/zabbix/:/usr/share/zabbix/:rw
       - ./zbx_env/etc/nginx/:/etc/nginx/:rw
    When I would bring the container up, the front end 7.0 would get overwritten by the directories on the host machine. The upgrade happens in the container and not on the host machine. Because of this, the bind mount ./zbx_env/usr/share/zabbix/ was overwriting the container files at/ usr/share/zabbix. The files on the host were still version 6.0.5.

    Solution:
    1. Disable the bind mounts.
      Code:
      	zabbix-web-nginx-mysql:
      	 image: zabbix/zabbix-web-nginx-mysql:7.0.0-alpine
      	 ports:
      	  - "80:80"
      	  - "443:443"
      	 volumes:
      	#   - /etc/localtime:/etc/localtime:rw
      	#   - /etc/timezone:/etc/timezone:rw
      	#   - ./zbx_env/etc/ssl/nginx:/etc/ssl/nginx:rw
      	#   - ./zbx_env/usr/share/zabbix/modules/:/usr/share/zabbix/modules/:rw
      	#   - ./zbx_env/usr/share/zabbix/local/conf/:/usr/share/zabbix/local/conf/:ro
      	#   - ./zbx_env/usr/share/zabbix/:/usr/share/zabbix/:rw
      	#   - ./zbx_env/etc/nginx/:/etc/nginx/:rw
    2. Bring the containers up
      Code:
      	$ docker-compose -f docker-compose.yaml
    3. Copy the updated directory to the host machine
      Code:
      	$ docker cp zabbix-docker_zabbix-web-nginx-mysql_1:/usr/share/zabbix/ /path/to/host
    4. Move updated files to the path of the bind mount. In my case it was ./zbx_env/usr/share/zabbix
      Code:
      	$ sudo mv -f * /home/irlocal/zabbix-docker/zbx_env/usr/share/zabbix/
    5. Uncomment the bind mounts from the compose file.
    6. Bring the containers back up
      Code:
      	​$ docker-compose -f docker-compose.yaml up -d

    Comment

    • Markku
      Senior Member
      Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
      • Sep 2018
      • 1781

      #2
      This error shows in the frontend: Database error
      The Zabbix database version does not match current requirements. Your database version: 7000000. Required version: 6000000.
      This means that your frontend is still at version 6.0.x. You need to upgrade your frontend to 7.0.0.

      Markku

      Comment

      • rondo1
        Junior Member
        • Jun 2024
        • 5

        #3
        Thanks. I do not understand how is the front end on version 6.0.x when the Docker image I am using is specifically 7.0.0. Here is my entire compose file (with sensitive info redacted). Can you explain why the front end would still be on 6.0.x? Additionally, there is nothing in the NGINX logs that show any errors.

        Code:
        version: '3.5'
        services:
         zabbix-server:
          image: zabbix/zabbix-server-mysql:7.0.0-alpine
          ports:
           - "10051:10051"
          volumes:
           - /etc/localtime:/etc/localtime:ro
           - /etc/timezone:/etc/timezone:ro
           - ./zbx_env/usr/lib/zabbix/alertscripts:/usr/lib/zabbix/alertscripts:ro
           - ./zbx_env/usr/lib/zabbix/externalscripts:/usr/lib/zabbix/externalscripts:ro
           - ./zbx_env/var/lib/zabbix/export:/var/lib/zabbix/export:rw
           - ./zbx_env/var/lib/zabbix/modules:/var/lib/zabbix/modules:ro
           - ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
           - ./zbx_env/var/lib/zabbix/ssh_keys:/var/lib/zabbix/ssh_keys:ro
           - ./zbx_env/var/lib/zabbix/mibs:/var/lib/zabbix/mibs:rw
           - ./zbx_env/var/lib/zabbix/ssl:/var/lib/zabbix/ssl:ro
           - snmptraps:/var/lib/zabbix/snmptraps:rw
          env_file:
           - ./env_vars/.env_db_mysql
           - ./env_vars/.env_srv
          secrets:
           - [B]REDACTED[/B]
          depends_on:
           - mysql-server
           - zabbix-agent
          networks:
           zbx_net_backend:
             aliases:
              - zabbix-server
              - zabbix-server-mysql
              - zabbix-server-alpine-mysql
              - zabbix-server-mysql-alpine
             ipv4_address: [B]REDACTED[/B]
           zbx_net_frontend:
          stop_grace_period: 30s
          sysctls:
           - net.ipv4.ip_local_port_range=1024 65000
           - net.ipv4.conf.all.accept_redirects=0
           - net.ipv4.conf.all.secure_redirects=0
           - net.ipv4.conf.all.send_redirects=0
          labels:
           com.zabbix.description: "Zabbix server with MySQL database support"
           com.zabbix.company: "Zabbix LLC"
           com.zabbix.component: "zabbix-server"
           com.zabbix.dbtype: "mysql"
           com.zabbix.os: "alpine"
          logging:
           options:
            max-size: "10m"
        
         zabbix-web-nginx-mysql:
          image: zabbix/zabbix-web-nginx-mysql:7.0.0-alpine
          ports:
           - "80:80"
           - "443:443"
          volumes:
           - /etc/localtime:/etc/localtime:ro
           - /etc/timezone:/etc/timezone:ro
           - ./zbx_env/etc/ssl/nginx:/etc/ssl/nginx:ro
           - ./zbx_env/usr/share/zabbix/modules/:/usr/share/zabbix/modules/:ro
        #   - ./zbx_env/usr/share/zabbix/local/conf/:/usr/share/zabbix/local/conf/:ro
           - ./zbx_env/usr/share/zabbix/:/usr/share/zabbix/:ro
           - ./zbx_env/etc/nginx/:/etc/nginx/:ro
          env_file:
           - ./env_vars/.env_db_mysql
           - ./env_vars/.env_web
          secrets:
           - [B]REDACTED[/B]
          depends_on:
           - zabbix-agent
           - mysql-server
           - zabbix-server
          networks:
           zbx_net_backend:
            aliases:
             - zabbix-web-nginx-mysql
             - zabbix-web-nginx-alpine-mysql
             - zabbix-web-nginx-mysql-alpine
           zbx_net_frontend:
          stop_grace_period: 10s
          sysctls:
           - net.core.somaxconn=65535
          labels:
           com.zabbix.description: "Zabbix frontend on Nginx web-server with MySQL database support"
           com.zabbix.company: "Zabbix LLC"
           com.zabbix.component: "zabbix-frontend"
           com.zabbix.webserver: "nginx"
           com.zabbix.dbtype: "mysql"
           com.zabbix.os: "alpine"
        
         zabbix-agent:
          image: zabbix/zabbix-agent2:7.0.0-alpine
          ports:
           - "10050:10050"
          volumes:
           - /etc/localtime:/etc/localtime:ro
           - /etc/timezone:/etc/timezone:ro
           - ./zbx_env/etc/zabbix/zabbix_agentd.d:/etc/zabbix/zabbix_agentd.d:ro
           - ./zbx_env/var/lib/zabbix/modules:/var/lib/zabbix/modules:ro
           - ./zbx_env/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
           - ./zbx_env/var/lib/zabbix/ssh_keys:/var/lib/zabbix/ssh_keys:ro
          env_file:
           - ./env_vars/.env_agent
          privileged: true
          pid: "host"
          networks:
           zbx_net_backend:
            aliases:
             - zabbix-agent
             - zabbix-agent-passive
             - zabbix-agent-alpine
            ipv4_address: [B]REDACTED[/B]
          stop_grace_period: 5s
          labels:
           com.zabbix.description: "Zabbix agent"
           com.zabbix.company: "Zabbix LLC"
           com.zabbix.component: "zabbix-agentd"
           com.zabbix.os: "alpine"
          tty: true
        
         zabbix-snmptraps:
          image: zabbix/zabbix-snmptraps:7.0.0-alpine
          ports:
           - "162:1162/udp"
          volumes:
           - snmptraps:/var/lib/zabbix/snmptraps
           - ./zbx_env/var/lib/zabbix/mibs:/var/lib/zabbix/mibs:rw
           - ./zbx_env/var/lib/zabbix/snmptraps:/etc/snmp
          networks:
           zbx_net_frontend:
            aliases:
             - zabbix-snmptraps
           zbx_net_backend:
          stop_grace_period: 5s
          depends_on:
            - zabbix-agent
          labels:
           com.zabbix.description: "Zabbix snmptraps"
           com.zabbix.company: "Zabbix LLC"
           com.zabbix.component: "snmptraps"
           com.zabbix.os: "alpine"
        
         mysql-server:
          image: mysql:8.0.30
          command:
           - mysqld
           - --character-set-server=utf8mb4
           - --collation-server=utf8mb4_bin
           - --default-authentication-plugin=mysql_native_password
           - --skip-character-set-client-handshake
           - --binlog_expire_logs_seconds=259200
           - --log_bin_trust_function_creators=1
          volumes:
           - /home/irlocal/zabbix-docker/zbx_env/var/lib/mysql:/var/lib/mysql:rw
           - /home/irlocal/zabbix-docker/zbx_env/etc/mysql/conf.d/docker.cnf:/etc/mysql/conf.d/docker.cnf:rw
          env_file:
           - ./env_vars/.env_db_mysql
          secrets:
           - [B]REDACTED[/B]
          stop_grace_period: 1m
          depends_on:
            - zabbix-agent
          networks:
           zbx_net_backend:
            aliases:
             - mysql-server
             - zabbix-database
             - mysql-database
        
        networks:
          zbx_net_frontend:
            driver: bridge
            driver_opts:
              com.docker.network.enable_ipv6: "false"
            ipam:
              driver: default
              config:
              - subnet: [B]REDACTED[/B]
          zbx_net_backend:
            driver: bridge
            driver_opts:
              com.docker.network.enable_ipv6: "false"
            internal: true
            ipam:
              driver: default
              config:
              - subnet: [B]REDACTED[/B]
        
        volumes:
          snmptraps:
          ldapconfig:
        secrets:
          [B]REDACTED[/B]
        Nginx front end logs. The GET request at the end of the logs returns the database error in the browser.

        Code:
        $ docker logs -f zabbix-docker_zabbix-web-nginx-mysql_1
        ** Deploying Zabbix web-interface (Nginx) with MySQL database
        ********************
        * DB_SERVER_HOST: mysql-server
        * DB_SERVER_PORT: 3306
        * DB_SERVER_DBNAME: zabbix
        ********************
        **** MySQL server is not available. Waiting 5 seconds...
        ** Adding Zabbix virtual host (HTTP)
        **** Impossible to enable SSL support for Nginx. Certificates are missed.
        ** Preparing Zabbix frontend configuration file
        ########################################################
        ** Executing supervisord
        2024-06-17 12:50:11,563 INFO Included extra file "/etc/supervisor/conf.d/supervisord_zabbix.conf" during parsing
        2024-06-17 12:50:11,563 INFO Included extra file "/etc/supervisor/conf.d/supervisord_zabbix.conf" during parsing
        2024-06-17 12:50:11,575 INFO RPC interface 'supervisor' initialized
        2024-06-17 12:50:11,575 INFO RPC interface 'supervisor' initialized
        2024-06-17 12:50:11,576 INFO supervisord started with pid 1
        2024-06-17 12:50:11,576 INFO supervisord started with pid 1
        2024-06-17 12:50:12,580 INFO spawned: 'nginx' with pid 19
        2024-06-17 12:50:12,580 INFO spawned: 'nginx' with pid 19
        2024-06-17 12:50:12,585 INFO spawned: 'php-fpm83' with pid 20
        2024-06-17 12:50:12,585 INFO spawned: 'php-fpm83' with pid 20
        2024/06/17 12:50:12 [warn] 19#19: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
        nginx: [warn] the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
        2024/06/17 12:50:12 [warn] 19#19: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/nginx.conf:78
        nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/nginx.conf:78
        [17-Jun-2024 12:50:12] NOTICE: fpm is running, pid 20
        [17-Jun-2024 12:50:12] NOTICE: ready to handle connections
        2024-06-17 12:50:14,769 INFO success: nginx entered RUNNING state, process has stayed up for > than 2 seconds (startsecs)
        2024-06-17 12:50:14,769 INFO success: nginx entered RUNNING state, process has stayed up for > than 2 seconds (startsecs)
        2024-06-17 12:50:14,769 INFO success: php-fpm83 entered RUNNING state, process has stayed up for > than 2 seconds (startsecs)
        2024-06-17 12:50:14,769 INFO success: php-fpm83 entered RUNNING state, process has stayed up for > than 2 seconds (startsecs)
        192.168.8.30 - - [17/Jun/2024:12:50:28 +0000] "GET /zabbix.php?action=problem.view HTTP/2.0" 500 0 "https://zabbix.net.local/actionconf.php?action=action.massdisable&eventsource=0&g_actionid[]=3" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0" "-"

        Comment

        • Markku
          Senior Member
          Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
          • Sep 2018
          • 1781

          #4
          I don't do docker, it's far too complicated for my static workloads (like Zabbix).

          You showed some config file (= "intended state"), but can you show some runtime status command that shows you are actually running a 7.0.0 frontend?

          Markku

          Comment

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

            #5
            Code:
            grep "ZABBIX_VERSION" include/defines.inc.php
            Should show your GUI version

            Comment

            • rondo1
              Junior Member
              • Jun 2024
              • 5

              #6
              Thank you cyber and Markku for your help.

              Indeed, grep "ZABBIX_VERSION" include/defines.inc.php showed 6.0.5.

              My issue was Docker and how bind mounts work. Here's a snippet of my Docker compose file:
              Code:
              zabbix-web-nginx-mysql:
                image: zabbix/zabbix-web-nginx-mysql:7.0.0-alpine
                ports:
                 - "80:80"
                 - "443:443"
                volumes:
                 - /etc/localtime:/etc/localtime:rw
                 - /etc/timezone:/etc/timezone:rw
                 - ./zbx_env/etc/ssl/nginx:/etc/ssl/nginx:rw
                 - ./zbx_env/usr/share/zabbix/modules/:/usr/share/zabbix/modules/:rw
                 - ./zbx_env/usr/share/zabbix/local/conf/:/usr/share/zabbix/local/conf/:ro
                 - ./zbx_env/usr/share/zabbix/:/usr/share/zabbix/:rw
                 - ./zbx_env/etc/nginx/:/etc/nginx/:rw
              When I would bring the container up, the front end 7.0 would get overwritten by the directories on the host machine. The upgrade happens in the container and not on the host machine. Because of this, the bind mount ./zbx_env/usr/share/zabbix/ was overwriting the container files at/ usr/share/zabbix. The files on the host were still version 6.0.5.

              Solution:
              1. Disable the bind mounts.
                Code:
                	zabbix-web-nginx-mysql:
                	 image: zabbix/zabbix-web-nginx-mysql:7.0.0-alpine
                	 ports:
                	  - "80:80"
                	  - "443:443"
                	 volumes:
                	#   - /etc/localtime:/etc/localtime:rw
                	#   - /etc/timezone:/etc/timezone:rw
                	#   - ./zbx_env/etc/ssl/nginx:/etc/ssl/nginx:rw
                	#   - ./zbx_env/usr/share/zabbix/modules/:/usr/share/zabbix/modules/:rw
                	#   - ./zbx_env/usr/share/zabbix/local/conf/:/usr/share/zabbix/local/conf/:ro
                	#   - ./zbx_env/usr/share/zabbix/:/usr/share/zabbix/:rw
                	#   - ./zbx_env/etc/nginx/:/etc/nginx/:rw
              2. Bring the containers up
                Code:
                	$ docker-compose -f docker-compose.yaml
              3. Copy the updated directory to the host machine
                Code:
                	$ docker cp zabbix-docker_zabbix-web-nginx-mysql_1:/usr/share/zabbix/ /path/to/host
              4. Move updated files to the path of the bind mount. In my case it was ./zbx_env/usr/share/zabbix
                Code:
                	$ sudo mv -f * /home/irlocal/zabbix-docker/zbx_env/usr/share/zabbix/
              5. Uncomment the bind mounts from the compose file.
              6. Bring the containers back up
                Code:
                	​$ docker-compose -f docker-compose.yaml up -d

              Comment

              • rondo1
                Junior Member
                • Jun 2024
                • 5

                #7
                binderth, maybe this will help you.

                Comment

                Working...