ExportXMLWordPrintable

    • Type: Incident report
    • Resolution: Unresolved
    • Priority: Trivial
    • None
    • Affects Version/s: 7.0.32
    • Component/s: Agent2 (G)
    • Environment:
      Ubuntu

      The post-installation script for the zabbix-agent2 Debian package (introduced by ZBX-28169 to fix world-readable config files) performs chown on plugin config files under /etc/zabbix/zabbix_agent2.d/plugins.d/ without verifying their existence.

      Steps to reproduce:

      1. Install zabbix-agent2 (any version < 7.0.32)
      2. Delete one or more conffiles from /etc/zabbix/zabbix_agent2.d/plugins.d/ (e.g., rm /etc/zabbix/zabbix_agent2.d/plugins.d/smart.conf)
      3. Upgrade to zabbix-agent2 7.0.32 with apt-get install o DPkg::Options::=-force-confold zabbix-agent2

      Result:

      The postinst script fails with exit status 1, leaving the package unconfigured.

      Setting up zabbix-agent2 (1:7.0.32-1+ubuntu20.04) ...
      chown: cannot access '/etc/zabbix/zabbix_agent2.d/plugins.d/smart.conf': No such file or directory
      dpkg: error processing package zabbix-agent2 (--configure):
       installed zabbix-agent2 package post-installation script subprocess returned error exit status 1
      

      This leaves the package in a "not fully installed or removed" state, blocking all subsequent package operations

      Expected:

      The postinst script should gracefully handle missing conffiles (e.g., using chown -f or checking file existence before chown).

      Workaround:

      Reinstall with --force-confmiss to restore deleted conffiles:

      apt-get install --reinstall -o DPkg::Options::=--force-confold -o DPkg::Options::=--force-confmiss zabbix-agent2
      

      Suggested fix:

      Use chown -f or guard the chown with a file existence check, e.g.:

      [ -f "$file" ] && chown zabbix:zabbix "$file"
      

       

       

            Assignee:
            Zabbix Support Team
            Reporter:
            Arthur Morel-Réauté
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: