Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-17531

Permission denied when setting ZBX_EXPORTFILESIZE in Zabbix docker containers

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 4.4.7
    • None
    • Docker

      Steps to reproduce:

      1. Copy this docker-compose.yml below
      2. docker-compose up

      docker-compose.yml (Minimal Working Example)

      version: '3.1'
      services:
        zabbix-server:
          image: zabbix/zabbix-server-mysql:alpine-4.4.7
          environment:
            - ZBX_EXPORTFILESIZE=1G
            - MYSQL_USER=zabbix
            - MYSQL_PASSWORD=zabbix
            - DB_SERVER_HOST=mysql-server
          networks:
            zabbix:
          depends_on:
            - mysql-server
        mysql-server:
          image: mariadb:10.4.12
          command: [--character-set-server=utf8, --collation-server=utf8_bin]
          environment:
            - MYSQL_RANDOM_ROOT_PASSWORD=yes
            - MYSQL_USER=zabbix
            - MYSQL_PASSWORD=zabbix
            - MYSQL_DATABASE=zabbix
          networks:
            zabbix:
      networks:
        zabbix:
          driver: bridge
      

      Notes:

      • Version numbers are pinned for immutability
      • Notice that I did not mount the export directory. The failure happens even without it being mounted

       

      Result:

      zabbix-server_1  |      7:20200331:085115.501 cannot initialize export: Cannot access path "/var/lib/zabbix/export/": [13] Permission denied.
      zabbix-export-issue_zabbix-server_1 exited with code 1

       

      Debugging:

      It seems the /var/lib/zabbix/export directory has default root:root permissions without write permissions

      [root@ip-172-31-32-132 zabbix-export-issue]# docker run zabbix/zabbix-server-mysql:alpine-4.4.7 ls -l /var/lib/zabbix
      total 0
      drwxr-sr-x    2 zabbix   root             6 Mar 24 00:51 enc
      drwxr-xr-x    2 root     root             6 Mar 31 09:07 export
      drwxr-sr-x    2 zabbix   root             6 Mar 24 00:51 mibs
      drwxr-sr-x    2 zabbix   root             6 Mar 24 00:51 modules
      drwxr-sr-x    2 zabbix   root             6 Mar 24 00:51 snmptraps
      drwxr-sr-x    2 zabbix   root             6 Mar 24 00:51 ssh_keys
      drwxr-sr-x    5 zabbix   root            45 Mar 24 00:51 ssl
      

       

            zabbix.dev Zabbix Development Team
            jad123 Jad
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: