Ad Widget

Collapse

Lot of error entries "Lost connection to MySQL server during query"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cybermcm
    Junior Member
    • Jan 2019
    • 13

    #1

    Lot of error entries "Lost connection to MySQL server during query"

    Searched forum and google for this and found entries but no real solution.
    Zabbix is running and working, but there are a lot of error messages like
    Code:
    [Z3005] query failed: [2013] Lost connection to MySQL server during query
    This happens between 1 and 10 minutes.

    My setup:
    Raspi 4 with Raspi OS (all updates) and docker
    Code:
    sql:
      container_name: sql
      environment:
       #- PUID=1000 # mariadb
       #- PGID=1000 # mariadb
       - MYSQL_ROOT_PASSWORD=xxx
       - TZ=xxx # mariadb
      hostname: sql
      image: ghcr.io/linuxserver/mariadb
      labels:
       - com.centurylinklabs.watchtower.enable=true
      networks:
       - compose
      ports:
       - "3306:3306"
      restart: always
      volumes:
       - /etc/timezone:/etc/timezone:ro
       - /etc/localtime:/etc/localtime:ro
       - /_sql:/config # mariadb
       - /opt/docker/_backup:/opt/docker/_backup
    
    zabbix:
       container_name: zabbix
       depends_on:
        - sql
        - zabbix-server
       environment:
        - PHP_TZ=xxx
        - DB_SERVER_HOST=sql
        - MYSQL_ROOT_PASSWORD=xxx
       hostname: zabbix
       image: zabbix/zabbix-web-nginx-mysql:alpine-latest
       labels:
        - com.centurylinklabs.watchtower.enable=true  
       networks:
        - compose
       ports:
        - "8083:8080"
       restart: always
       volumes:
       - /etc/timezone:/etc/timezone:ro
       - /etc/localtime:/etc/localtime:ro
     
    zabbix-agent:
      container_name: zabbix-agent
      depends_on:
       - zabbix-server
      environment:
       - ZBX_HOSTNAME=xxx
       - ZBX_SERVER_HOST=172.19.1.2
       #- ZBX_ACTIVESERVERS=zabbix-server
       #- ZBX_DEBUGLEVEL=4
      hostname: zabbix-agent
      #image: zabbixmultiarch/zabbix-agent2
      image: zabbix/zabbix-agent2:alpine-latest
      labels:
       - com.centurylinklabs.watchtower.enable=true  
      network_mode: host
      #networks:
       #- compose
      ports:
       - "10050:10050"
      privileged: true
      restart: always
      user: 0:0
      volumes:
       - /etc/timezone:/etc/timezone:ro
       - /etc/localtime:/etc/localtime:ro
       - /var/run/docker.sock:/var/run/docker.sock:ro
     
    zabbix-server:
      container_name: zabbix-server
      depends_on:
       - sql
      environment:
       - PHP_TZ=xxx
       - DB_SERVER_HOST=sql
       - MYSQL_ROOT_PASSWORD=xxx
       - MYSQL_USER=zabbix
       - MYSQL_PASSWORD=xxx
       - MYSQL_DATABASE=zabbix
       - ZBX_STARTVMWARECOLLECTORS=5
      hostname: zabbix-server
      image: zabbix/zabbix-server-mysql:alpine-latest
      labels:
       - com.centurylinklabs.watchtower.enable=true  
      networks:
       compose:
        ipv4_address: 172.19.1.2
      ports:
       - "10051:10051"
      restart: always
      volumes:
       - /etc/timezone:/etc/timezone:ro
       - /etc/localtime:/etc/localtime:ro
    With the armv7 platform there is nor real stable mysql container, used an older mysql container -> no errors; switching to current MariaDB container (for ARMv7, 10.1.48-MariaDB-0ubuntu0.18.04.1 - Ubuntu 18.04) the error is there

    Tried to lower keepalive, but this didn't solve the issue
    Code:
    net.ipv4.tcp_keepalive_time=300
    any ideas (again, platform is working, trying to clear unnecessary errors)?
  • jeschebach
    Junior Member
    • Oct 2022
    • 8

    #2
    I'm having the same error and I have a zabbix version 4.4.8, running over alpine linux and connected to an RDS Aurora DB.
    Over 450 hits during the last 24hr.

    The ping test does no reveal any networking issue at first glance:
    Code:
    --- xxx ping statistics ---
    1000 packets transmitted, 1000 received, 0% packet loss, time 1017097ms
    rtt min/avg/max/mdev = 0.704/0.819/26.769/0.878 ms
    ​
    The DB has the following timeout parameters:
    Code:
    +-------------------------------------------+----------+
    | Variable_name                             | Value    |
    +-------------------------------------------+----------+
    | aurora_fwd_master_idle_timeout            | 240      |
    | aurora_globaldb_rpo_wait_timeout          | 60       |
    | aurora_zdr_timeout_on_replica_fall_behind | 60       |
    | connect_timeout                           | 540      |
    | delayed_insert_timeout                    | 300      |
    | have_statement_timeout                    | YES      |
    | innodb_flush_log_at_timeout               | 1        |
    | innodb_lock_wait_timeout                  | 50       |
    | innodb_rollback_on_timeout                | OFF      |
    | interactive_timeout                       | 360      |
    | lock_wait_timeout                         | 31536000 |
    | net_read_timeout                          | 720      |
    | net_write_timeout                         | 300      |
    | rpl_stop_slave_timeout                    | 31536000 |
    | slave_net_timeout                         | 60       |
    | wait_timeout                              | 86400    |
    +-------------------------------------------+----------+​
    Any ideas or suggestions to look for?

    Comment

    Working...